Mercurial > repos > blastem
comparison runtime.S @ 150:3e68e517cc01
Do a sync when interrupt mask changes so we can recompute the next interrupt cycle. Also fix a bug in which the SR part of ORI to SR was not being performed.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 01 Jan 2013 09:40:17 -0800 |
parents | 139e5dcd6aa3 |
children | 79958b95526f |
comparison
equal
deleted
inserted
replaced
149:139e5dcd6aa3 | 150:3e68e517cc01 |
---|---|
1 | 1 |
2 .global handle_cycle_limit | 2 .global handle_cycle_limit |
3 .global do_sync | |
3 handle_cycle_limit: | 4 handle_cycle_limit: |
4 cmp 84(%rsi), %eax | 5 cmp 84(%rsi), %eax |
5 jb skip_sync | 6 jb skip_sync |
7 do_sync: | |
6 call m68k_save_context | 8 call m68k_save_context |
7 mov %rsi, %rdi | 9 mov %rsi, %rdi |
8 call sync_components | 10 call sync_components |
9 mov %rax, %rsi | 11 mov %rax, %rsi |
10 call m68k_load_context | 12 call m68k_load_context |
47 call m68k_native_addr_and_sync | 49 call m68k_native_addr_and_sync |
48 add $24, %eax | 50 add $24, %eax |
49 /* discard function return address */ | 51 /* discard function return address */ |
50 pop %rdi | 52 pop %rdi |
51 jmp *%rcx | 53 jmp *%rcx |
54 ret | |
52 skip_int: | 55 skip_int: |
53 ret | 56 cmp 84(%rsi), %eax |
57 jnb do_sync | |
58 ret | |
59 | |
60 .global do_sync | |
54 | 61 |
55 int_dbg_msg: | 62 int_dbg_msg: |
56 .asciz "Executing Interrupt!" | 63 .asciz "Executing Interrupt!" |
57 print_int_dbg: | 64 print_int_dbg: |
58 call m68k_save_context | 65 call m68k_save_context |