All: Reset next event to cycles instead of zero to interrupt

This commit is contained in:
Jeffrey Pfau 2015-10-05 19:20:13 -07:00
parent 268e9138c6
commit 3a15553c09
4 changed files with 6 additions and 5 deletions

View File

@ -35,6 +35,7 @@ Misc:
- Qt: Dropping multiplayer windows works more cleanly now - Qt: Dropping multiplayer windows works more cleanly now
- GBA BIOS: Implement RegisterRamReset for SIO registers - GBA BIOS: Implement RegisterRamReset for SIO registers
- GBA: Additional savestate sanity checks - GBA: Additional savestate sanity checks
- All: Reset next event to cycles instead of zero to interrupt
0.3.0: (2015-08-16) 0.3.0: (2015-08-16)
Features: Features:

View File

@ -86,7 +86,7 @@ static inline void _ARMSetMode(struct ARMCore* cpu, enum ExecutionMode execution
case MODE_THUMB: case MODE_THUMB:
cpu->cpsr.t = 1; cpu->cpsr.t = 1;
} }
cpu->nextEvent = 0; cpu->nextEvent = cpu->cycles;
} }
static inline void _ARMReadCPSR(struct ARMCore* cpu) { static inline void _ARMReadCPSR(struct ARMCore* cpu) {

View File

@ -103,7 +103,7 @@ void ARMDebuggerRun(struct ARMDebugger* debugger) {
void ARMDebuggerEnter(struct ARMDebugger* debugger, enum DebuggerEntryReason reason, struct DebuggerEntryInfo* info) { void ARMDebuggerEnter(struct ARMDebugger* debugger, enum DebuggerEntryReason reason, struct DebuggerEntryInfo* info) {
debugger->state = DEBUGGER_PAUSED; debugger->state = DEBUGGER_PAUSED;
struct ARMCore* cpu = debugger->cpu; struct ARMCore* cpu = debugger->cpu;
cpu->nextEvent = 0; cpu->nextEvent = cpu->cycles;
if (reason == DEBUGGER_ENTER_BREAKPOINT) { if (reason == DEBUGGER_ENTER_BREAKPOINT) {
struct DebugBreakpoint* breakpoint = _lookupBreakpoint(debugger->swBreakpoints, _ARMPCAddress(cpu)); struct DebugBreakpoint* breakpoint = _lookupBreakpoint(debugger->swBreakpoints, _ARMPCAddress(cpu));
debugger->currentBreakpoint = breakpoint; debugger->currentBreakpoint = breakpoint;

View File

@ -574,12 +574,12 @@ void GBATestIRQ(struct ARMCore* cpu) {
struct GBA* gba = (struct GBA*) cpu->master; 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]) { if (gba->memory.io[REG_IME >> 1] && gba->memory.io[REG_IE >> 1] & gba->memory.io[REG_IF >> 1]) {
gba->springIRQ = 1; gba->springIRQ = 1;
gba->cpu->nextEvent = 0; gba->cpu->nextEvent = gba->cpu->cycles;
} }
} }
void GBAHalt(struct GBA* gba) { void GBAHalt(struct GBA* gba) {
gba->cpu->nextEvent = 0; gba->cpu->nextEvent = gba->cpu->cycles;
gba->cpu->halted = 1; gba->cpu->halted = 1;
} }
@ -587,7 +587,7 @@ void GBAStop(struct GBA* gba) {
if (!gba->stopCallback) { if (!gba->stopCallback) {
return; return;
} }
gba->cpu->nextEvent = 0; gba->cpu->nextEvent = gba->cpu->cycles;
gba->stopCallback->stop(gba->stopCallback); gba->stopCallback->stop(gba->stopCallback);
} }