mVU: Fix jump caching when using doJumpAsSameProgram. This is by default

This commit is contained in:
refractionpcsx2 2021-01-02 08:35:32 +00:00
parent ee07f860fc
commit 413fd004da
1 changed files with 10 additions and 0 deletions

View File

@ -775,6 +775,16 @@ __fi void* mVUblockFetch(microVU& mVU, u32 startPC, uptr pState) {
// mVUcompileJIT() - Called By JR/JALR during execution
_mVUt void* __fastcall mVUcompileJIT(u32 startPC, uptr ptr) {
if (doJumpAsSameProgram) { // Treat jump as part of same microProgram
if (doJumpCaching) { // When doJumpCaching, ptr is a microBlock pointer
microVU& mVU = mVUx;
microBlock* pBlock = (microBlock*)ptr;
microJumpCache& jc = pBlock->jumpCache[startPC / 8];
if (jc.prog && jc.prog == mVU.prog.quick[startPC / 8].prog) return jc.x86ptrStart;
void* v = mVUblockFetch(mVUx, startPC, (uptr)&pBlock->pStateEnd);
jc.prog = mVU.prog.quick[startPC / 8].prog;
jc.x86ptrStart = v;
return v;
}
return mVUblockFetch(mVUx, startPC, ptr);
}
mVUx.regs().start_pc = startPC;