GS/HW: Add CRC for Turok wrong width clear

This commit is contained in:
refractionpcsx2 authored and lightningterror committed 2025-07-06 18:33:39 +02:00
1 parent 0df388cd96
commit 43a81a3cb1
3 files changed
+29

No files matched your search

+6
View File
@@ -15195,7 +15195,9 @@ SLES-50479:
region: "PAL-M4"
compat: 5
gsHWFixes:
halfPixelOffset: 2 # Fixes depth/fog lines.
textureInsideRT: 1 # Fixes underwater levels.
getSkipCount: "GSC_Turok"
SLES-50480:
name: "Aggressive Inline"
region: "PAL-M4"
@@ -16704,7 +16706,9 @@ SLES-51124:
region: "PAL-G"
compat: 5
gsHWFixes:
halfPixelOffset: 2 # Fixes depth/fog lines.
textureInsideRT: 1 # Fixes underwater levels.
getSkipCount: "GSC_Turok"
SLES-51125:
name: "Sega Soccer Slam"
region: "PAL-E"
@@ -64136,7 +64140,9 @@ SLUS-20333:
region: "NTSC-U"
compat: 5
gsHWFixes:
halfPixelOffset: 2 # Fixes depth/fog lines.
textureInsideRT: 1 # Fixes underwater levels.
getSkipCount: "GSC_Turok"
SLUS-20334:
name: "Kelly Slater's Pro Surfer"
region: "NTSC-U"
+22
View File
@@ -822,6 +822,27 @@ bool GSHwHack::GSC_MetalGearSolid3(GSRendererHW& r, int& skip)
return true;
}
bool GSHwHack::GSC_Turok(GSRendererHW& r, int& skip)
{
// Turok does some very silly clears where it will set the alpha channel with a 512x512 draw, then decides the image is actually 640x448 later, this causes havok for the texture cache and target end blocks.
// Since we can't look in to the future to check this, the options are either rearrange all the pages in a target when the width changes
// (very slow, could break a ton of stuff which stores different things in the alpha channel), or this. I choose this.
if (r.m_index.tail == 6 && RPRIM->PRIM == 4 && !RTME && RFBMSK == 0x00FFFFFF && floor(r.m_vt.m_max.p.x) == 512 && r.m_env.CTXT[r.m_backed_up_ctx].FRAME.FBW == 10 && RFRAME.FBW == 8 && RFPSM == PSMCT32 && RTEST.ATE && RTEST.ATST == ATST_GEQUAL)
{
int num_pages = r.m_cached_ctx.FRAME.FBW * ((floor(r.m_vt.m_max.p.y) + 31) / 32);
r.m_cached_ctx.FRAME.FBW = 10;
// Round them up to fill the row, it later reads the bottom right corner clamped, but because we can't rearrange it ends up reading the black square.
num_pages = ((num_pages + 9) / 10) * 10;
r.ReplaceVerticesWithSprite(
r.GetDrawRectForPages(r.m_cached_ctx.FRAME.FBW, r.m_cached_ctx.FRAME.PSM, num_pages),
GSVector2i(1, 1));
}
return true;
}
bool GSHwHack::OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
const u32 n_vertices = r.m_vertex.next;
@@ -1312,6 +1333,7 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
CRC_F(GSC_PolyphonyDigitalGames),
CRC_F(GSC_MetalGearSolid3),
CRC_F(GSC_Battlefield2),
CRC_F(GSC_Turok),
// Channel Effect
CRC_F(GSC_NamcoGames),
+1
View File
@@ -26,6 +26,7 @@ public:
static bool GSC_Battlefield2(GSRendererHW& r, int& skip);
static bool GSC_PolyphonyDigitalGames(GSRendererHW& r, int& skip);
static bool GSC_MetalGearSolid3(GSRendererHW& r, int& skip);
static bool GSC_Turok(GSRendererHW& r, int& skip);
static bool OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_DBZBTGames(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);