From e462f1ff9c8f4b1a35076096c8eaca959f97f1d0 Mon Sep 17 00:00:00 2001 From: Ty Lamontagne Date: Thu, 27 Apr 2023 22:56:57 -0400 Subject: [PATCH] iR3000: Fix memchecks that only log --- pcsx2/x86/iR3000A.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 303c126c54..6d892c59ed 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -1382,7 +1382,18 @@ static void psxRecMemcheck(u32 op, u32 bits, bool store) if (checks[i].result & MEMCHECK_LOG) { xMOV(edx, store); - xFastCall((void*)psxDynarecMemLogcheck, ecx, edx); + + // Refer to the EE recompiler for an explaination + if(!(checks[i].result & MEMCHECK_BREAK)) + { + xPUSH(eax); xPUSH(ebx); xPUSH(ecx); xPUSH(edx); + xFastCall((void*)psxDynarecMemLogcheck, ecx, edx); + xPOP(edx); xPOP(ecx); xPOP(ebx); xPOP(eax); + } + else + { + xFastCall((void*)psxDynarecMemLogcheck, ecx, edx); + } } if (checks[i].result & MEMCHECK_BREAK) {