Skip to content

Commit

Permalink
GameDB-GS/HW: Remove Battlefield 2 CRC hacks, add Tex Inside RT instead
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jan 25, 2025
1 parent 292c82c commit 06907b8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 67 deletions.
46 changes: 20 additions & 26 deletions bin/resources/GameIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3870,9 +3870,13 @@ SCED-52899:
SCED-52932:
name: "Bonus Demo 8"
region: "PAL-M5"
gsHWFixes:
textureInsideRT: 1 # Fixes shadows in TOCA Race Driver 2.
SCED-52933:
name: "Bonus Demo 8"
region: "PAL-M5"
gsHWFixes:
textureInsideRT: 1 # Fixes shadows in TOCA Race Driver 2.
SCED-52935:
name: "SingStar Party [Demo]"
region: "PAL-E"
Expand Down Expand Up @@ -3946,6 +3950,8 @@ SCED-52997:
SCED-53018:
name: "Bonus Demo 8 (Geu)"
region: "PAL-G"
gsHWFixes:
textureInsideRT: 1 # Fixes shadows in TOCA Race Driver 2.
SCED-53043:
name: "Magazine Ufficiale PlayStation 2 Speciale Platinum Italia"
region: "PAL-I"
Expand Down Expand Up @@ -13553,8 +13559,7 @@ SLED-53731:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLED-53732:
name: "Spartan - Total Warrior [Demo]"
region: "PAL"
Expand Down Expand Up @@ -23490,8 +23495,7 @@ SLES-53729:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLES-53730:
name: "Battlefield 2 - Modern Combat"
region: "PAL-M3"
Expand All @@ -23500,8 +23504,7 @@ SLES-53730:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLES-53734:
name: "50 Cent - Bulletproof"
region: "PAL-E"
Expand Down Expand Up @@ -30869,13 +30872,11 @@ SLKA-25330:
name: "Battlefield 2 - Modern Combat"
region: "NTSC-K"
gsHWFixes:
autoFlush: 2 # Post-processing.
minimumBlendingLevel: 4 # Fixes ground texture rendering.
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Spikes all over the place otherwise.
textureInsideRT: 1 # Fixes light shinging through objects.
cpuCLUTRender: 1 # Fixes light shining through objects.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
texturePreloading: 1 # Improves performance.
textureInsideRT: 1 # Fixes per line drawing.
SLKA-25331:
name: "Marc Ecko's Getting Up - Contents Under Pressure"
region: "NTSC-K"
Expand Down Expand Up @@ -31740,8 +31741,7 @@ SLPM-55034:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLPM-55035:
name: "ファイトナイト ラウンド2 [EA:SY! 1980]"
name-sort: "ふぁいとないと らうんど2 [EA:SY! 1980]"
Expand Down Expand Up @@ -45795,8 +45795,7 @@ SLPM-66206:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLPM-66207:
name: "どろろ [SEGA THE BEST 2800]"
name-sort: "どろろ [SEGA THE BEST 2800]"
Expand Down Expand Up @@ -48572,8 +48571,7 @@ SLPM-66651:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLPM-66652:
name: "バーンアウト リベンジ [EA BEST HITS]"
name-sort: "ばーんあうと りべんじ [EA BEST HITS]"
Expand Down Expand Up @@ -66403,8 +66401,7 @@ SLUS-21026:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLUS-21027:
name: "The Lord of the Rings - The Third Age"
name-sort: "Lord of the Rings, The - The Third Age"
Expand Down Expand Up @@ -72286,8 +72283,7 @@ SLUS-29117:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLUS-29118:
name: "Need for Speed - Underground 2 [Demo]"
region: "NTSC-U"
Expand Down Expand Up @@ -72439,8 +72435,7 @@ SLUS-29152:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLUS-29153:
name: "Burnout Revenge [Demo]"
region: "NTSC-U"
Expand Down Expand Up @@ -72555,8 +72550,7 @@ SLUS-29172:
autoFlush: 1 # Post-processing.
halfPixelOffset: 2 # Offset post-processing.
texturePreloading: 1 # Improves performance.
getSkipCount: "GSC_Battlefield2" # Depth clear.
beforeDraw: "OI_Battlefield2" # Framebuffer copy, fixes rendering for bottom part of screen.
textureInsideRT: 1 # Fixes per line drawing.
SLUS-29173:
name: "The Sims 2 [Demo]"
name-sort: "Sims 2, The [Demo]"
Expand Down
39 changes: 0 additions & 39 deletions pcsx2/GS/Renderers/HW/GSHwHack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,43 +1078,6 @@ bool GSHwHack::OI_BurnoutGames(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GS
return false;
}

bool GSHwHack::GSC_Battlefield2(GSRendererHW& r, int& skip)
{
if (skip == 0)
{
if (RZBP >= RFBP && RFBP >= 0x2000 && RZBP >= 0x2700 && ((RZBP - RFBP) == 0x700))
{
skip = 7;

GIFRegTEX0 TEX0 = {};
TEX0.TBP0 = RFBP;
TEX0.TBW = 8;
GSTextureCache::Target* dst = g_texture_cache->LookupTarget(TEX0, r.GetTargetSize(), r.GetTextureScaleFactor(), GSTextureCache::DepthStencil);
if (dst)
{
g_gs_device->ClearDepth(dst->m_texture, 0.0f);
}
}
}

return true;
}

bool GSHwHack::OI_Battlefield2(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
if (!RPRIM->TME || RFRAME.Block() > 0xD00 || RTEX0.TBP0 > 0x1D00)
return true;

if (rt && t && RFRAME.Block() == 0 && RTEX0.TBP0 == 0x1000)
{
const GSVector4i rc(0, 0, std::min(rt->GetWidth(), t->m_texture->GetWidth()), std::min(rt->GetHeight(), t->m_texture->GetHeight()));
g_gs_device->CopyRect(t->m_texture, rt, rc, 0, 0);
}

g_texture_cache->InvalidateTemporarySource();
return false;
}

bool GSHwHack::OI_HauntingGround(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t)
{
// Haunting Ground clears two targets by doing a direct colour write at 0x3000, covering a target at 0x3380.
Expand Down Expand Up @@ -1409,7 +1372,6 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
CRC_F(GSC_ZettaiZetsumeiToshi2),
CRC_F(GSC_BlackAndBurnoutSky),
CRC_F(GSC_BlueTongueGames),
CRC_F(GSC_Battlefield2),
CRC_F(GSC_NFSUndercover),
CRC_F(GSC_PolyphonyDigitalGames),
CRC_F(GSC_MetalGearSolid3),
Expand All @@ -1435,7 +1397,6 @@ const GSHwHack::Entry<GSRendererHW::OI_Ptr> GSHwHack::s_before_draw_functions[]
CRC_F(OI_SonicUnleashed),
CRC_F(OI_ArTonelico2),
CRC_F(OI_BurnoutGames),
CRC_F(OI_Battlefield2),
CRC_F(OI_HauntingGround),
};

Expand Down
2 changes: 0 additions & 2 deletions pcsx2/GS/Renderers/HW/GSHwHack.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class GSHwHack
static bool GSC_UrbanReign(GSRendererHW& r, int& skip);
static bool GSC_SteambotChronicles(GSRendererHW& r, int& skip);
static bool GSC_BlueTongueGames(GSRendererHW& r, int& skip);
static bool GSC_Battlefield2(GSRendererHW& r, int& skip);
static bool GSC_NFSUndercover(GSRendererHW& r, int& skip);
static bool GSC_PolyphonyDigitalGames(GSRendererHW& r, int& skip);
static bool GSC_MetalGearSolid3(GSRendererHW& r, int& skip);
Expand All @@ -36,7 +35,6 @@ class GSHwHack
static bool OI_SonicUnleashed(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_ArTonelico2(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_BurnoutGames(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_Battlefield2(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
static bool OI_HauntingGround(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);

static bool MV_Growlanser(GSRendererHW& r);
Expand Down

0 comments on commit 06907b8

Please sign in to comment.