all repos — mgba @ 21b9222357165070842290e3bd804388b57bfb49

mGBA Game Boy Advance Emulator

Fix entering SWI mode
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 02:50:35 -0700
commit

21b9222357165070842290e3bd804388b57bfb49

parent

bd9714b5405c307ae061f262ff43fedc104f5cc6

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/arm/arm.csrc/arm/arm.c

@@ -145,7 +145,7 @@ instructionWidth = WORD_SIZE_ARM;

} ARMSetPrivilegeMode(cpu, MODE_SUPERVISOR); cpu->cpsr.priv = MODE_IRQ; - cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] - instructionWidth + WORD_SIZE_ARM; + cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] - instructionWidth; cpu->gprs[ARM_PC] = BASE_SWI + WORD_SIZE_ARM; cpu->memory->setActiveRegion(cpu->memory, cpu->gprs[ARM_PC]); _ARMSetMode(cpu, MODE_ARM);