RSP: Have the code be able to loop

This commit is contained in:
zilmar 2024-06-13 14:23:59 +09:30
parent 7161a6f591
commit c3d6ed1a0c
1 changed files with 8 additions and 1 deletions

View File

@ -816,6 +816,7 @@ void CompilerRSPBlock(void)
// This is for the block about to be compiled // This is for the block about to be compiled
*(JumpTable + (CompilePC >> 2)) = RecompPos; *(JumpTable + (CompilePC >> 2)) = RecompPos;
uint32_t EndPC = 0x1000;
do do
{ {
@ -924,7 +925,13 @@ void CompilerRSPBlock(void)
CompilePC += 4; CompilePC += 4;
break; break;
} }
} while (NextInstruction != RSPPIPELINE_FINISH_BLOCK && (CompilePC < 0x1000 || NextInstruction == RSPPIPELINE_DELAY_SLOT));
if (CompilePC >= EndPC && *PrgCount != 0 && EndPC != *PrgCount)
{
CompilePC = 0;
EndPC = *PrgCount;
}
} while (NextInstruction != RSPPIPELINE_FINISH_BLOCK && (CompilePC < EndPC || NextInstruction == RSPPIPELINE_DELAY_SLOT));
CPU_Message("===== End of recompiled code ====="); CPU_Message("===== End of recompiled code =====");
if (Compiler.bReOrdering) if (Compiler.bReOrdering)