From c07324ba5312fba1b53f4c695fe93c2209835799 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 26 Sep 2012 08:07:49 +1000 Subject: [PATCH] fixed issue for sp hack where a jump delay slot which is on the 4k boundary modifies the stack pointer. --- Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 3c662ddc1..a4c10ca19 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -4096,7 +4096,7 @@ void CRecompilerOps::COP0_MT (void) { BeforeCallDirect(m_RegWorkingSet); Call_Direct(SetFpuLocations,"SetFpuLocations"); AfterCallDirect(m_RegWorkingSet); - *(BYTE *)(Jump)= (BYTE )(((BYTE )(m_RecompPos)) - (((BYTE )(Jump)) + 1)); + SetJump8(Jump,m_RecompPos); //TestConstToX86Reg(STATUS_FR,OldStatusReg); //BreakPoint(__FILE__,__LINE__); //m_Section->CompileExit(m_CompilePC+4,m_RegWorkingSet,ExitResetRecompCode,FALSE,JneLabel32); @@ -5176,6 +5176,12 @@ void CRecompilerOps::OverflowDelaySlot (void) PushImm32("CountPerOp()",CountPerOp()); Call_Direct(CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps"); AddConstToX86Reg(x86_ESP,4); + if (bFastSP() && _Recompiler) + { + MoveConstToX86reg((DWORD)_Recompiler,x86_ECX); + Call_Direct(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos"); + } + if (_SyncSystem) { UpdateSyncCPU(m_RegWorkingSet,g_CountPerOp);