GS/HW: Update BigMuthaTruckers hack to a GSC

This commit is contained in:
refractionpcsx2 2023-08-03 04:36:12 +01:00
parent ccfee2be83
commit 7d3c3911ea
3 changed files with 69 additions and 46 deletions

View File

@ -868,7 +868,8 @@ SCAJ-20010:
name: "Bakusou Dekotora Densetsu - Otoko Hanamichi Yume Roman"
region: "NTSC-Unk"
gsHWFixes:
beforeDraw: "OI_BigMuthaTruckers"
textureInsideRT: 1 # Fixes inside RT shuffling.
getSkipCount: "GSC_BigMuthaTruckers"
SCAJ-20011:
name: "Armored Core 3 - Silent Line"
region: "NTSC-HK"
@ -11459,11 +11460,16 @@ SLED-53664:
SLED-53673:
name: "007 - From Russia with Love [Demo]"
region: "PAL-E"
gsHWFixes:
textureInsideRT: 1 # Required for complex offset shuffles.
recommendedBlendingLevel: 4 # Fixes lighting.
SLED-53681:
name: "007 - From Russia with Love & Need for Speed Most Wanted & SSX On Tour [Demo]"
region: "PAL-E"
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
textureInsideRT: 1 # Required for complex offset shuffles on 007.
recommendedBlendingLevel: 4 # Fixes lighting in 007.
SLED-53711:
name: "Brothers in Arms - Earned in Blood"
region: "PAL-A"
@ -14914,7 +14920,8 @@ SLES-51355:
region: "PAL-M5"
compat: 5
gsHWFixes:
beforeDraw: "OI_BigMuthaTruckers"
textureInsideRT: 1 # Fixes inside RT shuffling.
getSkipCount: "GSC_BigMuthaTruckers"
SLES-51356:
name: "Road Trip Adventure"
region: "PAL-M3"
@ -17581,21 +17588,18 @@ SLES-52588:
name: "Mercenaries - Playground of Destruction"
region: "PAL-E"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLES-52589:
name: "Mercenaries - Playground of Destruction"
region: "PAL-F"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLES-52590:
name: "Mercenaries - Playground of Destruction"
region: "PAL-G"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLES-52591:
@ -18718,7 +18722,6 @@ SLES-53008:
name: "Mercenaries - Playground of Destruction"
region: "PAL-I-S"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLES-53009:
@ -20265,6 +20268,9 @@ SLES-53552:
SLES-53553:
name: "007 - From Russia with Love"
region: "PAL-M7"
gsHWFixes:
textureInsideRT: 1 # Required for complex offset shuffles.
recommendedBlendingLevel: 4 # Fixes lighting.
SLES-53556:
name: "Driver - Parallel Lines"
region: "PAL-M3"
@ -33308,7 +33314,8 @@ SLPM-65234:
name: "Bakusou Dekotora Densetsu - Otoko Hanamichi Yume Roman"
region: "NTSC-J"
gsHWFixes:
beforeDraw: "OI_BigMuthaTruckers"
textureInsideRT: 1 # Fixes inside RT shuffling.
getSkipCount: "GSC_BigMuthaTruckers"
SLPM-65235:
name: "New Roommania - Porori Seishun"
region: "NTSC-J"
@ -35839,7 +35846,6 @@ SLPM-65942:
name: "Mercenaries - Playground of Destruction"
region: "NTSC-J"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLPM-65943:
@ -37439,6 +37445,9 @@ SLPM-66321:
SLPM-66322:
name: "007 - Russia yori Ai o Komete"
region: "NTSC-J"
gsHWFixes:
textureInsideRT: 1 # Required for complex offset shuffles.
recommendedBlendingLevel: 4 # Fixes lighting.
SLPM-66323:
name: "Princess Software Collection, The"
region: "NTSC-J"
@ -38036,7 +38045,6 @@ SLPM-66465:
name: "Mercenaries - Playground of Destruction [EA Best Hits]"
region: "NTSC-J"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLPM-66467:
@ -48238,7 +48246,8 @@ SLUS-20291:
region: "NTSC-U"
compat: 5
gsHWFixes:
beforeDraw: "OI_BigMuthaTruckers"
textureInsideRT: 1 # Fixes inside RT shuffling.
getSkipCount: "GSC_BigMuthaTruckers"
SLUS-20292:
name: "Tsugunai - Atonement"
region: "NTSC-U"
@ -49820,7 +49829,8 @@ SLUS-20605:
name: "Big Mutha Truckers"
region: "NTSC-U"
gsHWFixes:
beforeDraw: "OI_BigMuthaTruckers"
textureInsideRT: 1 # Fixes inside RT shuffling.
getSkipCount: "GSC_BigMuthaTruckers"
SLUS-20606:
name: "Bounty Hunter - Seek & Destroy"
region: "NTSC-U"
@ -51491,7 +51501,6 @@ SLUS-20932:
region: "NTSC-U"
compat: 5
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLUS-20933:
@ -53496,6 +53505,9 @@ SLUS-21282:
name: "007 - From Russia with Love"
region: "NTSC-U"
compat: 5
gsHWFixes:
textureInsideRT: 1 # Required for complex offset shuffles.
recommendedBlendingLevel: 4 # Fixes lighting.
SLUS-21283:
name: "Total Overdose - A Gunslinger's Tale in Mexico"
region: "NTSC-U"
@ -57487,7 +57499,6 @@ SLUS-29137:
name: "Mercenaries - Playground of Destruction [Demo]"
region: "NTSC-U"
gsHWFixes:
halfBottomOverride: 1 # Bottom screen has wrong colors.
autoFlush: 2 # Fixes missing lighting.
# halfPixelOffset: 1 # Fixes lighting misalignment. Do not enable this, it breaks a lot of graphics.
SLUS-29138:
@ -57622,9 +57633,14 @@ SLUS-29167:
region: "NTSC-U"
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
textureInsideRT: 1 # Required for complex offset shuffles in 007.
recommendedBlendingLevel: 4 # Fixes lighting in 007.
SLUS-29168:
name: "007 - From Russia with Love [Demo]"
region: "NTSC-U"
gsHWFixes:
textureInsideRT: 1 # Required for complex offset shuffles.
recommendedBlendingLevel: 4 # Fixes lighting.
SLUS-29169:
name: "Resident Evil 4 [Demo]"
region: "NTSC-U"

View File

@ -851,6 +851,44 @@ bool GSHwHack::GSC_MetalGearSolid3(GSRendererHW& r, int& skip)
return true;
}
bool GSHwHack::GSC_BigMuthaTruckers(GSRendererHW& r, int& skip)
{
// Rendering pattern:
// CRTC frontbuffer at 0x0 is interlaced (half vertical resolution),
// game needs to do a depth effect (so green channel to alpha),
// but there is a vram limitation so green is pushed into the alpha channel of the CRCT buffer,
// vertical resolution is half so only half is processed at once
// We, however, don't have this limitation so we'll replace the draw with a full-screen TS.
const GIFRegTEX0& Texture = RTEX0;
GIFRegTEX0 Frame = {};
Frame.TBW = RFRAME.FBW;
Frame.TBP0 = RFRAME.Block();
const int frame_offset_pal = GSLocalMemory::GetEndBlockAddress(0xa00, 10, PSMCT32, GSVector4i(0, 0, 640, 256)) + 1;
const int frame_offset_ntsc = GSLocalMemory::GetEndBlockAddress(0xa00, 10, PSMCT32, GSVector4i(0, 0, 640, 224)) + 1;
const GSVector4i rect = GSVector4i(r.m_vt.m_min.p.x, r.m_vt.m_min.p.y, r.m_vt.m_max.p.x, r.m_vt.m_max.p.y);
if (RPRIM->TME && Frame.TBW == 10 && Texture.TBW == 10 && Texture.PSM == PSMCT16 && ((rect.w == 512 && Frame.TBP0 == frame_offset_pal) || (Frame.TBP0 == frame_offset_ntsc && rect.w == 448)))
{
// 224 ntsc, 256 pal.
GL_INS("GSC_BigMuthaTruckers half bottom offset %d", r.m_context->XYOFFSET.OFX >> 4);
const size_t count = r.m_vertex.next;
GSVertex* v = &r.m_vertex.buff[0];
const u16 offset = (u16)rect.w * 16;
for (size_t i = 0; i < count; i++)
v[i].XYZ.Y += offset;
r.m_vt.m_min.p.y += rect.w;
r.m_vt.m_max.p.y += rect.w;
r.m_cached_ctx.FRAME.FBP = 0x50; // 0xA00 >> 5
}
return true;
}
bool GSHwHack::OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
const u32 n_vertices = r.m_vertex.next;
@ -904,37 +942,6 @@ bool GSHwHack::OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds
return true;
}
bool GSHwHack::OI_BigMuthaTruckers(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
// Rendering pattern:
// CRTC frontbuffer at 0x0 is interlaced (half vertical resolution),
// game needs to do a depth effect (so green channel to alpha),
// but there is a vram limitation so green is pushed into the alpha channel of the CRCT buffer,
// vertical resolution is half so only half is processed at once
// We, however, don't have this limitation so we'll replace the draw with a full-screen TS.
const GIFRegTEX0& Texture = RTEX0;
GIFRegTEX0 Frame = {};
Frame.TBW = RFRAME.FBW;
Frame.TBP0 = RFRAME.Block();
if (RPRIM->TME && Frame.TBW == 10 && Texture.TBW == 10 && Frame.TBP0 == 0x00a00 && Texture.PSM == PSMT8H && (r.m_r.y == 256 || r.m_r.y == 224))
{
// 224 ntsc, 256 pal.
GL_INS("OI_BigMuthaTruckers half bottom offset");
const size_t count = r.m_vertex.next;
GSVertex* v = &r.m_vertex.buff[0];
const u16 offset = (u16)r.m_r.y * 16;
for (size_t i = 0; i < count; i++)
v[i].V += offset;
}
return true;
}
bool GSHwHack::OI_DBZBTGames(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
if (t && t->m_from_target) // Avoid slow framebuffer readback
@ -1457,6 +1464,7 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
// Texture shuffle
CRC_F(GSC_DeathByDegreesTekkenNinaWilliams), // + Upscaling issues
CRC_F(GSC_BigMuthaTruckers),
// Upscaling hacks
CRC_F(GSC_UltramanFightingEvolution),
@ -1467,7 +1475,6 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
const GSHwHack::Entry<GSRendererHW::OI_Ptr> GSHwHack::s_before_draw_functions[] = {
CRC_F(OI_PointListPalette),
CRC_F(OI_BigMuthaTruckers),
CRC_F(OI_DBZBTGames),
CRC_F(OI_FFX),
CRC_F(OI_RozenMaidenGebetGarden),

View File

@ -44,9 +44,9 @@ public:
static bool GSC_NFSUndercover(GSRendererHW& r, int& skip);
static bool GSC_PolyphonyDigitalGames(GSRendererHW& r, int& skip);
static bool GSC_MetalGearSolid3(GSRendererHW& r, int& skip);
static bool GSC_BigMuthaTruckers(GSRendererHW& r, int& skip);
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_DBZBTGames(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_FFX(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_RozenMaidenGebetGarden(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);