From 303af24bdeb07681ad96c0eb546f6a33a9a11117 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 13 Jun 2024 14:54:44 +0930 Subject: [PATCH] RSP: Better handle delay slot at 0xFFC --- Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp index c58eb7787..1102f0225 100644 --- a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp +++ b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp @@ -890,11 +890,11 @@ void CompilerRSPBlock(void) break; case RSPPIPELINE_DELAY_SLOT: NextInstruction = RSPPIPELINE_DELAY_SLOT_DONE; - CompilePC -= 4; + CompilePC = (CompilePC - 4 & 0xFFC); break; case RSPPIPELINE_DELAY_SLOT_EXIT: NextInstruction = RSPPIPELINE_DELAY_SLOT_EXIT_DONE; - CompilePC -= 4; + CompilePC = (CompilePC - 4 & 0xFFC); break; case RSPPIPELINE_FINISH_SUB_BLOCK: NextInstruction = RSPPIPELINE_NORMAL; @@ -931,7 +931,7 @@ void CompilerRSPBlock(void) CompilePC = 0; EndPC = *PrgCount; } - } while (NextInstruction != RSPPIPELINE_FINISH_BLOCK && (CompilePC < EndPC || NextInstruction == RSPPIPELINE_DELAY_SLOT)); + } while (NextInstruction != RSPPIPELINE_FINISH_BLOCK && (CompilePC < EndPC || NextInstruction == RSPPIPELINE_DELAY_SLOT || NextInstruction == RSPPIPELINE_DELAY_SLOT_DONE)); CPU_Message("===== End of recompiled code ====="); if (Compiler.bReOrdering)