]> Shamusworld >> Repos - virtualjaguar/commitdiff
Added missing IRQ handling after STOP
authorShamus Hammons <jlhamm@acm.org>
Fri, 8 Feb 2013 01:02:02 +0000 (19:02 -0600)
committerShamus Hammons <jlhamm@acm.org>
Fri, 8 Feb 2013 01:02:02 +0000 (19:02 -0600)
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

index 528d7e7ae1f66a54c7c6da34d1cb44e1b5487df7..dd5dfc1e74f1b7aea3880294f3621b9bdf2807a2 100644 (file)
@@ -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;