diff --git a/CHANGES b/CHANGES index 13956dcd1..54250b83c 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,7 @@ Misc: - GBA BIOS: Implement RegisterRamReset for SIO registers - GBA: Additional savestate sanity checks - GBA: Check for cycle count being too high + - All: Reset next event to cycles instead of zero to interrupt 0.3.0: (2015-08-16) Features: diff --git a/src/arm/isa-inlines.h b/src/arm/isa-inlines.h index cdf6f9cba..42a581b4a 100644 --- a/src/arm/isa-inlines.h +++ b/src/arm/isa-inlines.h @@ -86,7 +86,7 @@ static inline void _ARMSetMode(struct ARMCore* cpu, enum ExecutionMode execution case MODE_THUMB: cpu->cpsr.t = 1; } - cpu->nextEvent = 0; + cpu->nextEvent = cpu->cycles; } static inline void _ARMReadCPSR(struct ARMCore* cpu) { diff --git a/src/debugger/debugger.c b/src/debugger/debugger.c index 62d47680b..14e7da62a 100644 --- a/src/debugger/debugger.c +++ b/src/debugger/debugger.c @@ -103,7 +103,7 @@ void ARMDebuggerRun(struct ARMDebugger* debugger) { void ARMDebuggerEnter(struct ARMDebugger* debugger, enum DebuggerEntryReason reason, struct DebuggerEntryInfo* info) { debugger->state = DEBUGGER_PAUSED; struct ARMCore* cpu = debugger->cpu; - cpu->nextEvent = 0; + cpu->nextEvent = cpu->cycles; if (reason == DEBUGGER_ENTER_BREAKPOINT) { struct DebugBreakpoint* breakpoint = _lookupBreakpoint(debugger->swBreakpoints, _ARMPCAddress(cpu)); debugger->currentBreakpoint = breakpoint; diff --git a/src/gba/gba.c b/src/gba/gba.c index a2ba3c769..eda945161 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -552,12 +552,12 @@ void GBATestIRQ(struct ARMCore* cpu) { struct GBA* gba = (struct GBA*) cpu->master; if (gba->memory.io[REG_IME >> 1] && gba->memory.io[REG_IE >> 1] & gba->memory.io[REG_IF >> 1]) { gba->springIRQ = 1; - gba->cpu->nextEvent = 0; + gba->cpu->nextEvent = gba->cpu->cycles; } } void GBAHalt(struct GBA* gba) { - gba->cpu->nextEvent = 0; + gba->cpu->nextEvent = gba->cpu->cycles; gba->cpu->halted = 1; } @@ -565,7 +565,7 @@ void GBAStop(struct GBA* gba) { if (!gba->stopCallback) { return; } - gba->cpu->nextEvent = 0; + gba->cpu->nextEvent = gba->cpu->cycles; gba->stopCallback->stop(gba->stopCallback); }