From 97479c4d00779f8f28fee7f5370ec2a466ffeb1f Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 5 Apr 2015 18:06:31 -0700 Subject: [PATCH] ARM7: Fix SWI and IRQ timings --- CHANGES | 1 + src/arm/arm.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 1122b4a6a..f4b19be89 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ Bugfixes: - Qt: Fix .deb dependencies - GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio - Qt: Fix "QOpenGLContext::swapBuffers() called with non-exposed window" warning + - ARM7: Fix SWI and IRQ timings 0.2.0: (2015-04-03) Features: diff --git a/src/arm/arm.c b/src/arm/arm.c index 05cb65eef..b75274aa3 100644 --- a/src/arm/arm.c +++ b/src/arm/arm.c @@ -164,10 +164,10 @@ void ARMRaiseIRQ(struct ARMCore* cpu) { cpu->gprs[ARM_PC] = BASE_IRQ; int currentCycles = 0; ARM_WRITE_PC; - cpu->memory.setActiveRegion(cpu, cpu->gprs[ARM_PC]); _ARMSetMode(cpu, MODE_ARM); cpu->spsr = cpsr; cpu->cpsr.i = 1; + cpu->cycles += currentCycles; } void ARMRaiseSWI(struct ARMCore* cpu) { @@ -184,10 +184,10 @@ void ARMRaiseSWI(struct ARMCore* cpu) { cpu->gprs[ARM_PC] = BASE_SWI; int currentCycles = 0; ARM_WRITE_PC; - cpu->memory.setActiveRegion(cpu, cpu->gprs[ARM_PC]); _ARMSetMode(cpu, MODE_ARM); cpu->spsr = cpsr; cpu->cpsr.i = 1; + cpu->cycles += currentCycles; } static inline void ARMStep(struct ARMCore* cpu) {