GS: Fix missing PSM references.

This commit is contained in:
refractionpcsx2 2023-04-04 17:32:59 +01:00
parent 7b512ce296
commit 5d140f7db3
3 changed files with 18 additions and 18 deletions

View File

@ -311,35 +311,35 @@ void GSClut::Read(const GIFRegTEX0& TEX0)
u16* clut = m_clut;
if(TEX0.CPSM == PSM_PSMCT32 || TEX0.CPSM == PSM_PSMCT24)
if(TEX0.CPSM == PSMCT32 || TEX0.CPSM == PSMCT24)
{
switch(TEX0.PSM)
{
case PSM_PSMT8:
case PSM_PSMT8H:
case PSMT8:
case PSMT8H:
clut += (TEX0.CSA & 15) << 4;
ReadCLUT_T32_I8(clut, m_buff32);
break;
case PSM_PSMT4:
case PSM_PSMT4HL:
case PSM_PSMT4HH:
case PSMT4:
case PSMT4HL:
case PSMT4HH:
clut += (TEX0.CSA & 15) << 4;
ReadCLUT_T32_I4(clut, m_buff32, m_buff64);
break;
}
}
else if(TEX0.CPSM == PSM_PSMCT16 || TEX0.CPSM == PSM_PSMCT16S)
else if(TEX0.CPSM == PSMCT16 || TEX0.CPSM == PSMCT16S)
{
switch(TEX0.PSM)
{
case PSM_PSMT8:
case PSM_PSMT8H:
case PSMT8:
case PSMT8H:
clut += TEX0.CSA << 4;
ReadCLUT_T16_I8(clut, m_buff32);
break;
case PSM_PSMT4:
case PSM_PSMT4HL:
case PSM_PSMT4HH:
case PSMT4:
case PSMT4HL:
case PSMT4HH:
clut += TEX0.CSA << 4;
ReadCLUT_T16_I4(clut, m_buff32, m_buff64);
break;

View File

@ -1296,17 +1296,17 @@ void GSState::GIFRegHandlerFRAME(const GIFReg* RESTRICT r)
{
case PSMT8H:
// Berserk uses the format to only update the alpha channel
GL_INS("CORRECT FRAME FORMAT replaces PSM_PSMT8H by PSM_PSMCT32/0x00FF_FFFF");
GL_INS("CORRECT FRAME FORMAT replaces PSMT8H by PSMCT32/0x00FF_FFFF");
m_env.CTXT[i].FRAME.PSM = PSMCT32;
m_env.CTXT[i].FRAME.FBMSK = 0x00FFFFFF;
break;
case PSMT4HH: // Not tested. Based on PSM_PSMT8H behavior
GL_INS("CORRECT FRAME FORMAT replaces PSM_PSMT4HH by PSM_PSMCT32/0x0FFF_FFFF");
case PSMT4HH: // Not tested. Based on PSMT8H behavior
GL_INS("CORRECT FRAME FORMAT replaces PSMT4HH by PSMCT32/0x0FFF_FFFF");
m_env.CTXT[i].FRAME.PSM = PSMCT32;
m_env.CTXT[i].FRAME.FBMSK = 0x0FFFFFFF;
break;
case PSMT4HL: // Not tested. Based on PSM_PSMT8H behavior
GL_INS("CORRECT FRAME FORMAT replaces PSM_PSMT4HL by PSM_PSMCT32/0xF0FF_FFFF");
case PSMT4HL: // Not tested. Based on PSMT8H behavior
GL_INS("CORRECT FRAME FORMAT replaces PSMT4HL by PSMCT32/0xF0FF_FFFF");
m_env.CTXT[i].FRAME.PSM = PSMCT32;
m_env.CTXT[i].FRAME.FBMSK = 0xF0FFFFFF;
break;

View File

@ -2963,7 +2963,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
//GSVector4 scale = GSVector4(dst->m_texture->GetScale()).xyxy();
//int blockWidth = 64;
//int blockHeight = TEX0.PSM == PSM_PSMCT32 || TEX0.PSM == PSM_PSMCT24 ? 32 : 64;
//int blockHeight = TEX0.PSM == PSMCT32 || TEX0.PSM == PSMCT24 ? 32 : 64;
//GSVector4i br(0, 0, blockWidth, blockHeight);