all repos — mgba @ 3a15553c097c406d9c07fb110e6df95abc42f916

mGBA Game Boy Advance Emulator

All: Reset next event to cycles instead of zero to interrupt
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Oct 2015 19:20:13 -0700
commit

3a15553c097c406d9c07fb110e6df95abc42f916

parent

268e9138c6a4e0fb3101c735cd4430f013e38134

4 files changed, 6 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -35,6 +35,7 @@ - Qt: Disable menu items in multiplayer that don't make sense to have enabled

- Qt: Dropping multiplayer windows works more cleanly now - GBA BIOS: Implement RegisterRamReset for SIO registers - GBA: Additional savestate sanity checks + - All: Reset next event to cycles instead of zero to interrupt 0.3.0: (2015-08-16) Features:
M src/arm/isa-inlines.hsrc/arm/isa-inlines.h

@@ -86,7 +86,7 @@ break;

case MODE_THUMB: cpu->cpsr.t = 1; } - cpu->nextEvent = 0; + cpu->nextEvent = cpu->cycles; } static inline void _ARMReadCPSR(struct ARMCore* cpu) {
M src/debugger/debugger.csrc/debugger/debugger.c

@@ -103,7 +103,7 @@

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;
M src/gba/gba.csrc/gba/gba.c

@@ -574,12 +574,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; }

@@ -587,7 +587,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); }