From a5a2c8cf6d8e3e4b03343b36d0031560116d56a0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 13 Feb 2025 12:22:52 +1030 Subject: [PATCH] Core: in CRecompiler::RecompilerMain_Lookup when TriggerAddressException has occured, update the PC before checking if valid --- Source/Project64-core/N64System/Recompiler/Recompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64-core/N64System/Recompiler/Recompiler.cpp b/Source/Project64-core/N64System/Recompiler/Recompiler.cpp index 93e2514e5..eee6317e4 100644 --- a/Source/Project64-core/N64System/Recompiler/Recompiler.cpp +++ b/Source/Project64-core/N64System/Recompiler/Recompiler.cpp @@ -138,13 +138,13 @@ void CRecompiler::RecompilerMain_Lookup() if (!m_MMU.VAddrToPAddr((uint32_t)PROGRAM_COUNTER, PhysicalAddr)) { m_Reg.TriggerAddressException(PROGRAM_COUNTER, EXC_RMISS); + PROGRAM_COUNTER = m_System.m_JumpToLocation; + m_System.m_PipelineStage = PIPELINE_STAGE_NORMAL; if (!m_MMU.VAddrToPAddr((uint32_t)PROGRAM_COUNTER, PhysicalAddr)) { g_Notify->DisplayError(stdstr_f("Failed to translate PC to a PAddr: %X\n\nEmulation stopped", PROGRAM_COUNTER).c_str()); m_EndEmulation = true; } - PROGRAM_COUNTER = m_System.m_JumpToLocation; - m_System.m_PipelineStage = PIPELINE_STAGE_NORMAL; continue; } if (PhysicalAddr < m_System.RdramSize())