microVU: Add sanity check when loading quick block from program.

Sometimes (CoD Finest Hour) can somehow end up with blocks missing from a program, not sure how, but it still finds the current program, so we check if the block exists, if not, recompile new ones.
This commit is contained in:
refractionpcsx2 2020-12-15 20:26:41 +00:00
parent 678829a5b2
commit 03445d0b55
1 changed files with 7 additions and 0 deletions

View File

@ -309,6 +309,13 @@ _mVUt __fi void* mVUsearchProg(u32 startPC, uptr pState) {
// Because the VU's can now run in sections and not whole programs at once
// we need to set the current block so it gets the right program back
quick.block = mVU.prog.cur->block[startPC / 8];
// Sanity check, in case for some reason the program compilation aborted half way through
if (quick.block == nullptr)
{
void* entryPoint = mVUblockFetch(mVU, startPC, pState);
return entryPoint;
}
return mVUentryGet(mVU, quick.block, startPC, pState);
}