diff --git a/bin/resources/GameIndex.yaml b/bin/resources/GameIndex.yaml index 057a163e73916..1ac05715d758e 100644 --- a/bin/resources/GameIndex.yaml +++ b/bin/resources/GameIndex.yaml @@ -1521,6 +1521,7 @@ SCAJ-20125: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCAJ-20126: name: "Tekken 5" @@ -1529,6 +1530,7 @@ SCAJ-20126: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCAJ-20127: name: "EyeToy - Play 2 [with Camera]" @@ -1955,6 +1957,7 @@ SCAJ-20199: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCAJ-25002: name: "Shinobi" @@ -3605,6 +3608,7 @@ SCED-53538: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCED-53611: name: "Official PlayStation 2 Magazine - German Kids Special" @@ -5167,6 +5171,7 @@ SCES-53202: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCES-53247: name: "WRC Rally Evolved" @@ -6546,6 +6551,7 @@ SCKA-20049: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCKA-20050: name: "Tales of Legendia" @@ -6754,6 +6760,7 @@ SCKA-20081: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SCKA-20082: name: "Ace Combat 5 - The Unsung War [PlayStation 2 Big Hit Series]" @@ -52627,6 +52634,7 @@ SLPS-25510: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 # Fixes vertical lines. + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SLPS-25511: name: 羅刹 -Alternative- @@ -55460,6 +55468,7 @@ SLPS-73223: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 # Fixes vertical lines. + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SLPS-73224: name: ゼノサーガ エピソードII[善悪の彼岸] PS2 the Best [ディスク1/2] @@ -61311,6 +61320,7 @@ SLUS-21059: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 # Fixes vertical lines. + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SLUS-21060: name: "WWE SmackDown! vs. RAW" @@ -61823,6 +61833,7 @@ SLUS-21160: eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove. gsHWFixes: alignSprite: 1 # Fixes vertical lines. + halfPixelOffset: 4 # Align post. getSkipCount: "GSC_Tekken5" SLUS-21161: name: "Fight Night - Round 2" diff --git a/pcsx2/GS/Renderers/HW/GSHwHack.cpp b/pcsx2/GS/Renderers/HW/GSHwHack.cpp index 13af2a95bce30..591da7efaf293 100644 --- a/pcsx2/GS/Renderers/HW/GSHwHack.cpp +++ b/pcsx2/GS/Renderers/HW/GSHwHack.cpp @@ -154,6 +154,12 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip) { pxAssertMsg((RTBP0 & 31) == 0, "TEX0 should be page aligned"); + GSVertex* v = &r.m_vertex.buff[0]; + + // Make sure we're detecting the right effect. + if (((v[1].XYZ.X - v[0].XYZ.X) >> 4) != 8 || ((v[1].XYZ.Y - v[0].XYZ.Y) >> 4) != 14) + return false; + GSTextureCache::Target* rt = g_texture_cache->LookupTarget(GIFRegTEX0::Create(RTBP0, RFBW, RFPSM), GSVector2i(1, 1), r.GetTextureScaleFactor(), GSTextureCache::RenderTarget); if (!rt) @@ -180,13 +186,13 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip) return true; } - if (!s_nativeres && RTME && (RFBP == 0x02d60 || RFBP == 0x02d80 || RFBP == 0x02ea0 || RFBP == 0x03620 || RFBP == 0x03640) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSMCT32) + if (!s_nativeres && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && std::abs(static_cast(RFBP - RTBP0)) == 0x180 && RTPSM == PSMCT32 && RFBMSK == 0xFF000000) { - // Don't enable hack on native res if crc is below aggressive. - // Fixes/removes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling. - // Downside is it also removes the channel effect which is fixed. - // Let's enable this hack for Aggressive only since it's an upscaling issue for both renders. - skip = 95; + // Don't enable hack on native res. + // Fixes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling. + const GSVector4i draw_size(r.m_vt.m_min.p.x, r.m_vt.m_min.p.y, r.m_vt.m_max.p.x + 1.0f, r.m_vt.m_max.p.y + 1.0f); + const GSVector4i read_size(r.m_vt.m_min.t.x, r.m_vt.m_min.t.y, r.m_vt.m_max.t.x + 0.5f, r.m_vt.m_max.t.y + 0.5f); + r.ReplaceVerticesWithSprite(draw_size, read_size, GSVector2i(read_size.width(), read_size.height()), draw_size); } else if (RZTST == 1 && RTME && (RFBP == 0x02bc0 || RFBP == 0x02be0 || RFBP == 0x02d00 || RFBP == 0x03480 || RFBP == 0x034a0) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSMCT32) {