GS: fix Majokko A-La-Mode 2 palette rendering.

This commit is contained in:
iMineLink 2022-01-16 18:55:12 +01:00 committed by refractionpcsx2
parent 2a2564cf45
commit 1f851887d9
3 changed files with 6 additions and 36 deletions

View File

@ -203,7 +203,7 @@ const CRC::Game CRC::m_games[] =
{0xA3643EB1, GiTS, KO, 0}, {0xA3643EB1, GiTS, KO, 0},
{0x28557423, GiTS, RU, 0}, {0x28557423, GiTS, RU, 0},
{0xBF6F101F, GiTS, EU, 0}, // same CRC as another US disc {0xBF6F101F, GiTS, EU, 0}, // same CRC as another US disc
{0xF442260C, MajokkoALaMode2, JP, 0}, {0xF442260C, MajokkoALaMode2, JP, PointListPalette},
{0xA616A6C2, TalesOfAbyss, US, 0}, {0xA616A6C2, TalesOfAbyss, US, 0},
{0x14FE77F7, TalesOfAbyss, US, 0}, {0x14FE77F7, TalesOfAbyss, US, 0},
{0xAA5EC3A3, TalesOfAbyss, JP, 0}, {0xAA5EC3A3, TalesOfAbyss, JP, 0},

View File

@ -1754,17 +1754,14 @@ GSRendererHW::Hacks::Hacks()
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::Jak2, CRC::RegionCount, &GSRendererHW::OI_JakGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::Jak2, CRC::RegionCount, &GSRendererHW::OI_JakGames));
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::Jak3, CRC::RegionCount, &GSRendererHW::OI_JakGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::Jak3, CRC::RegionCount, &GSRendererHW::OI_JakGames));
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::JakX, CRC::RegionCount, &GSRendererHW::OI_JakGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::JakX, CRC::RegionCount, &GSRendererHW::OI_JakGames));
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutTakedown, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutTakedown, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames));
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutRevenge, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutRevenge, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames));
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutDominator, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames)); m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::BurnoutDominator, CRC::RegionCount, &GSRendererHW::OI_BurnoutGames));
m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::MajokkoALaMode2, CRC::RegionCount, &GSRendererHW::OO_MajokkoALaMode2));
m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutTakedown, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames)); m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutTakedown, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames));
m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutRevenge, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames)); m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutRevenge, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames));
m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutDominator, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames)); m_oo_list.push_back(HackEntry<OO_Ptr>(CRC::BurnoutDominator, CRC::RegionCount, &GSRendererHW::OO_BurnoutGames));
m_cu_list.push_back(HackEntry<CU_Ptr>(CRC::MajokkoALaMode2, CRC::RegionCount, &GSRendererHW::CU_MajokkoALaMode2));
m_cu_list.push_back(HackEntry<CU_Ptr>(CRC::TalesOfAbyss, CRC::RegionCount, &GSRendererHW::CU_TalesOfAbyss)); m_cu_list.push_back(HackEntry<CU_Ptr>(CRC::TalesOfAbyss, CRC::RegionCount, &GSRendererHW::CU_TalesOfAbyss));
} }
@ -2252,10 +2249,14 @@ bool GSRendererHW::OI_PointListPalette(GSTexture* rt, GSTexture* ds, GSTextureCa
const size_t n_vertices = m_vertex.next; const size_t n_vertices = m_vertex.next;
const int w = m_r.width(); const int w = m_r.width();
const int h = m_r.height(); const int h = m_r.height();
const bool is_copy = !PRIM->ABE || (
m_context->ALPHA.A == m_context->ALPHA.B // (A - B) == 0 in blending equation, makes C value irrelevant.
&& m_context->ALPHA.D == 0 // Copy source RGB(A) color into frame buffer.
);
if (m_vt.m_primclass == GS_POINT_CLASS && w <= 64 // Small draws. if (m_vt.m_primclass == GS_POINT_CLASS && w <= 64 // Small draws.
&& h <= 64 // Small draws. && h <= 64 // Small draws.
&& n_vertices <= 256 // Small draws. && n_vertices <= 256 // Small draws.
&& PRIM->ABE // Alpha blending. && is_copy // Copy (no blending).
&& !PRIM->TME // No texturing please. && !PRIM->TME // No texturing please.
&& m_context->FRAME.PSM == PSM_PSMCT32 // Only 32-bit pixel format (CLUT format). && m_context->FRAME.PSM == PSM_PSMCT32 // Only 32-bit pixel format (CLUT format).
&& !PRIM->FGE // No FOG. && !PRIM->FGE // No FOG.
@ -2269,8 +2270,6 @@ bool GSRendererHW::OI_PointListPalette(GSTexture* rt, GSTexture* ds, GSTextureCa
&& !m_env.PABE.PABE // No PABE. && !m_env.PABE.PABE // No PABE.
&& m_context->FBA.FBA == 0 // No Alpha Correction. && m_context->FBA.FBA == 0 // No Alpha Correction.
&& m_context->FRAME.FBMSK == 0 // No frame buffer masking. && m_context->FRAME.FBMSK == 0 // No frame buffer masking.
&& m_context->ALPHA.A == m_context->ALPHA.B // (A - B) == 0 in blending equation, makes C value irrelevant.
&& m_context->ALPHA.D == 0 // Copy source RGB(A) color into frame buffer.
) )
{ {
const u32 FBP = m_context->FRAME.Block(); const u32 FBP = m_context->FRAME.Block();
@ -2395,24 +2394,6 @@ bool GSRendererHW::OI_BurnoutGames(GSTexture* rt, GSTexture* ds, GSTextureCache:
// OO (others output?) hacks: invalidate extra local memory after the draw call // OO (others output?) hacks: invalidate extra local memory after the draw call
void GSRendererHW::OO_MajokkoALaMode2()
{
// palette readback
const u32 FBP = m_context->FRAME.Block();
if (!PRIM->TME && FBP == 0x03f40)
{
GIFRegBITBLTBUF BITBLTBUF;
BITBLTBUF.SBP = FBP;
BITBLTBUF.SBW = 1;
BITBLTBUF.SPSM = PSM_PSMCT32;
InvalidateLocalMem(BITBLTBUF, GSVector4i(0, 0, 16, 16));
}
}
void GSRendererHW::OO_BurnoutGames() void GSRendererHW::OO_BurnoutGames()
{ {
const GIFRegTEX0& TEX0 = m_context->TEX0; const GIFRegTEX0& TEX0 = m_context->TEX0;
@ -2450,15 +2431,6 @@ void GSRendererHW::OO_BurnoutGames()
// Can Upscale hacks: disable upscaling for some draw calls // Can Upscale hacks: disable upscaling for some draw calls
bool GSRendererHW::CU_MajokkoALaMode2()
{
// palette should stay 16 x 16
const u32 FBP = m_context->FRAME.Block();
return FBP != 0x03f40;
}
bool GSRendererHW::CU_TalesOfAbyss() bool GSRendererHW::CU_TalesOfAbyss()
{ {
// full image blur and brightening // full image blur and brightening

View File

@ -59,10 +59,8 @@ private:
bool OI_JakGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_JakGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
bool OI_BurnoutGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t); bool OI_BurnoutGames(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
void OO_MajokkoALaMode2();
void OO_BurnoutGames(); void OO_BurnoutGames();
bool CU_MajokkoALaMode2();
bool CU_TalesOfAbyss(); bool CU_TalesOfAbyss();
class Hacks class Hacks