From d06212e766f3124fa22581ba25bb62b5c9801738 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 7 Nov 2024 11:05:55 +1030 Subject: [PATCH] Core: CX86RecompilerOps::JAL stop double call to UpdateCounters --- .../N64System/Recompiler/x86/x86RecompilerOps.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 8ea0928a5..a61ee1374 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -2321,8 +2321,10 @@ void CX86RecompilerOps::JAL() uint64_t TargetPC = (m_CompilePC & 0xFFFFFFFFF0000000) + (m_Opcode.target << 2); bool bCheck = TargetPC <= m_CompilePC; - UpdateCounters(m_RegWorkingSet, bCheck, true); - + if (bCheck) + { + UpdateCounters(m_RegWorkingSet, bCheck, true); + } CompileExit((uint64_t)-1, (uint64_t)-1, m_RegWorkingSet, bCheck ? ExitReason_Normal : ExitReason_NormalNoSysCheck, true, nullptr); } m_PipelineStage = PIPELINE_STAGE_END_BLOCK; @@ -9526,7 +9528,7 @@ void CX86RecompilerOps::CompileExit(uint64_t JumpPC, uint64_t TargetPC, CRegInfo } else { - UpdateCounters(ExitRegSet, false, reason == ExitReason_Normal); + UpdateCounters(ExitRegSet, false, reason == ExitReason_Normal, reason != ExitReason_Normal); } bool InDelaySlot = m_PipelineStage == PIPELINE_STAGE_JUMP || m_PipelineStage == PIPELINE_STAGE_DELAY_SLOT;