From 3fcd2c9aee9ff73d3c76db173959eee34723bde8 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Sat, 5 Dec 2009 09:30:38 +0000 Subject: [PATCH] microVU: Implemented 'extra' clamp mode (it was doing the same as 'normal' before) Note: What extra clamp mode does is whenever an SSE ADD/SUB/MUL/DIV instruction is used in mVU, it will have its operands clamped. Currently seems to cause sps in some games instead of fixing it... There might be some reason for it that I'm not aware of yet, or it could be 'random' based on what a game is doing. A quick explanation of what mVU's clamp modes do: None - Does no clamping (fast) Normal - Clamp certain instructions which have proven to fix games Extra - Clamps every SSE instruction (slow) Extra + Preserve Sign - Same as extra but preserves sign of the NaN (super slow) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2313 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Misc.h | 11 +---------- pcsx2/x86/microVU_Misc.inl | 10 +++++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 03faed1113..1177cad6f0 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -197,16 +197,7 @@ typedef u32 (__fastcall *mVUCall)(void*, void*); #define aWrap(x, m) ((x > m) ? 0 : x) #define shuffleSS(x) ((x==1)?(0x27):((x==2)?(0xc6):((x==4)?(0xe1):(0xe4)))) #define _1mb (0x100000) - -//#undef CHECK_VU_OVERFLOW -//#undef CHECK_VU_EXTRA_OVERFLOW -//#undef CHECK_VU_SIGN_OVERFLOW -//#undef CHECK_VU_UNDERFLOW -//#define CHECK_VU_OVERFLOW 1 -//#define CHECK_VU_EXTRA_OVERFLOW 1 -//#define CHECK_VU_SIGN_OVERFLOW 1 -//#define CHECK_VU_UNDERFLOW 1 -#define clampE 0//CHECK_VU_EXTRA_OVERFLOW +#define clampE CHECK_VU_EXTRA_OVERFLOW // Flag Info #define __Status (mVUregs.needExactMatch & 1) diff --git a/pcsx2/x86/microVU_Misc.inl b/pcsx2/x86/microVU_Misc.inl index a4f43d2fdc..654ee00947 100644 --- a/pcsx2/x86/microVU_Misc.inl +++ b/pcsx2/x86/microVU_Misc.inl @@ -455,11 +455,11 @@ void ADD_SS(microVU* mVU, int to, int from, int t1, int t2) { if (t2b) mVU->regAlloc->clearNeeded(t2); } -#define clampOp(opX) { \ - /*mVUclamp3(mVU, to, t1, 0xf);*/ \ - /*mVUclamp3(mVU, from, t1, 0xf);*/ \ - opX(to, from); \ - /*mVUclamp4(to, t1, 0xf);*/ \ +#define clampOp(opX) { \ + mVUclamp3(mVU, to, t1, 0xf); \ + mVUclamp3(mVU, from, t1, 0xf); \ + opX(to, from); \ + mVUclamp4(to, t1, 0xf); \ } void SSE_MAXPS(mV, int to, int from, int t1 = -1, int t2 = -1) {