From f933328f3d4b5bed9e3cb7f2f8fb6349b37b2403 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 9 Aug 2016 21:16:14 +0100 Subject: [PATCH] Dyncom: Correct STREXD behaviour when CPSR.E == 1 --- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 01d5d478e..205686619 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -1884,8 +1884,13 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { cpu->SetExclusiveMemoryAddress(read_addr); - RD = cpu->ReadMemory32(read_addr); - RD2 = cpu->ReadMemory32(read_addr + 4); + if (cpu->InBigEndianMode()) { + RD = cpu->ReadMemory32(read_addr + 4); + RD2 = cpu->ReadMemory32(read_addr); + } else { + RD = cpu->ReadMemory32(read_addr); + RD2 = cpu->ReadMemory32(read_addr + 4); + } } cpu->Reg[15] += cpu->GetInstructionSize(); INC_PC(sizeof(generic_arm_inst));