fixed issue for sp hack where a jump delay slot which is on the 4k boundary modifies the stack pointer.

This commit is contained in:
zilmar 2012-09-26 08:07:49 +10:00
parent d8502c5019
commit c07324ba53
1 changed files with 7 additions and 1 deletions

View File

@ -4096,7 +4096,7 @@ void CRecompilerOps::COP0_MT (void) {
BeforeCallDirect(m_RegWorkingSet); BeforeCallDirect(m_RegWorkingSet);
Call_Direct(SetFpuLocations,"SetFpuLocations"); Call_Direct(SetFpuLocations,"SetFpuLocations");
AfterCallDirect(m_RegWorkingSet); AfterCallDirect(m_RegWorkingSet);
*(BYTE *)(Jump)= (BYTE )(((BYTE )(m_RecompPos)) - (((BYTE )(Jump)) + 1)); SetJump8(Jump,m_RecompPos);
//TestConstToX86Reg(STATUS_FR,OldStatusReg); //TestConstToX86Reg(STATUS_FR,OldStatusReg);
//BreakPoint(__FILE__,__LINE__); //m_Section->CompileExit(m_CompilePC+4,m_RegWorkingSet,ExitResetRecompCode,FALSE,JneLabel32); //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()); PushImm32("CountPerOp()",CountPerOp());
Call_Direct(CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps"); Call_Direct(CInterpreterCPU::ExecuteOps, "CInterpreterCPU::ExecuteOps");
AddConstToX86Reg(x86_ESP,4); AddConstToX86Reg(x86_ESP,4);
if (bFastSP() && _Recompiler)
{
MoveConstToX86reg((DWORD)_Recompiler,x86_ECX);
Call_Direct(AddressOf(&CRecompiler::ResetMemoryStackPos), "CRecompiler::ResetMemoryStackPos");
}
if (_SyncSystem) if (_SyncSystem)
{ {
UpdateSyncCPU(m_RegWorkingSet,g_CountPerOp); UpdateSyncCPU(m_RegWorkingSet,g_CountPerOp);