# HG changeset patch # User Michael Pavone # Date 1552539682 25200 # Node ID 30b5952fd32e697e84416a7d2b638422b7044128 # Parent 5358a7126b96e8ac43f78e1eff1e86b7a2c5fa9a Get latency between interrupt latch and interrupt acceptance working with Musashi diff -r 5358a7126b96 -r 30b5952fd32e m68k_core.c --- a/m68k_core.c Wed Mar 13 20:34:24 2019 -0700 +++ b/m68k_core.c Wed Mar 13 22:01:22 2019 -0700 @@ -1287,6 +1287,7 @@ #endif context->int_cycle = CYCLE_NEVER; + context->int_pending = 255; context->status = 0x27; context->reset_handler = (code_ptr)reset_handler; return context; diff -r 5358a7126b96 -r 30b5952fd32e musashi/m68kcpu.c --- a/musashi/m68kcpu.c Wed Mar 13 20:34:24 2019 -0700 +++ b/musashi/m68kcpu.c Wed Mar 13 22:01:22 2019 -0700 @@ -898,9 +898,17 @@ /* If we are halted, don't do anything */ if(this->stopped) return; + + if (this->c.int_pending == 255) { + this->c.int_pending = int_level; + return; + } else { + int_level = this->c.int_pending; + } /* Acknowledge the interrupt */ this->c.int_ack = int_level; + this->c.int_pending = 255; vector = M68K_INT_ACK_AUTOVECTOR;//int_ack_callback(*this, int_level);