GS: Don't process CLUT load condition on invalid PSM

This commit is contained in:
refractionpcsx2 2022-02-05 03:31:14 +00:00
parent 5cc66e4d36
commit 8ac57db117
1 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,11 @@ void GSClut::Invalidate(u32 block)
bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)
{ {
// Check if PSM is an indexed format BEFORE the load condition, updating CBP0/1 on an invalid format is not allowed
// and can break games. Corvette (NTSC) is a good example of this.
if ((TEX0.PSM & 0x7) < 3)
return false;
switch (TEX0.CLD) switch (TEX0.CLD)
{ {
case 0: case 0:
@ -149,7 +154,7 @@ bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)
} }
// CLUT only reloads if PSM is a valid index type, avoid unnecessary flushes // CLUT only reloads if PSM is a valid index type, avoid unnecessary flushes
return ((TEX0.PSM & 0x7) >= 3) && m_write.IsDirty(TEX0, TEXCLUT); return m_write.IsDirty(TEX0, TEXCLUT);
} }
void GSClut::Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) void GSClut::Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)