diff --git a/Source/Project64/N64 System/Recompiler/Code Section.cpp b/Source/Project64/N64 System/Recompiler/Code Section.cpp index 9bcd56d98..193694a22 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Section.cpp @@ -449,7 +449,7 @@ void CCodeSection::GenerateSectionLinkage (void) JumpInfo[i]->LinkLocation2 = NULL; } } - CompileExit (CompilePC(), JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,CExitInfo::Normal,true,NULL); + CompileExit (JumpInfo[i]->JumpPC, JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,JumpInfo[i]->ExitReason,true,NULL); JumpInfo[i]->FallThrough = false; } else if (TargetSection[i] != NULL && JumpInfo[i] != NULL) { if (!JumpInfo[i]->FallThrough) { continue; } @@ -462,7 +462,7 @@ void CCodeSection::GenerateSectionLinkage (void) JumpInfo[i]->LinkLocation2 = NULL; } } - CompileExit (CompilePC(), JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,CExitInfo::Normal,true,NULL); + CompileExit (JumpInfo[i]->JumpPC, JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,JumpInfo[i]->ExitReason,true,NULL); //FreeSection(TargetSection[i],Section); } } @@ -586,7 +586,7 @@ void CCodeSection::GenerateSectionLinkage (void) SetJump32(JumpInfo[i]->LinkLocation2,(DWORD *)m_RecompPos); JumpInfo[i]->LinkLocation2 = NULL; } - CompileExit (CompilePC(),JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,CExitInfo::Normal,true,NULL); + CompileExit (JumpInfo[i]->JumpPC,JumpInfo[i]->TargetPC,JumpInfo[i]->RegSet,JumpInfo[i]->ExitReason,true,NULL); continue; } if (JumpInfo[i]->TargetPC != TargetSection[i]->m_EnterPC) diff --git a/Source/Project64/N64 System/Recompiler/Jump Info.h b/Source/Project64/N64 System/Recompiler/Jump Info.h index 0791973db..82f26c10c 100644 --- a/Source/Project64/N64 System/Recompiler/Jump Info.h +++ b/Source/Project64/N64 System/Recompiler/Jump Info.h @@ -12,6 +12,7 @@ class CJumpInfo { + typedef CExitInfo::EXIT_REASON EXIT_REASON; public: CJumpInfo(); @@ -24,4 +25,5 @@ public: bool PermLoop; bool DoneDelaySlot; //maybe deletable CRegInfo RegSet; + EXIT_REASON ExitReason; }; diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index d6b6784b9..2b90c9944 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -241,6 +241,8 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc, CPU_Message("CompileSystemCheck 12"); CompileSystemCheck(FallInfo->TargetPC,m_Section->m_Jump.RegSet); ResetX86Protection(); + FallInfo->ExitReason = CExitInfo::Normal_NoSysCheck; + FallInfo->JumpPC = (DWORD)-1; } } else { if (m_Section->m_ContinueSection != NULL) { diff --git a/Source/Project64/N64 System/Recompiler/Section Info.cpp b/Source/Project64/N64 System/Recompiler/Section Info.cpp index 7e6d43b6d..192729221 100644 --- a/Source/Project64/N64 System/Recompiler/Section Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Section Info.cpp @@ -20,6 +20,7 @@ CJumpInfo::CJumpInfo() FallThrough = false; PermLoop = false; DoneDelaySlot = false; + ExitReason = CExitInfo::Normal; } #ifdef tofix