Skip to content

Commit

Permalink
EE REC: Prevent crash when DI instruction is in branch delay slot
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jul 16, 2020
1 parent a782e03 commit 54f4757
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pcsx2/x86/iCOP0.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pcsx2/x86/iR5900.h
Expand Up @@ -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();
Expand Down

0 comments on commit 54f4757

Please sign in to comment.