From 7a93f1fc23923f49c5a54bdce83efcb738afbd61 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 25 Mar 2023 15:11:26 +1000 Subject: [PATCH] GS/HW: Remove KOF2002/SVCChaos CRC hacks 10 Pin - Champions Alley needs texture-inside-RT in LookupDepthSource(), but otherwise nothing else appears to break if we fall back to normal lookup for Z sources. Relaxes the page alignment requirement for split texture shuffle detection, Psi-Ops does an A->A copy with coordinates offset by +8. --- pcsx2/GS/GSCrc.cpp | 7 ------- pcsx2/GS/GSCrc.h | 2 -- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 5 +++-- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 21 ++------------------- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/pcsx2/GS/GSCrc.cpp b/pcsx2/GS/GSCrc.cpp index ea72eed33e..7a590bb83e 100644 --- a/pcsx2/GS/GSCrc.cpp +++ b/pcsx2/GS/GSCrc.cpp @@ -67,13 +67,6 @@ const CRC::Game CRC::m_games[] = {0x5AC7E79C, PolyphonyDigitalGames /* CH */}, // TouristTrophy {0xFF9C0E93, PolyphonyDigitalGames /* US */}, // TouristTrophy {0xCA9AA903, PolyphonyDigitalGames /* EU */}, // TouristTrophy - {0xAC3C1147, SVCChaos /* EU */}, // SVC Chaos: SNK vs. Capcom - {0xB00FF2ED, SVCChaos /* JP */}, - {0x94834BD3, SVCChaos /* JP */}, - {0xCF1D71EE, KOF2002 /* EU */}, // The King of Fighters 2002 - {0xABD16263, KOF2002 /* JP */}, - {0x424A8601, KOF2002 /* JP */}, - {0x7F74D8D0, KOF2002 /* US */}, {0xFC46EA61, Tekken5 /* JP */}, {0x1F88EE37, Tekken5 /* EU */}, {0x1F88BECD, Tekken5 /* EU */}, // language selector... diff --git a/pcsx2/GS/GSCrc.h b/pcsx2/GS/GSCrc.h index 0568495833..865faffa52 100644 --- a/pcsx2/GS/GSCrc.h +++ b/pcsx2/GS/GSCrc.h @@ -25,10 +25,8 @@ public: NoTitle, GetawayGames, ICO, - KOF2002, PolyphonyDigitalGames, SMTNocturne, - SVCChaos, Tekken5, TitleCount, }; diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index ae68569c6a..4f042c6979 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -844,8 +844,9 @@ bool GSRendererHW::IsSplitTextureShuffle() // X might be offset by up to -8/+8, but either the position or UV should be aligned. GSVector4i aligned_rc = pos_rc.min_i32(tex_rc).blend32<12>(pos_rc.max_i32(tex_rc)); - // Check page alignment. - if (aligned_rc.x != 0 || (aligned_rc.z & (frame_psm.pgs.x - 1)) != 0 || + // Y should be page aligned. X should be too, but if it's doing a copy with a shuffle (which is kinda silly), both the + // position and coordinates may be offset by +8. See Psi-Ops - The Mindgate Conspiracy. + if ((aligned_rc.x & 7) != 0 || aligned_rc.x > 8 || (aligned_rc.z & 7) != 0 || aligned_rc.y != 0 || (aligned_rc.w & (frame_psm.pgs.y - 1)) != 0) { return false; diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index b8225c86de..56c1a71bed 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -629,27 +629,10 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0 AttachPaletteToSource(src, psm_s.pal, true); } } - else if (g_gs_renderer->m_game.title == CRC::SVCChaos || g_gs_renderer->m_game.title == CRC::KOF2002) - { - // SVCChaos black screen & KOF2002 blue screen on main menu, regardless of depth enabled or disabled. - return LookupSource(TEX0, TEXA, CLAMP, r, nullptr); - } else { - GL_CACHE("TC depth: ERROR miss (0x%x, %s)", TEX0.TBP0, psm_str(psm)); - // Possible ? In this case we could call LookupSource - // Or just put a basic texture - // src->m_texture = g_gs_device->CreateTexture(tw, th); - // In all cases rendering will be broken - // - // Note: might worth to check previous frame - // Note: otherwise return NULL and skip the draw - - // Full Spectrum Warrior: first draw call of cut-scene rendering - // The game tries to emulate a texture shuffle with an old depth buffer - // (don't exists yet for us due to the cache) - // Rendering is nicer (less garbage) if we skip the draw call. - throw GSRecoverableError(); + // This is a bit of a worry, since it could load junk from local memory... but it's better than skipping the draw. + return LookupSource(TEX0, TEXA, CLAMP, r, nullptr); } ASSERT(src->m_texture);