GS/HW: Add CRC fixes for DT Carnage/Racer/Axel Impact

This commit is contained in:
refractionpcsx2 2025-02-08 07:50:05 +00:00
parent de631a1052
commit 52771fdb17
4 changed files with 73 additions and 2 deletions

View File

@ -10378,9 +10378,14 @@ SCPS-56016:
gameFixes:
- GIFFIFOHack
gsHWFixes:
halfPixelOffset: 2 # Fixes post processing position.
nativeScaling: 2 # Fixes post effects.
estimateTextureRegion: 1 # Improves performance and reduces hash cache size.
gpuPaletteConversion: 2 # Improves performance and reduces hash cache size.
autoFlush: 1 # Corrects shadows (Currently still broken even with this).
recommendedBlendingLevel: 4 # Fixes car shadows but addeds about 5000 barriers, might impact slower machines.
gpuTargetCLUT: 2 # Fixes light flicker.
getSkipCount: "GSC_DTGames"
SCPS-72001:
name: "GRAN TURISMO3 A-spec [MEGA HITS!]"
name-sort: "ぐらんつーりすも3 A-spec [MEGA HITS!]"
@ -23994,9 +23999,13 @@ SLES-53904:
clampModes:
vuClampMode: 0 # Fixes black artifacts on tracks
gsHWFixes:
halfPixelOffset: 2 # Fixes post processing position.
nativeScaling: 2 # Fixes post effects.
estimateTextureRegion: 1 # Improves performance and reduces hash cache size.
gpuPaletteConversion: 2 # Improves performance and reduces hash cache size.
autoFlush: 1 # Corrects shadows (Currently still broken even with this).
gpuTargetCLUT: 2 # Fixes light flicker.
getSkipCount: "GSC_DTGames"
SLES-53906:
name: "50 Cent - Bulletproof"
region: "PAL-F"
@ -66800,9 +66809,13 @@ SLUS-21095:
region: "NTSC-U"
compat: 5
gsHWFixes:
halfPixelOffset: 2 # Fixes post processing position.
nativeScaling: 2 # Fixes post effects.
estimateTextureRegion: 1 # Improves performance and reduces hash cache size.
gpuPaletteConversion: 2 # Improves performance and reduces hash cache size.
autoFlush: 1 # Corrects shadows (Currently still broken even with this).
gpuTargetCLUT: 2 # Fixes light flicker.
getSkipCount: "GSC_DTGames"
SLUS-21096:
name: "Ape Escape - Pumped & Primed"
region: "NTSC-U"
@ -70924,10 +70937,12 @@ SLUS-21793:
compat: 3
gsHWFixes:
halfPixelOffset: 2 # Fixes post processing position.
nativeScaling: 1 # Fixes post effects.
nativeScaling: 2 # Fixes post effects.
estimateTextureRegion: 1 # Improves performance and reduces hash cache size.
gpuPaletteConversion: 2 # Improves performance and reduces hash cache size.
autoFlush: 1 # Corrects shadows (Currently still broken even with this).
gpuTargetCLUT: 2 # Fixes light flicker.
getSkipCount: "GSC_DTGames"
SLUS-21794:
name: "Go, Diego, Go! Great Dinosaur Rescue"
region: "NTSC-U"

View File

@ -154,6 +154,60 @@ bool GSHwHack::GSC_SFEX3(GSRendererHW& r, int& skip)
return true;
}
bool GSHwHack::GSC_DTGames(GSRendererHW& r, int& skip)
{
if (skip == 0)
{
// The game does a shuffle based on the result of a copy from the depth buffer, which ends up looking bizzare so PCSX2 doesn't know how to deal with it.
// What they're actually doing is copying the red/green channel of the result (kind of a shadow stencil) to the alpha channel.
// The further problem to this is the limitation of alpha we can save on an RT as they copy in 255, so I can cheese it here pretending it's RTA'd
if (RTME && RFPSM == PSMCT32 && RTBP0 == RFBP && RTPSM == PSMCT16 && RTEST.ATE && RTEST.ATST == ATST_NEVER && RTEST.AFAIL == AFAIL_FB_ONLY && RFBMSK == 0xFFFFFF)
{
GSTextureCache::Target* rt = g_texture_cache->LookupTarget(GIFRegTEX0::Create(RTBP0, RFBW, RFPSM),
GSVector2i(1, 1), r.GetTextureScaleFactor(), GSTextureCache::RenderTarget);
if (!rt)
return false;
// Clear down the alpha first.
GSHWDrawConfig& clear = r.BeginHLEHardwareDraw(
rt->GetTexture(), nullptr, rt->GetScale(), nullptr, rt->GetScale(), rt->GetUnscaledRect());
clear.colormask.wrgba = 0;
clear.colormask.wa = 1;
r.EndHLEHardwareDraw(false);
// Shuffle the green channel in to alpha.
GSHWDrawConfig& config = r.BeginHLEHardwareDraw(
rt->GetTexture(), nullptr, rt->GetScale(), rt->GetTexture(), rt->GetScale(), rt->GetUnscaledRect());
config.ps.shuffle = 1;
config.ps.dst_fmt = GSLocalMemory::PSM_FMT_32;
config.ps.write_rg = 0;
config.ps.shuffle_same = 0;
config.ps.real16src = 0;
config.ps.shuffle_across = 1;
config.ps.process_rg = r.SHUFFLE_READ;
config.ps.process_ba = r.SHUFFLE_WRITE;
config.colormask.wrgba = 0;
config.colormask.wa = 1;
config.ps.rta_correction = 1;
config.ps.tfx = TFX_DECAL;
config.ps.tcc = true;
r.EndHLEHardwareDraw(true);
rt->m_alpha_min = 0;
rt->m_alpha_max = 255;
skip = 69;
}
}
else
{
if (RTPSM != PSMCT16)
skip = 0;
}
return true;
}
bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip)
{
if (skip == 0)
@ -1471,6 +1525,7 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
CRC_F(GSC_SakuraWarsSoLongMyLove),
CRC_F(GSC_Simple2000Vol114),
CRC_F(GSC_SFEX3),
CRC_F(GSC_DTGames),
CRC_F(GSC_TalesOfLegendia),
CRC_F(GSC_TalesofSymphonia),
CRC_F(GSC_UrbanReign),

View File

@ -11,6 +11,7 @@ public:
static bool GSC_Manhunt2(GSRendererHW& r, int& skip);
static bool GSC_SacredBlaze(GSRendererHW& r, int& skip);
static bool GSC_SFEX3(GSRendererHW& r, int& skip);
static bool GSC_DTGames(GSRendererHW& r, int& skip);
static bool GSC_Tekken5(GSRendererHW& r, int& skip);
static bool GSC_BurnoutGames(GSRendererHW& r, int& skip);
static bool GSC_BlackAndBurnoutSky(GSRendererHW& r, int& skip);

View File

@ -554,7 +554,7 @@ void GSRendererHW::ConvertSpriteTextureShuffle(u32& process_rg, u32& process_ba,
}
else
{
if ((floor(m_vt.m_max.p.y) <= rt->m_valid.w) && ((floor(m_vt.m_max.p.x) > (m_cached_ctx.FRAME.FBW * 64)) || (rt->m_TEX0.TBW != m_cached_ctx.FRAME.FBW)))
if (((m_r.width() + 8) & ~(GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].pgs.x - 1)) != GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].pgs.x && (floor(m_vt.m_max.p.y) <= rt->m_valid.w) && ((floor(m_vt.m_max.p.x) > (m_cached_ctx.FRAME.FBW * 64)) || (rt->m_TEX0.TBW < m_cached_ctx.FRAME.FBW)))
{
half_bottom_vert = false;
half_bottom_uv = false;