From de1d20fbba4c7df976cf828ded494a29c7c5b677 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Thu, 7 Feb 2013 19:02:02 -0600 Subject: [PATCH 1/1] Added missing IRQ handling after STOP The previous fix was incomplete: it only worked until a STOP instruction was issued. Incoming IRQs could not wake the M68K from its stopped state. This has been fixed. :-) --- src/m68000/m68kinterface.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/m68000/m68kinterface.c b/src/m68000/m68kinterface.c index 528d7e7..dd5dfc1 100644 --- a/src/m68000/m68kinterface.c +++ b/src/m68000/m68kinterface.c @@ -203,17 +203,6 @@ void m68k_pulse_reset(void) int m68k_execute(int num_cycles) { -#if 0 - /* Make sure we're not stopped */ - if (CPU_STOPPED) - { - /* We get here if the CPU is stopped or halted */ - SET_CYCLES(0); - CPU_INT_CYCLES = 0; - - return num_cycles; - } -#else if (regs.stopped) { regs.remainingCycles = 0; // int32_t @@ -221,7 +210,6 @@ int m68k_execute(int num_cycles) return num_cycles; } -#endif #if 0 /* Set our pool of clock cycles available */ @@ -364,6 +352,13 @@ if (inRoutine) void m68k_set_irq(unsigned int intLevel) { + // We need to check for stopped state as well... + if (regs.stopped) + { + m68k_set_irq2(intLevel); + return; + } + // Since this can be called asynchronously, we need to fix it so that it // doesn't fuck up the main execution loop. IRQLevelToHandle = intLevel; -- 2.37.2