From e5a4f27e79b785c5ebf9115413ed940a1ed3edea Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sat, 22 Jan 2022 03:02:22 +0000 Subject: [PATCH] VU: Adjust path for conditional evil blocks Add patch for Pac-man World Rally --- bin/resources/GameIndex.yaml | 9 +++++++++ pcsx2/x86/microVU_Compile.inl | 4 ++-- pcsx2/x86/microVU_Misc.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/resources/GameIndex.yaml b/bin/resources/GameIndex.yaml index 3635d2a126..25b8812c23 100644 --- a/bin/resources/GameIndex.yaml +++ b/bin/resources/GameIndex.yaml @@ -38782,6 +38782,15 @@ SLUS-21328: compat: 5 clampModes: vuClampMode: 3 # Fixes bad geometry. + patches: + default: + content: |- + comment=Patch by Refraction + // Fix bad geometry + patch=1,EE,0016DDE4,word,4A80AADC + patch=1,EE,0016DDEC,word,4B7103BC + patch=1,EE,0016DDD0,word,4B00A29C + patch=1,EE,0016DDD8,word,4AF103BC SLUS-21329: name: "Karaoke Revolution Country - CMT Presents" region: "NTSC-U" diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index 2dc98ed027..98fbda7013 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -903,13 +903,13 @@ void* mVUcompile(microVU& mVU, u32 startPC, uptr pState) mVU_XGKICK_DELAY(mVU); } - if (isEvilBlock) + if (isEvilBlock && !isConditional) { mVUsetupRange(mVU, xPC + 8, false); normJumpCompile(mVU, mFC, true); goto perf_and_return; } - else if (!mVUinfo.isBdelay) + else if (!mVUinfo.isBdelay && !isEvilBlock) { // Handle range wrapping if ((xPC + 8) == mVU.microMemSize) diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index c6587aeee8..712f2bcfb6 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -242,6 +242,7 @@ typedef u32(__fastcall* mVUCall)(void*, void*); #define mVUrange (mVUcurProg.ranges[0])[0] #define isEvilBlock (mVUpBlock->pState.blockType == 2) #define isBadOrEvil (mVUlow.badBranch || mVUlow.evilBranch) +#define isConditional (mVUlow.branch > 2 && mVUlow.branch < 9) #define xPC ((iPC / 2) * 8) #define curI ((u32*)mVU.regs().Micro)[iPC] //mVUcurProg.data[iPC] #define setCode() { mVU.code = curI; }