From 74912ca8c2e94bc5ef623ca77fee712cd8f756f2 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 18 May 2023 10:33:57 +0930 Subject: [PATCH] Core: handle jump to unaligned addresses --- .../Project64-core/N64System/Interpreter/InterpreterCPU.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp index 7df3b0ef1..11b7d8e70 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp @@ -130,7 +130,11 @@ void CInterpreterCPU::ExecuteCPU() CheckTimer = (JumpToLocation < PROGRAM_COUNTER - 4 || TestTimer); PROGRAM_COUNTER = JumpToLocation; PipelineStage = PIPELINE_STAGE_NORMAL; - if (CheckTimer) + if ((PROGRAM_COUNTER & 0x3) != 0) + { + GenerateAddressErrorException((int32_t)JumpToLocation, true); + } + else if (CheckTimer) { TestTimer = false; if (NextTimer < 0)