From 50407a8dc86685d6f261680162823dfc44377285 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 14 Aug 2016 00:49:34 +0100 Subject: [PATCH] Dyncom: Correct implementation of STM for R15 --- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 01d5d478e4..6d5fb7aecc 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -3228,7 +3228,7 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { addr += 4; } if (BIT(inst_cream->inst, 15)) { - cpu->WriteMemory32(addr, cpu->Reg_usr[1] + 8); + cpu->WriteMemory32(addr, cpu->Reg[15] + 8); } } else { for (int i = 0; i < 15; i++) { @@ -3243,8 +3243,9 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { } // Check PC reg - if (BIT(inst_cream->inst, 15)) - cpu->WriteMemory32(addr, cpu->Reg_usr[1] + 8); + if (BIT(inst_cream->inst, 15)) { + cpu->WriteMemory32(addr, cpu->Reg[15] + 8); + } } } cpu->Reg[15] += cpu->GetInstructionSize();