Mercurial > repos > blastem
diff 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 |
line wrap: on
line diff
--- a/runtime.S Tue Jan 01 07:06:57 2013 -0800 +++ b/runtime.S Tue Jan 01 09:40:17 2013 -0800 @@ -1,8 +1,10 @@ .global handle_cycle_limit + .global do_sync handle_cycle_limit: cmp 84(%rsi), %eax jb skip_sync +do_sync: call m68k_save_context mov %rsi, %rdi call sync_components @@ -49,9 +51,14 @@ /* discard function return address */ pop %rdi jmp *%rcx + ret skip_int: + cmp 84(%rsi), %eax + jnb do_sync ret + .global do_sync + int_dbg_msg: .asciz "Executing Interrupt!" print_int_dbg: