From c2a57b79a03adaead1044fccb67988ddfe0d5b67 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:41:01 -0400 Subject: [PATCH] fix stmd(a/b) writeback --- src/ARMInterpreter_LoadStore.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ARMInterpreter_LoadStore.cpp b/src/ARMInterpreter_LoadStore.cpp index afcca05d..96766288 100644 --- a/src/ARMInterpreter_LoadStore.cpp +++ b/src/ARMInterpreter_LoadStore.cpp @@ -558,8 +558,12 @@ void A_STM(ARM* cpu) if (cpu->CurInstr & (1<<22)) cpu->UpdateMode((cpu->CPSR&~0x1F)|0x10, cpu->CPSR, true); - if ((cpu->CurInstr & (1<<23)) && (cpu->CurInstr & (1<<21)) && !dataabort) - cpu->R[baseid] = base; + if (!dataabort) + { + if ((cpu->CurInstr & (1<<23)) && (cpu->CurInstr & (1<<21))) + cpu->R[baseid] = base; + } + else cpu->R[baseid] = oldbase; cpu->AddCycles_CD(); }