From 54f47572affbb1e3bdff2f01e77bce9ee942d031 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Thu, 16 Jul 2020 20:09:12 +0100 Subject: [PATCH] EE REC: Prevent crash when DI instruction is in branch delay slot --- pcsx2/x86/iCOP0.cpp | 3 ++- pcsx2/x86/iR5900.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/iCOP0.cpp b/pcsx2/x86/iCOP0.cpp index de182af291..7d05d45a61 100644 --- a/pcsx2/x86/iCOP0.cpp +++ b/pcsx2/x86/iCOP0.cpp @@ -117,7 +117,8 @@ void recDI() // Fixes booting issues in the following games: // Jak X, Namco 50th anniversary, Spongebob the Movie, Spongebob Battle for Bikini Bottom, // The Incredibles, The Incredibles rize of the underminer, Soukou kihei armodyne, Garfield Saving Arlene, Tales of Fandom Vol. 2. - recompileNextInstruction(0); // DI execution is delayed by one instruction + if(!g_recompilingDelaySlot) + recompileNextInstruction(0); // DI execution is delayed by one instruction xMOV(eax, ptr[&cpuRegs.CP0.n.Status]); xTEST(eax, 0x20006); // EXL | ERL | EDI diff --git a/pcsx2/x86/iR5900.h b/pcsx2/x86/iR5900.h index 9c24fe769d..cae194451b 100644 --- a/pcsx2/x86/iR5900.h +++ b/pcsx2/x86/iR5900.h @@ -61,6 +61,7 @@ extern u32 s_nBlockCycles; // cycles of current block recompiling // Used to clear recompiled code blocks during memory/dma write operations. u32 recClearMem(u32 pc); u32 REC_CLEARM( u32 mem ); +extern bool g_recompilingDelaySlot; // used when processing branches void SaveBranchState();