From 03445d0b553fc5a8275e5df91fe004a5e10607a2 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 15 Dec 2020 20:26:41 +0000 Subject: [PATCH] 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. --- pcsx2/x86/microVU.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index d8ca0759f4..bc1ff0b8b9 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -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); }