Skip to content

Commit

Permalink
GS/HW: Fix offset Z channel shuffle hazard. Adjust Tekken 5 CRC
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jan 24, 2025
1 parent 2d62f2f commit 547c4ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
11 changes: 11 additions & 0 deletions bin/resources/GameIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,7 @@ SCAJ-20125:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand All @@ -1977,6 +1978,7 @@ SCAJ-20126:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -2454,6 +2456,7 @@ SCAJ-20199:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -4149,6 +4152,7 @@ SCED-53538:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -5769,6 +5773,7 @@ SCES-53202:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -7212,6 +7217,7 @@ SCKA-20049:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -7435,6 +7441,7 @@ SCKA-20081:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -57371,6 +57378,7 @@ SLPS-25510:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -60540,6 +60548,7 @@ SLPS-73223:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -66541,6 +66550,7 @@ SLUS-21059:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down Expand Up @@ -67085,6 +67095,7 @@ SLUS-21160:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
Expand Down
8 changes: 1 addition & 7 deletions pcsx2/GS/Renderers/HW/GSHwHack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip)
return true;
}

if (!s_nativeres && r.PRIM->PRIM == GS_SPRITE && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0xFF000000 && r.m_index.tail > 2)
if (!s_nativeres && r.PRIM->PRIM == GS_SPRITE && RTME && RTEX0.TFX == 1 && !r.PRIM->ABE && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0xFF000000 && r.m_index.tail > 2)
{
// Don't enable hack on native res.
// Fixes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling.
Expand All @@ -204,12 +204,6 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip)
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)
{
// The moving display effect(flames) is not emulated properly in the entire screen so let's remove the effect in the stage: Burning Temple. Related to half screen bottom issue.
// Fixes black lines in the stage: Burning Temple - caused by upscaling. Note the black lines can also be fixed with Merge Sprite hack.
skip = 2;
}
}

return true;
Expand Down
3 changes: 2 additions & 1 deletion pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5655,7 +5655,8 @@ __ri void GSRendererHW::HandleTextureHazards(const GSTextureCache::Target* rt, c
GL_CACHE("Source is render target, taking copy.");
src_target = rt;
}
else if (m_conf.tex == m_conf.ds)
// Be careful of single page channel shuffles where depth is the source but it's not going to the same place, we can't read this directly.
else if (m_conf.tex == m_conf.ds && (!m_channel_shuffle || static_cast<int>(m_cached_ctx.FRAME.Block() - rt->m_TEX0.TBP0) == static_cast<int>(m_cached_ctx.ZBUF.Block() - ds->m_TEX0.TBP0)))
{
// GL, Vulkan (in General layout), not DirectX!
const bool can_read_current_depth_buffer = g_gs_device->Features().test_and_sample_depth;
Expand Down

0 comments on commit 547c4ab

Please sign in to comment.