X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fm68000%2Fm68kinterface.c;h=13015d0558bf72d70d449c70d1a702c9b1f73ce1;hb=f0a806e6b168b1c9cab5c9d7a27435dc4a76476a;hp=dd5dfc1e74f1b7aea3880294f3621b9bdf2807a2;hpb=25646c0a48be1832e20fd4fcdd2d40ba2174bfa3;p=virtualjaguar diff --git a/src/m68000/m68kinterface.c b/src/m68000/m68kinterface.c index dd5dfc1..13015d0 100644 --- a/src/m68000/m68kinterface.c +++ b/src/m68000/m68kinterface.c @@ -127,6 +127,18 @@ void DumpRegisters(void) #endif +void M68KSetHalt(void) +{ + regs.stopped = 1; +} + + +void M68KClearHalt(void) +{ + regs.stopped = 0; +} + + void m68k_set_cpu_type(unsigned int type) { } @@ -327,6 +339,16 @@ if (inRoutine) //printf("Executed opcode $%04X (%i cycles)...\n", opcode, cycles); #endif + // This is so our debugging code can break in on a dime. + // Otherwise, this is just extra slow down :-P + if (regs.stopped) + { + num_cycles = initialCycles - regs.remainingCycles; + regs.remainingCycles = 0; // int32_t + regs.interruptCycles = 0; // uint32_t + + return num_cycles; + } } while (regs.remainingCycles > 0); @@ -466,11 +488,14 @@ void m68ki_exception_interrupt(uint32_t intLevel) #endif /* M68K_EMULATE_INT_ACK */ #else // Turn off the stopped state - regs.stopped = 0; +// Needed? +// regs.stopped = 0; //JLH: need to add halt state? +// prolly, for debugging/alpine mode... :-/ +// but then again, this should be handled already by the main execution loop :-P // If we are halted, don't do anything -// if (CPU_STOPPED) +// if (regs.stopped) // return; // Acknowledge the interrupt (NOTE: This is a user supplied function!)