GS-HW: Add CRC hack for NFS Undercover to handle weird shuffle

This commit is contained in:
refractionpcsx2 2023-04-04 12:12:53 +01:00
parent 4a702e0585
commit 857cb36707
3 changed files with 49 additions and 0 deletions

View File

@ -22745,28 +22745,38 @@ SLES-55349:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "PAL-E" region: "PAL-E"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLES-55350: SLES-55350:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "PAL-F-G" region: "PAL-F-G"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLES-55351: SLES-55351:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "PAL-I-S" region: "PAL-I-S"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLES-55352: SLES-55352:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "PAL-SCA" region: "PAL-SCA"
compat: 5 compat: 5
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLES-55353: SLES-55353:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "PAL-M6" region: "PAL-M6"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLES-55354: SLES-55354:
name: "Shin Megami Tensei - Persona 3 FES" name: "Shin Megami Tensei - Persona 3 FES"
region: "PAL-E" region: "PAL-E"
@ -25270,7 +25280,9 @@ SLPM-55127:
name: "Need for Speed - Undercover" name: "Need for Speed - Undercover"
region: "NTSC-J" region: "NTSC-J"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLPM-55131: SLPM-55131:
name: "World Soccer Winning Eleven 2009" name: "World Soccer Winning Eleven 2009"
region: "NTSC-J" region: "NTSC-J"
@ -25475,7 +25487,9 @@ SLPM-55244:
name: "Need for Speed - Undercover [Ea-SY! 1980]" name: "Need for Speed - Undercover [Ea-SY! 1980]"
region: "NTSC-J" region: "NTSC-J"
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLPM-55245: SLPM-55245:
name: "Himawari - Pebble in the Sky" name: "Himawari - Pebble in the Sky"
region: "NTSC-J" region: "NTSC-J"
@ -50522,7 +50536,9 @@ SLUS-21801:
region: "NTSC-U" region: "NTSC-U"
compat: 5 compat: 5
gsHWFixes: gsHWFixes:
recommendedBlendingLevel: 3 # Improves car reflections.
halfPixelOffset: 2 # Fixes blurriness. halfPixelOffset: 2 # Fixes blurriness.
getSkipCount: "GSC_NFSUndercover"
SLUS-21802: SLUS-21802:
name: "Naked Brothers Band - The Video Game" name: "Naked Brothers Band - The Video Game"
region: "NTSC-U" region: "NTSC-U"

View File

@ -734,6 +734,37 @@ bool GSHwHack::GSC_XenosagaE3(GSRendererHW& r, int& skip)
return true; return true;
} }
bool GSHwHack::GSC_NFSUndercover(GSRendererHW& r, int& skip)
{
// NFS Undercover does a weird texture shuffle by page, which really isn't supported by our TC.
// This causes it to spam creating new sources, severely destroying the speed.
// The CRC hack bypasses the entire shuffle and does it in one go.
const GIFRegTEX0& Texture = RTEX0;
const GIFRegFRAME& Frame = RFRAME;
if (RPRIM->TME && Frame.PSM == PSM_PSMCT16S && Frame.FBMSK != 0 && Frame.FBW == 10 && Texture.TBW == 1 && Texture.TBP0 == 0x02800 && Texture.PSM == PSM_PSMZ16S)
{
GSVertex* v = &r.m_vertex.buff[1];
v[0].XYZ.X = static_cast<u16>(RCONTEXT->XYOFFSET.OFX + (r.m_r.z << 4));
v[0].XYZ.Y = static_cast<u16>(RCONTEXT->XYOFFSET.OFY + (r.m_r.w << 4));
v[0].U = r.m_r.z << 4;
v[0].V = r.m_r.w << 4;
RCONTEXT->scissor.in.z = r.m_r.z;
RCONTEXT->scissor.in.w = r.m_r.w;
r.m_vt.m_max.p.x = r.m_r.z;
r.m_vt.m_max.p.y = r.m_r.w;
r.m_vt.m_max.t.x = r.m_r.z;
r.m_vt.m_max.t.y = r.m_r.w;
r.m_vertex.head = r.m_vertex.tail = r.m_vertex.next = 2;
r.m_index.tail = 2;
skip = 79;
}
else
return skip > 0;
return false;
}
bool GSHwHack::GSC_BlueTongueGames(GSRendererHW& r, int& skip) bool GSHwHack::GSC_BlueTongueGames(GSRendererHW& r, int& skip)
{ {
GSDrawingContext* context = r.m_context; GSDrawingContext* context = r.m_context;
@ -1219,6 +1250,7 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
CRC_F(GSC_BlackAndBurnoutSky, CRCHackLevel::Partial), CRC_F(GSC_BlackAndBurnoutSky, CRCHackLevel::Partial),
CRC_F(GSC_BlueTongueGames, CRCHackLevel::Partial), CRC_F(GSC_BlueTongueGames, CRCHackLevel::Partial),
CRC_F(GSC_Battlefield2, CRCHackLevel::Partial), CRC_F(GSC_Battlefield2, CRCHackLevel::Partial),
CRC_F(GSC_NFSUndercover, CRCHackLevel::Partial),
// Channel Effect // Channel Effect
CRC_F(GSC_GiTS, CRCHackLevel::Partial), CRC_F(GSC_GiTS, CRCHackLevel::Partial),

View File

@ -51,6 +51,7 @@ public:
static bool GSC_XenosagaE3(GSRendererHW& r, int& skip); static bool GSC_XenosagaE3(GSRendererHW& r, int& skip);
static bool GSC_BlueTongueGames(GSRendererHW& r, int& skip); static bool GSC_BlueTongueGames(GSRendererHW& r, int& skip);
static bool GSC_Battlefield2(GSRendererHW& r, int& skip); static bool GSC_Battlefield2(GSRendererHW& r, int& skip);
static bool GSC_NFSUndercover(GSRendererHW& r, int& skip);
static bool OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); static bool OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_BigMuthaTruckers(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); static bool OI_BigMuthaTruckers(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);