diff --git a/bin/GameIndex.yaml b/bin/GameIndex.yaml index 8b96c76bd7..0a3a1a889f 100644 --- a/bin/GameIndex.yaml +++ b/bin/GameIndex.yaml @@ -13405,15 +13405,6 @@ SLES-53744: SLES-53746: name: "Superman Returns" region: "PAL-E" - patches: - E8F7BAB6: - content: |- - author=kozarovv - // Fix sps and various graphical issues by Using iaddiu instead of FSAND - // require preload frame data and crc hack atleast minimum for GSDX HW - patch=1,EE,00639Ef0,word,10050208 - patch=1,EE,0063a068,word,10080208 - patch=1,EE,0063D488,word,10020208 SLES-53747: name: "Ed, Edd, 'n Eddy - The Misadventure" region: "PAL-E" @@ -14587,28 +14578,12 @@ SLES-54348: SLES-54349: name: "Superman Returns" region: "PAL-I" - patches: - E7F7B6BD: - content: |- - author=kozarovv - // Use iaddiu instead of FSAND. - patch=1,EE,00639ef0,word,10050208 - patch=1,EE,0063a068,word,10080208 SLES-54350: name: "Superman Returns" region: "PAL-G" SLES-54351: name: "Superman Returns" region: "PAL-S" - patches: - EDF0A0A7: - content: |- - author=kozarovv - // Fix sps and various graphical issues by Using iaddiu instead of FSAND - // require preload frame data and crc hack atleast minimum for GSDX HW - patch=1,EE,00639Ef0,word,10050208 - patch=1,EE,0063a068,word,10080208 - patch=1,EE,0063D488,word,10020208 SLES-54354: name: "Final Fantasy XII" region: "PAL-E" @@ -36972,15 +36947,6 @@ SLUS-21434: name: "Superman Returns - The Video Game" region: "NTSC-U" compat: 4 - patches: - E1BF5DCA: - content: |- - author=kozarovv - // Fix sps and various graphical issues by Using iaddiu instead of FSAND - // require preload frame data and crc hack atleast minimum for GSDX HW - patch=1,EE,00639E70,word,10050208 - patch=1,EE,00639FE8,word,10080208 - patch=1,EE,0063D408,word,10020208 SLUS-21435: name: "One Piece - Grand Adventure" region: "NTSC-U" diff --git a/pcsx2/x86/microVU_Upper.inl b/pcsx2/x86/microVU_Upper.inl index 9b378bfd36..14523ffff1 100644 --- a/pcsx2/x86/microVU_Upper.inl +++ b/pcsx2/x86/microVU_Upper.inl @@ -23,6 +23,12 @@ #define ADD_XYZW ((_XYZW_SS && modXYZW) ? (_X ? 3 : (_Y ? 2 : (_Z ? 1 : 0))) : 0) #define SHIFT_XYZW(gprReg) { if (_XYZW_SS && modXYZW && !_W) { xSHL(gprReg, ADD_XYZW); } } + +const __aligned16 u32 sse4_compvals[2][4] = { + { 0x7f7fffff, 0x7f7fffff, 0x7f7fffff, 0x7f7fffff }, //1111 + { 0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff }, //1111 +}; + // Note: If modXYZW is true, then it adjusts XYZW for Single Scalar operations static void mVUupdateFlags(mV, const xmm& reg, const xmm& regT1in = xEmptyReg, const xmm& regT2in = xEmptyReg, bool modXYZW = 1) { const x32& mReg = gprT1; @@ -67,6 +73,19 @@ static void mVUupdateFlags(mV, const xmm& reg, const xmm& regT1in = xEmptyReg, c if (mFLAG.doFlag) { SHIFT_XYZW(gprT2); } xOR(mReg, gprT2); + if (sFLAG.doFlag) { + //Calculate overflow + xMOVAPS(regT1, regT2); + xAND.PS(regT1, ptr128[&sse4_compvals[1][0]]); // Remove sign flags (we don't care) + xPMIN.UD(regT1, ptr128[&sse4_compvals[0][0]]); // Get the minimum value, FLT_MAX = overflow + xCMPEQ.PS(regT1, ptr128[&sse4_compvals[0][0]]); // Compare if T1 == FLT_MAX + xMOVMSKPS(gprT2, regT1); // Grab sign bits for equal results + xAND(gprT2, AND_XYZW); // Grab "Is Zero" bits from the previous calculation + xTEST(gprT2, 0xF); + xForwardJump32 oJMP(Jcc_Zero); + xOR(sReg, 0x820000); + oJMP.SetTarget(); + } //-------------------------Write back flags------------------------------ if (mFLAG.doFlag) mVUallocMFLAGb(mVU, mReg, mFLAG.write); // Set Mac Flag