From ada291c0f663ea63a9fdc57453c84613fbcb3635 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 4 Apr 2023 12:27:51 +0100 Subject: [PATCH] GS: Remove redundant PSM enum naming --- pcsx2/GS/GSClut.cpp | 86 ++--- pcsx2/GS/GSLocalMemory.cpp | 270 +++++++-------- pcsx2/GS/GSLocalMemory.h | 28 +- pcsx2/GS/GSLocalMemoryMultiISA.cpp | 316 +++++++++--------- pcsx2/GS/GSRegs.h | 32 +- pcsx2/GS/GSState.cpp | 24 +- pcsx2/GS/GSUtil.cpp | 102 +++--- pcsx2/GS/Renderers/Common/GSDirtyRect.cpp | 2 +- pcsx2/GS/Renderers/HW/GSHwHack.cpp | 128 +++---- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 24 +- .../GS/Renderers/HW/GSRendererHWMultiISA.cpp | 6 +- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 58 ++-- pcsx2/GS/Renderers/SW/GSRendererSW.cpp | 8 +- 13 files changed, 542 insertions(+), 542 deletions(-) diff --git a/pcsx2/GS/GSClut.cpp b/pcsx2/GS/GSClut.cpp index c687172f07..cc7fb5388d 100644 --- a/pcsx2/GS/GSClut.cpp +++ b/pcsx2/GS/GSClut.cpp @@ -47,8 +47,8 @@ GSClut::GSClut(GSLocalMemory* mem) switch (i) { - case PSM_PSMCT32: - case PSM_PSMCT24: // undocumented (KH?) + case PSMCT32: + case PSMCT24: // undocumented (KH?) if (eight_bit) m_wc[0][i][j] = &GSClut::WriteCLUT32_I8_CSM1; else if (four_bit) @@ -56,7 +56,7 @@ GSClut::GSClut(GSLocalMemory* mem) else m_wc[0][i][j] = &GSClut::WriteCLUT_NULL; break; - case PSM_PSMCT16: + case PSMCT16: if (eight_bit) m_wc[0][i][j] = &GSClut::WriteCLUT16_I8_CSM1; else if (four_bit) @@ -64,7 +64,7 @@ GSClut::GSClut(GSLocalMemory* mem) else m_wc[0][i][j] = &GSClut::WriteCLUT_NULL; break; - case PSM_PSMCT16S: + case PSMCT16S: if (eight_bit) m_wc[0][i][j] = &GSClut::WriteCLUT16S_I8_CSM1; else if (four_bit) @@ -81,26 +81,26 @@ GSClut::GSClut(GSLocalMemory* mem) } } - m_wc[1][PSM_PSMCT32][PSM_PSMT8] = &GSClut::WriteCLUT32_CSM2<256>; - m_wc[1][PSM_PSMCT32][PSM_PSMT8H] = &GSClut::WriteCLUT32_CSM2<256>; - m_wc[1][PSM_PSMCT32][PSM_PSMT4] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT32][PSM_PSMT4HL] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT32][PSM_PSMT4HH] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT24][PSM_PSMT8] = &GSClut::WriteCLUT32_CSM2<256>; - m_wc[1][PSM_PSMCT24][PSM_PSMT8H] = &GSClut::WriteCLUT32_CSM2<256>; - m_wc[1][PSM_PSMCT24][PSM_PSMT4] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT24][PSM_PSMT4HL] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT24][PSM_PSMT4HH] = &GSClut::WriteCLUT32_CSM2<16>; - m_wc[1][PSM_PSMCT16][PSM_PSMT8] = &GSClut::WriteCLUT16_CSM2<256>; - m_wc[1][PSM_PSMCT16][PSM_PSMT8H] = &GSClut::WriteCLUT16_CSM2<256>; - m_wc[1][PSM_PSMCT16][PSM_PSMT4] = &GSClut::WriteCLUT16_CSM2<16>; - m_wc[1][PSM_PSMCT16][PSM_PSMT4HL] = &GSClut::WriteCLUT16_CSM2<16>; - m_wc[1][PSM_PSMCT16][PSM_PSMT4HH] = &GSClut::WriteCLUT16_CSM2<16>; - m_wc[1][PSM_PSMCT16S][PSM_PSMT8] = &GSClut::WriteCLUT16S_CSM2<256>; - m_wc[1][PSM_PSMCT16S][PSM_PSMT8H] = &GSClut::WriteCLUT16S_CSM2<256>; - m_wc[1][PSM_PSMCT16S][PSM_PSMT4] = &GSClut::WriteCLUT16S_CSM2<16>; - m_wc[1][PSM_PSMCT16S][PSM_PSMT4HL] = &GSClut::WriteCLUT16S_CSM2<16>; - m_wc[1][PSM_PSMCT16S][PSM_PSMT4HH] = &GSClut::WriteCLUT16S_CSM2<16>; + m_wc[1][PSMCT32][PSMT8] = &GSClut::WriteCLUT32_CSM2<256>; + m_wc[1][PSMCT32][PSMT8H] = &GSClut::WriteCLUT32_CSM2<256>; + m_wc[1][PSMCT32][PSMT4] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT32][PSMT4HL] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT32][PSMT4HH] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT24][PSMT8] = &GSClut::WriteCLUT32_CSM2<256>; + m_wc[1][PSMCT24][PSMT8H] = &GSClut::WriteCLUT32_CSM2<256>; + m_wc[1][PSMCT24][PSMT4] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT24][PSMT4HL] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT24][PSMT4HH] = &GSClut::WriteCLUT32_CSM2<16>; + m_wc[1][PSMCT16][PSMT8] = &GSClut::WriteCLUT16_CSM2<256>; + m_wc[1][PSMCT16][PSMT8H] = &GSClut::WriteCLUT16_CSM2<256>; + m_wc[1][PSMCT16][PSMT4] = &GSClut::WriteCLUT16_CSM2<16>; + m_wc[1][PSMCT16][PSMT4HL] = &GSClut::WriteCLUT16_CSM2<16>; + m_wc[1][PSMCT16][PSMT4HH] = &GSClut::WriteCLUT16_CSM2<16>; + m_wc[1][PSMCT16S][PSMT8] = &GSClut::WriteCLUT16S_CSM2<256>; + m_wc[1][PSMCT16S][PSMT8H] = &GSClut::WriteCLUT16S_CSM2<256>; + m_wc[1][PSMCT16S][PSMT4] = &GSClut::WriteCLUT16S_CSM2<16>; + m_wc[1][PSMCT16S][PSMT4HL] = &GSClut::WriteCLUT16S_CSM2<16>; + m_wc[1][PSMCT16S][PSMT4HH] = &GSClut::WriteCLUT16S_CSM2<16>; } GSClut::~GSClut() @@ -253,7 +253,7 @@ void GSClut::WriteCLUT16S_I4_CSM1(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& T template void GSClut::WriteCLUT32_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT32); + GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSMCT32); auto pa = off.paMulti(m_mem->vm32(), TEXCLUT.COU << 4, TEXCLUT.COV); u16* RESTRICT clut = m_clut + ((TEX0.CSA & 15) << 4); @@ -270,7 +270,7 @@ void GSClut::WriteCLUT32_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCL template void GSClut::WriteCLUT16_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16); + GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSMCT16); auto pa = off.paMulti(m_mem->vm16(), TEXCLUT.COU << 4, TEXCLUT.COV); u16* RESTRICT clut = m_clut + (TEX0.CSA << 4); @@ -284,7 +284,7 @@ void GSClut::WriteCLUT16_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCL template void GSClut::WriteCLUT16S_CSM2(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT) { - GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSM_PSMCT16S); + GSOffset off = GSOffset::fromKnownPSM(TEX0.CBP, TEXCLUT.CBW, PSMCT16S); auto pa = off.paMulti(m_mem->vm16(), TEXCLUT.COU << 4, TEXCLUT.COV); u16* RESTRICT clut = m_clut + (TEX0.CSA << 4); @@ -360,17 +360,17 @@ void GSClut::Read32(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) 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: ReadCLUT_T32_I8(clut, m_buff32, (TEX0.CSA & 15) << 4); break; - case PSM_PSMT4: - case PSM_PSMT4HL: - case PSM_PSMT4HH: + case PSMT4: + case PSMT4HL: + case PSMT4HH: clut += (TEX0.CSA & 15) << 4; // TODO: merge these functions ReadCLUT_T32_I4(clut, m_buff32); @@ -378,18 +378,18 @@ void GSClut::Read32(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) 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; Expand16(clut, m_buff32, 256, TEXA); break; - case PSM_PSMT4: - case PSM_PSMT4HL: - case PSM_PSMT4HH: + case PSMT4: + case PSMT4HL: + case PSMT4HH: clut += TEX0.CSA << 4; // TODO: merge these functions Expand16(clut, m_buff32, 16, TEXA); @@ -401,7 +401,7 @@ void GSClut::Read32(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) m_current_gpu_clut = nullptr; if (GSConfig.UserHacks_GPUTargetCLUTMode != GSGPUTargetCLUTMode::Disabled) { - const bool is_4bit = (TEX0.PSM == PSM_PSMT4 || TEX0.PSM == PSM_PSMT4HL || TEX0.PSM == PSM_PSMT4HH); + const bool is_4bit = (TEX0.PSM == PSMT4 || TEX0.PSM == PSMT4HL || TEX0.PSM == PSMT4HH); u32 CBW; GSVector2i offset; @@ -428,7 +428,7 @@ void GSClut::Read32(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) { GSTexture* dst = is_4bit ? m_gpu_clut4 : m_gpu_clut8; u32 dst_size = is_4bit ? 16 : 256; - const u32 dOffset = (TEX0.CSA & ((TEX0.CPSM == PSM_PSMCT16 || TEX0.CPSM == PSM_PSMCT16S) ? 15u : 31u)) << 4; + const u32 dOffset = (TEX0.CSA & ((TEX0.CPSM == PSMCT16 || TEX0.CPSM == PSMCT16S) ? 15u : 31u)) << 4; if (!dst) { // allocate texture lazily @@ -899,10 +899,10 @@ bool GSClut::ReadState::IsDirty(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) else // Just to optimise the checks. { // Check TA0 and AEM in 24bit mode. - if (TEX0.CPSM == PSM_PSMCT24 && ((this->TEXA.U64 ^ TEXA.U64) & texa24_mask)) + if (TEX0.CPSM == PSMCT24 && ((this->TEXA.U64 ^ TEXA.U64) & texa24_mask)) is_dirty |= true; // Check all fields in 16bit mode. - else if (TEX0.CPSM >= PSM_PSMCT16 && ((this->TEXA.U64 ^ TEXA.U64) & texa16_mask)) + else if (TEX0.CPSM >= PSMCT16 && ((this->TEXA.U64 ^ TEXA.U64) & texa16_mask)) is_dirty |= true; } diff --git a/pcsx2/GS/GSLocalMemory.cpp b/pcsx2/GS/GSLocalMemory.cpp index 95bb7be7bd..2a94e4eb96 100644 --- a/pcsx2/GS/GSLocalMemory.cpp +++ b/pcsx2/GS/GSLocalMemory.cpp @@ -90,160 +90,160 @@ GSLocalMemory::GSLocalMemory() psm.fmsk = 0xffffffff; } - m_psm[PSM_PSGPU24].info = GSLocalMemory::swizzle16; - m_psm[PSM_PSMCT16].info = GSLocalMemory::swizzle16; - m_psm[PSM_PSMCT16S].info = GSLocalMemory::swizzle16S; - m_psm[PSM_PSMT8].info = GSLocalMemory::swizzle8; - m_psm[PSM_PSMT4].info = GSLocalMemory::swizzle4; - m_psm[PSM_PSMZ32].info = GSLocalMemory::swizzle32Z; - m_psm[PSM_PSMZ24].info = GSLocalMemory::swizzle32Z; - m_psm[PSM_PSMZ16].info = GSLocalMemory::swizzle16Z; - m_psm[PSM_PSMZ16S].info = GSLocalMemory::swizzle16SZ; + m_psm[PSGPU24].info = GSLocalMemory::swizzle16; + m_psm[PSMCT16].info = GSLocalMemory::swizzle16; + m_psm[PSMCT16S].info = GSLocalMemory::swizzle16S; + m_psm[PSMT8].info = GSLocalMemory::swizzle8; + m_psm[PSMT4].info = GSLocalMemory::swizzle4; + m_psm[PSMZ32].info = GSLocalMemory::swizzle32Z; + m_psm[PSMZ24].info = GSLocalMemory::swizzle32Z; + m_psm[PSMZ16].info = GSLocalMemory::swizzle16Z; + m_psm[PSMZ16S].info = GSLocalMemory::swizzle16SZ; - m_psm[PSM_PSMCT24].rp = &GSLocalMemory::ReadPixel24; - m_psm[PSM_PSMCT16].rp = &GSLocalMemory::ReadPixel16; - m_psm[PSM_PSMCT16S].rp = &GSLocalMemory::ReadPixel16S; - m_psm[PSM_PSMT8].rp = &GSLocalMemory::ReadPixel8; - m_psm[PSM_PSMT4].rp = &GSLocalMemory::ReadPixel4; - m_psm[PSM_PSMT8H].rp = &GSLocalMemory::ReadPixel8H; - m_psm[PSM_PSMT4HL].rp = &GSLocalMemory::ReadPixel4HL; - m_psm[PSM_PSMT4HH].rp = &GSLocalMemory::ReadPixel4HH; - m_psm[PSM_PSMZ32].rp = &GSLocalMemory::ReadPixel32Z; - m_psm[PSM_PSMZ24].rp = &GSLocalMemory::ReadPixel24Z; - m_psm[PSM_PSMZ16].rp = &GSLocalMemory::ReadPixel16Z; - m_psm[PSM_PSMZ16S].rp = &GSLocalMemory::ReadPixel16SZ; + m_psm[PSMCT24].rp = &GSLocalMemory::ReadPixel24; + m_psm[PSMCT16].rp = &GSLocalMemory::ReadPixel16; + m_psm[PSMCT16S].rp = &GSLocalMemory::ReadPixel16S; + m_psm[PSMT8].rp = &GSLocalMemory::ReadPixel8; + m_psm[PSMT4].rp = &GSLocalMemory::ReadPixel4; + m_psm[PSMT8H].rp = &GSLocalMemory::ReadPixel8H; + m_psm[PSMT4HL].rp = &GSLocalMemory::ReadPixel4HL; + m_psm[PSMT4HH].rp = &GSLocalMemory::ReadPixel4HH; + m_psm[PSMZ32].rp = &GSLocalMemory::ReadPixel32Z; + m_psm[PSMZ24].rp = &GSLocalMemory::ReadPixel24Z; + m_psm[PSMZ16].rp = &GSLocalMemory::ReadPixel16Z; + m_psm[PSMZ16S].rp = &GSLocalMemory::ReadPixel16SZ; - m_psm[PSM_PSMCT24].rpa = &GSLocalMemory::ReadPixel24; - m_psm[PSM_PSMCT16].rpa = &GSLocalMemory::ReadPixel16; - m_psm[PSM_PSMCT16S].rpa = &GSLocalMemory::ReadPixel16; - m_psm[PSM_PSMT8].rpa = &GSLocalMemory::ReadPixel8; - m_psm[PSM_PSMT4].rpa = &GSLocalMemory::ReadPixel4; - m_psm[PSM_PSMT8H].rpa = &GSLocalMemory::ReadPixel8H; - m_psm[PSM_PSMT4HL].rpa = &GSLocalMemory::ReadPixel4HL; - m_psm[PSM_PSMT4HH].rpa = &GSLocalMemory::ReadPixel4HH; - m_psm[PSM_PSMZ32].rpa = &GSLocalMemory::ReadPixel32; - m_psm[PSM_PSMZ24].rpa = &GSLocalMemory::ReadPixel24; - m_psm[PSM_PSMZ16].rpa = &GSLocalMemory::ReadPixel16; - m_psm[PSM_PSMZ16S].rpa = &GSLocalMemory::ReadPixel16; + m_psm[PSMCT24].rpa = &GSLocalMemory::ReadPixel24; + m_psm[PSMCT16].rpa = &GSLocalMemory::ReadPixel16; + m_psm[PSMCT16S].rpa = &GSLocalMemory::ReadPixel16; + m_psm[PSMT8].rpa = &GSLocalMemory::ReadPixel8; + m_psm[PSMT4].rpa = &GSLocalMemory::ReadPixel4; + m_psm[PSMT8H].rpa = &GSLocalMemory::ReadPixel8H; + m_psm[PSMT4HL].rpa = &GSLocalMemory::ReadPixel4HL; + m_psm[PSMT4HH].rpa = &GSLocalMemory::ReadPixel4HH; + m_psm[PSMZ32].rpa = &GSLocalMemory::ReadPixel32; + m_psm[PSMZ24].rpa = &GSLocalMemory::ReadPixel24; + m_psm[PSMZ16].rpa = &GSLocalMemory::ReadPixel16; + m_psm[PSMZ16S].rpa = &GSLocalMemory::ReadPixel16; - m_psm[PSM_PSMCT32].wp = &GSLocalMemory::WritePixel32; - m_psm[PSM_PSMCT24].wp = &GSLocalMemory::WritePixel24; - m_psm[PSM_PSMCT16].wp = &GSLocalMemory::WritePixel16; - m_psm[PSM_PSMCT16S].wp = &GSLocalMemory::WritePixel16S; - m_psm[PSM_PSMT8].wp = &GSLocalMemory::WritePixel8; - m_psm[PSM_PSMT4].wp = &GSLocalMemory::WritePixel4; - m_psm[PSM_PSMT8H].wp = &GSLocalMemory::WritePixel8H; - m_psm[PSM_PSMT4HL].wp = &GSLocalMemory::WritePixel4HL; - m_psm[PSM_PSMT4HH].wp = &GSLocalMemory::WritePixel4HH; - m_psm[PSM_PSMZ32].wp = &GSLocalMemory::WritePixel32Z; - m_psm[PSM_PSMZ24].wp = &GSLocalMemory::WritePixel24Z; - m_psm[PSM_PSMZ16].wp = &GSLocalMemory::WritePixel16Z; - m_psm[PSM_PSMZ16S].wp = &GSLocalMemory::WritePixel16SZ; + m_psm[PSMCT32].wp = &GSLocalMemory::WritePixel32; + m_psm[PSMCT24].wp = &GSLocalMemory::WritePixel24; + m_psm[PSMCT16].wp = &GSLocalMemory::WritePixel16; + m_psm[PSMCT16S].wp = &GSLocalMemory::WritePixel16S; + m_psm[PSMT8].wp = &GSLocalMemory::WritePixel8; + m_psm[PSMT4].wp = &GSLocalMemory::WritePixel4; + m_psm[PSMT8H].wp = &GSLocalMemory::WritePixel8H; + m_psm[PSMT4HL].wp = &GSLocalMemory::WritePixel4HL; + m_psm[PSMT4HH].wp = &GSLocalMemory::WritePixel4HH; + m_psm[PSMZ32].wp = &GSLocalMemory::WritePixel32Z; + m_psm[PSMZ24].wp = &GSLocalMemory::WritePixel24Z; + m_psm[PSMZ16].wp = &GSLocalMemory::WritePixel16Z; + m_psm[PSMZ16S].wp = &GSLocalMemory::WritePixel16SZ; - m_psm[PSM_PSMCT32].wpa = &GSLocalMemory::WritePixel32; - m_psm[PSM_PSMCT24].wpa = &GSLocalMemory::WritePixel24; - m_psm[PSM_PSMCT16].wpa = &GSLocalMemory::WritePixel16; - m_psm[PSM_PSMCT16S].wpa = &GSLocalMemory::WritePixel16; - m_psm[PSM_PSMT8].wpa = &GSLocalMemory::WritePixel8; - m_psm[PSM_PSMT4].wpa = &GSLocalMemory::WritePixel4; - m_psm[PSM_PSMT8H].wpa = &GSLocalMemory::WritePixel8H; - m_psm[PSM_PSMT4HL].wpa = &GSLocalMemory::WritePixel4HL; - m_psm[PSM_PSMT4HH].wpa = &GSLocalMemory::WritePixel4HH; - m_psm[PSM_PSMZ32].wpa = &GSLocalMemory::WritePixel32; - m_psm[PSM_PSMZ24].wpa = &GSLocalMemory::WritePixel24; - m_psm[PSM_PSMZ16].wpa = &GSLocalMemory::WritePixel16; - m_psm[PSM_PSMZ16S].wpa = &GSLocalMemory::WritePixel16; + m_psm[PSMCT32].wpa = &GSLocalMemory::WritePixel32; + m_psm[PSMCT24].wpa = &GSLocalMemory::WritePixel24; + m_psm[PSMCT16].wpa = &GSLocalMemory::WritePixel16; + m_psm[PSMCT16S].wpa = &GSLocalMemory::WritePixel16; + m_psm[PSMT8].wpa = &GSLocalMemory::WritePixel8; + m_psm[PSMT4].wpa = &GSLocalMemory::WritePixel4; + m_psm[PSMT8H].wpa = &GSLocalMemory::WritePixel8H; + m_psm[PSMT4HL].wpa = &GSLocalMemory::WritePixel4HL; + m_psm[PSMT4HH].wpa = &GSLocalMemory::WritePixel4HH; + m_psm[PSMZ32].wpa = &GSLocalMemory::WritePixel32; + m_psm[PSMZ24].wpa = &GSLocalMemory::WritePixel24; + m_psm[PSMZ16].wpa = &GSLocalMemory::WritePixel16; + m_psm[PSMZ16S].wpa = &GSLocalMemory::WritePixel16; - m_psm[PSM_PSMCT24].rt = &GSLocalMemory::ReadTexel24; - m_psm[PSM_PSMCT16].rt = &GSLocalMemory::ReadTexel16; - m_psm[PSM_PSMCT16S].rt = &GSLocalMemory::ReadTexel16S; - m_psm[PSM_PSMT8].rt = &GSLocalMemory::ReadTexel8; - m_psm[PSM_PSMT4].rt = &GSLocalMemory::ReadTexel4; - m_psm[PSM_PSMT8H].rt = &GSLocalMemory::ReadTexel8H; - m_psm[PSM_PSMT4HL].rt = &GSLocalMemory::ReadTexel4HL; - m_psm[PSM_PSMT4HH].rt = &GSLocalMemory::ReadTexel4HH; - m_psm[PSM_PSMZ32].rt = &GSLocalMemory::ReadTexel32Z; - m_psm[PSM_PSMZ24].rt = &GSLocalMemory::ReadTexel24Z; - m_psm[PSM_PSMZ16].rt = &GSLocalMemory::ReadTexel16Z; - m_psm[PSM_PSMZ16S].rt = &GSLocalMemory::ReadTexel16SZ; + m_psm[PSMCT24].rt = &GSLocalMemory::ReadTexel24; + m_psm[PSMCT16].rt = &GSLocalMemory::ReadTexel16; + m_psm[PSMCT16S].rt = &GSLocalMemory::ReadTexel16S; + m_psm[PSMT8].rt = &GSLocalMemory::ReadTexel8; + m_psm[PSMT4].rt = &GSLocalMemory::ReadTexel4; + m_psm[PSMT8H].rt = &GSLocalMemory::ReadTexel8H; + m_psm[PSMT4HL].rt = &GSLocalMemory::ReadTexel4HL; + m_psm[PSMT4HH].rt = &GSLocalMemory::ReadTexel4HH; + m_psm[PSMZ32].rt = &GSLocalMemory::ReadTexel32Z; + m_psm[PSMZ24].rt = &GSLocalMemory::ReadTexel24Z; + m_psm[PSMZ16].rt = &GSLocalMemory::ReadTexel16Z; + m_psm[PSMZ16S].rt = &GSLocalMemory::ReadTexel16SZ; - m_psm[PSM_PSMCT24].rta = &GSLocalMemory::ReadTexel24; - m_psm[PSM_PSMCT16].rta = &GSLocalMemory::ReadTexel16; - m_psm[PSM_PSMCT16S].rta = &GSLocalMemory::ReadTexel16; - m_psm[PSM_PSMT8].rta = &GSLocalMemory::ReadTexel8; - m_psm[PSM_PSMT4].rta = &GSLocalMemory::ReadTexel4; - m_psm[PSM_PSMT8H].rta = &GSLocalMemory::ReadTexel8H; - m_psm[PSM_PSMT4HL].rta = &GSLocalMemory::ReadTexel4HL; - m_psm[PSM_PSMT4HH].rta = &GSLocalMemory::ReadTexel4HH; - m_psm[PSM_PSMZ24].rta = &GSLocalMemory::ReadTexel24; - m_psm[PSM_PSMZ16].rta = &GSLocalMemory::ReadTexel16; - m_psm[PSM_PSMZ16S].rta = &GSLocalMemory::ReadTexel16; + m_psm[PSMCT24].rta = &GSLocalMemory::ReadTexel24; + m_psm[PSMCT16].rta = &GSLocalMemory::ReadTexel16; + m_psm[PSMCT16S].rta = &GSLocalMemory::ReadTexel16; + m_psm[PSMT8].rta = &GSLocalMemory::ReadTexel8; + m_psm[PSMT4].rta = &GSLocalMemory::ReadTexel4; + m_psm[PSMT8H].rta = &GSLocalMemory::ReadTexel8H; + m_psm[PSMT4HL].rta = &GSLocalMemory::ReadTexel4HL; + m_psm[PSMT4HH].rta = &GSLocalMemory::ReadTexel4HH; + m_psm[PSMZ24].rta = &GSLocalMemory::ReadTexel24; + m_psm[PSMZ16].rta = &GSLocalMemory::ReadTexel16; + m_psm[PSMZ16S].rta = &GSLocalMemory::ReadTexel16; - m_psm[PSM_PSMCT24].wfa = &GSLocalMemory::WritePixel24; - m_psm[PSM_PSMCT16].wfa = &GSLocalMemory::WriteFrame16; - m_psm[PSM_PSMCT16S].wfa = &GSLocalMemory::WriteFrame16; - m_psm[PSM_PSMZ24].wfa = &GSLocalMemory::WritePixel24; - m_psm[PSM_PSMZ16].wfa = &GSLocalMemory::WriteFrame16; - m_psm[PSM_PSMZ16S].wfa = &GSLocalMemory::WriteFrame16; + m_psm[PSMCT24].wfa = &GSLocalMemory::WritePixel24; + m_psm[PSMCT16].wfa = &GSLocalMemory::WriteFrame16; + m_psm[PSMCT16S].wfa = &GSLocalMemory::WriteFrame16; + m_psm[PSMZ24].wfa = &GSLocalMemory::WritePixel24; + m_psm[PSMZ16].wfa = &GSLocalMemory::WriteFrame16; + m_psm[PSMZ16S].wfa = &GSLocalMemory::WriteFrame16; - m_psm[PSM_PSGPU24].bpp = 16; - m_psm[PSM_PSMCT16].bpp = m_psm[PSM_PSMCT16S].bpp = 16; - m_psm[PSM_PSMT8].bpp = 8; - m_psm[PSM_PSMT4].bpp = 4; - m_psm[PSM_PSMZ16].bpp = m_psm[PSM_PSMZ16S].bpp = 16; + m_psm[PSGPU24].bpp = 16; + m_psm[PSMCT16].bpp = m_psm[PSMCT16S].bpp = 16; + m_psm[PSMT8].bpp = 8; + m_psm[PSMT4].bpp = 4; + m_psm[PSMZ16].bpp = m_psm[PSMZ16S].bpp = 16; - m_psm[PSM_PSMCT24].trbpp = 24; - m_psm[PSM_PSGPU24].trbpp = 16; - m_psm[PSM_PSMCT16].trbpp = m_psm[PSM_PSMCT16S].trbpp = 16; - m_psm[PSM_PSMT8].trbpp = m_psm[PSM_PSMT8H].trbpp = 8; - m_psm[PSM_PSMT4].trbpp = m_psm[PSM_PSMT4HL].trbpp = m_psm[PSM_PSMT4HH].trbpp = 4; - m_psm[PSM_PSMZ24].trbpp = 24; - m_psm[PSM_PSMZ16].trbpp = m_psm[PSM_PSMZ16S].trbpp = 16; + m_psm[PSMCT24].trbpp = 24; + m_psm[PSGPU24].trbpp = 16; + m_psm[PSMCT16].trbpp = m_psm[PSMCT16S].trbpp = 16; + m_psm[PSMT8].trbpp = m_psm[PSMT8H].trbpp = 8; + m_psm[PSMT4].trbpp = m_psm[PSMT4HL].trbpp = m_psm[PSMT4HH].trbpp = 4; + m_psm[PSMZ24].trbpp = 24; + m_psm[PSMZ16].trbpp = m_psm[PSMZ16S].trbpp = 16; - m_psm[PSM_PSMT8].pal = m_psm[PSM_PSMT8H].pal = 256; - m_psm[PSM_PSMT4].pal = m_psm[PSM_PSMT4HL].pal = m_psm[PSM_PSMT4HH].pal = 16; + m_psm[PSMT8].pal = m_psm[PSMT8H].pal = 256; + m_psm[PSMT4].pal = m_psm[PSMT4HL].pal = m_psm[PSMT4HH].pal = 16; for (psm_t& psm : m_psm) psm.fmt = 3; - m_psm[PSM_PSMCT32].fmt = m_psm[PSM_PSMZ32].fmt = 0; - m_psm[PSM_PSMCT24].fmt = m_psm[PSM_PSMZ24].fmt = 1; - m_psm[PSM_PSMCT16].fmt = m_psm[PSM_PSMZ16].fmt = 2; - m_psm[PSM_PSMCT16S].fmt = m_psm[PSM_PSMZ16S].fmt = 2; + m_psm[PSMCT32].fmt = m_psm[PSMZ32].fmt = 0; + m_psm[PSMCT24].fmt = m_psm[PSMZ24].fmt = 1; + m_psm[PSMCT16].fmt = m_psm[PSMZ16].fmt = 2; + m_psm[PSMCT16S].fmt = m_psm[PSMZ16S].fmt = 2; - m_psm[PSM_PSGPU24].bs = GSVector2i(16, 8); - m_psm[PSM_PSMCT16].bs = m_psm[PSM_PSMCT16S].bs = GSVector2i(16, 8); - m_psm[PSM_PSMT8].bs = GSVector2i(16, 16); - m_psm[PSM_PSMT4].bs = GSVector2i(32, 16); - m_psm[PSM_PSMZ16].bs = m_psm[PSM_PSMZ16S].bs = GSVector2i(16, 8); + m_psm[PSGPU24].bs = GSVector2i(16, 8); + m_psm[PSMCT16].bs = m_psm[PSMCT16S].bs = GSVector2i(16, 8); + m_psm[PSMT8].bs = GSVector2i(16, 16); + m_psm[PSMT4].bs = GSVector2i(32, 16); + m_psm[PSMZ16].bs = m_psm[PSMZ16S].bs = GSVector2i(16, 8); - m_psm[PSM_PSGPU24].pgs = GSVector2i(64, 64); - m_psm[PSM_PSMCT16].pgs = m_psm[PSM_PSMCT16S].pgs = GSVector2i(64, 64); - m_psm[PSM_PSMT8].pgs = GSVector2i(128, 64); - m_psm[PSM_PSMT4].pgs = GSVector2i(128, 128); - m_psm[PSM_PSMZ16].pgs = m_psm[PSM_PSMZ16S].pgs = GSVector2i(64, 64); + m_psm[PSGPU24].pgs = GSVector2i(64, 64); + m_psm[PSMCT16].pgs = m_psm[PSMCT16S].pgs = GSVector2i(64, 64); + m_psm[PSMT8].pgs = GSVector2i(128, 64); + m_psm[PSMT4].pgs = GSVector2i(128, 128); + m_psm[PSMZ16].pgs = m_psm[PSMZ16S].pgs = GSVector2i(64, 64); - m_psm[PSM_PSMCT24].msk = 0x3f; - m_psm[PSM_PSMZ24].msk = 0x3f; - m_psm[PSM_PSMT8H].msk = 0xc0; - m_psm[PSM_PSMT4HL].msk = 0x40; - m_psm[PSM_PSMT4HH].msk = 0x80; + m_psm[PSMCT24].msk = 0x3f; + m_psm[PSMZ24].msk = 0x3f; + m_psm[PSMT8H].msk = 0xc0; + m_psm[PSMT4HL].msk = 0x40; + m_psm[PSMT4HH].msk = 0x80; - m_psm[PSM_PSMZ32].depth = 1; - m_psm[PSM_PSMZ24].depth = 1; - m_psm[PSM_PSMZ16].depth = 1; - m_psm[PSM_PSMZ16S].depth = 1; + m_psm[PSMZ32].depth = 1; + m_psm[PSMZ24].depth = 1; + m_psm[PSMZ16].depth = 1; + m_psm[PSMZ16S].depth = 1; - m_psm[PSM_PSMCT24].fmsk = 0x00FFFFFF; - m_psm[PSM_PSGPU24].fmsk = 0x00FFFFFF; - m_psm[PSM_PSMCT16].fmsk = 0x80F8F8F8; - m_psm[PSM_PSMCT16S].fmsk = 0x80F8F8F8; - m_psm[PSM_PSMT8H].fmsk = 0xFF000000; - m_psm[PSM_PSMT4HL].fmsk = 0x0F000000; - m_psm[PSM_PSMT4HH].fmsk = 0xF0000000; - m_psm[PSM_PSMZ24].fmsk = 0x00FFFFFF; - m_psm[PSM_PSMZ16].fmsk = 0x80F8F8F8; - m_psm[PSM_PSMZ16S].fmsk = 0x80F8F8F8; + m_psm[PSMCT24].fmsk = 0x00FFFFFF; + m_psm[PSGPU24].fmsk = 0x00FFFFFF; + m_psm[PSMCT16].fmsk = 0x80F8F8F8; + m_psm[PSMCT16S].fmsk = 0x80F8F8F8; + m_psm[PSMT8H].fmsk = 0xFF000000; + m_psm[PSMT4HL].fmsk = 0x0F000000; + m_psm[PSMT4HH].fmsk = 0xF0000000; + m_psm[PSMZ24].fmsk = 0x00FFFFFF; + m_psm[PSMZ16].fmsk = 0x80F8F8F8; + m_psm[PSMZ16S].fmsk = 0x80F8F8F8; } GSLocalMemory::~GSLocalMemory() diff --git a/pcsx2/GS/GSLocalMemory.h b/pcsx2/GS/GSLocalMemory.h index 162e0a33ef..711a00ad7b 100644 --- a/pcsx2/GS/GSLocalMemory.h +++ b/pcsx2/GS/GSLocalMemory.h @@ -1140,20 +1140,20 @@ constexpr inline GSOffset GSOffset::fromKnownPSM(u32 bp, u32 bw, GS_PSM psm) { switch (psm) { - case PSM_PSMCT32: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); - case PSM_PSMCT24: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); - case PSM_PSMCT16: return GSOffset(GSLocalMemory::swizzle16, bp, bw, psm); - case PSM_PSMCT16S: return GSOffset(GSLocalMemory::swizzle16S, bp, bw, psm); - case PSM_PSGPU24: return GSOffset(GSLocalMemory::swizzle16, bp, bw, psm); - case PSM_PSMT8: return GSOffset(GSLocalMemory::swizzle8, bp, bw, psm); - case PSM_PSMT4: return GSOffset(GSLocalMemory::swizzle4, bp, bw, psm); - case PSM_PSMT8H: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); - case PSM_PSMT4HL: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); - case PSM_PSMT4HH: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); - case PSM_PSMZ32: return GSOffset(GSLocalMemory::swizzle32Z, bp, bw, psm); - case PSM_PSMZ24: return GSOffset(GSLocalMemory::swizzle32Z, bp, bw, psm); - case PSM_PSMZ16: return GSOffset(GSLocalMemory::swizzle16Z, bp, bw, psm); - case PSM_PSMZ16S: return GSOffset(GSLocalMemory::swizzle16SZ, bp, bw, psm); + case PSMCT32: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); + case PSMCT24: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); + case PSMCT16: return GSOffset(GSLocalMemory::swizzle16, bp, bw, psm); + case PSMCT16S: return GSOffset(GSLocalMemory::swizzle16S, bp, bw, psm); + case PSGPU24: return GSOffset(GSLocalMemory::swizzle16, bp, bw, psm); + case PSMT8: return GSOffset(GSLocalMemory::swizzle8, bp, bw, psm); + case PSMT4: return GSOffset(GSLocalMemory::swizzle4, bp, bw, psm); + case PSMT8H: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); + case PSMT4HL: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); + case PSMT4HH: return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); + case PSMZ32: return GSOffset(GSLocalMemory::swizzle32Z, bp, bw, psm); + case PSMZ24: return GSOffset(GSLocalMemory::swizzle32Z, bp, bw, psm); + case PSMZ16: return GSOffset(GSLocalMemory::swizzle16Z, bp, bw, psm); + case PSMZ16S: return GSOffset(GSLocalMemory::swizzle16SZ, bp, bw, psm); } return GSOffset(GSLocalMemory::swizzle32, bp, bw, psm); } diff --git a/pcsx2/GS/GSLocalMemoryMultiISA.cpp b/pcsx2/GS/GSLocalMemoryMultiISA.cpp index 5469df06c6..f70e96cd1b 100644 --- a/pcsx2/GS/GSLocalMemoryMultiISA.cpp +++ b/pcsx2/GS/GSLocalMemoryMultiISA.cpp @@ -105,7 +105,7 @@ void GSLocalMemoryFunctions::PopulateFunctions(GSLocalMemory& mem) for (GSLocalMemory::psm_t& psm : mem.m_psm) { - psm.wi = WriteImage; + psm.wi = WriteImage; psm.ri = ReadImageX; // TODO psm.rtx = ReadTexture32; psm.rtxP = ReadTexture32; @@ -113,79 +113,79 @@ void GSLocalMemoryFunctions::PopulateFunctions(GSLocalMemory& mem) psm.rtxbP = ReadTextureBlock32; } - mem.m_psm[PSM_PSMCT24].wi = WriteImage24; // TODO - mem.m_psm[PSM_PSMCT16].wi = WriteImage; - mem.m_psm[PSM_PSMCT16S].wi = WriteImage; - mem.m_psm[PSM_PSMT8].wi = WriteImage; - mem.m_psm[PSM_PSMT4].wi = WriteImage; - mem.m_psm[PSM_PSMT8H].wi = WriteImage8H; // TODO - mem.m_psm[PSM_PSMT4HL].wi = WriteImage4HL; // TODO - mem.m_psm[PSM_PSMT4HH].wi = WriteImage4HH; // TODO - mem.m_psm[PSM_PSMZ32].wi = WriteImage; - mem.m_psm[PSM_PSMZ24].wi = WriteImage24Z; // TODO - mem.m_psm[PSM_PSMZ16].wi = WriteImage; - mem.m_psm[PSM_PSMZ16S].wi = WriteImage; + mem.m_psm[PSMCT24].wi = WriteImage24; // TODO + mem.m_psm[PSMCT16].wi = WriteImage; + mem.m_psm[PSMCT16S].wi = WriteImage; + mem.m_psm[PSMT8].wi = WriteImage; + mem.m_psm[PSMT4].wi = WriteImage; + mem.m_psm[PSMT8H].wi = WriteImage8H; // TODO + mem.m_psm[PSMT4HL].wi = WriteImage4HL; // TODO + mem.m_psm[PSMT4HH].wi = WriteImage4HH; // TODO + mem.m_psm[PSMZ32].wi = WriteImage; + mem.m_psm[PSMZ24].wi = WriteImage24Z; // TODO + mem.m_psm[PSMZ16].wi = WriteImage; + mem.m_psm[PSMZ16S].wi = WriteImage; - mem.m_psm[PSM_PSMCT24].rtx = ReadTexture24; - mem.m_psm[PSM_PSGPU24].rtx = ReadTextureGPU24; - mem.m_psm[PSM_PSMCT16].rtx = ReadTexture16; - mem.m_psm[PSM_PSMCT16S].rtx = ReadTexture16; - mem.m_psm[PSM_PSMT8].rtx = ReadTexture8; - mem.m_psm[PSM_PSMT4].rtx = ReadTexture4; - mem.m_psm[PSM_PSMT8H].rtx = ReadTexture8H; - mem.m_psm[PSM_PSMT4HL].rtx = ReadTexture4HL; - mem.m_psm[PSM_PSMT4HH].rtx = ReadTexture4HH; - mem.m_psm[PSM_PSMZ32].rtx = ReadTexture32; - mem.m_psm[PSM_PSMZ24].rtx = ReadTexture24; - mem.m_psm[PSM_PSMZ16].rtx = ReadTexture16; - mem.m_psm[PSM_PSMZ16S].rtx = ReadTexture16; + mem.m_psm[PSMCT24].rtx = ReadTexture24; + mem.m_psm[PSGPU24].rtx = ReadTextureGPU24; + mem.m_psm[PSMCT16].rtx = ReadTexture16; + mem.m_psm[PSMCT16S].rtx = ReadTexture16; + mem.m_psm[PSMT8].rtx = ReadTexture8; + mem.m_psm[PSMT4].rtx = ReadTexture4; + mem.m_psm[PSMT8H].rtx = ReadTexture8H; + mem.m_psm[PSMT4HL].rtx = ReadTexture4HL; + mem.m_psm[PSMT4HH].rtx = ReadTexture4HH; + mem.m_psm[PSMZ32].rtx = ReadTexture32; + mem.m_psm[PSMZ24].rtx = ReadTexture24; + mem.m_psm[PSMZ16].rtx = ReadTexture16; + mem.m_psm[PSMZ16S].rtx = ReadTexture16; - mem.m_psm[PSM_PSMCT24].rtxP = ReadTexture24; - mem.m_psm[PSM_PSMCT16].rtxP = ReadTexture16; - mem.m_psm[PSM_PSMCT16S].rtxP = ReadTexture16; - mem.m_psm[PSM_PSMT8].rtxP = ReadTexture8P; - mem.m_psm[PSM_PSMT4].rtxP = ReadTexture4P; - mem.m_psm[PSM_PSMT8H].rtxP = ReadTexture8HP; - mem.m_psm[PSM_PSMT4HL].rtxP = ReadTexture4HLP; - mem.m_psm[PSM_PSMT4HH].rtxP = ReadTexture4HHP; - mem.m_psm[PSM_PSMZ32].rtxP = ReadTexture32; - mem.m_psm[PSM_PSMZ24].rtxP = ReadTexture24; - mem.m_psm[PSM_PSMZ16].rtxP = ReadTexture16; - mem.m_psm[PSM_PSMZ16S].rtxP = ReadTexture16; + mem.m_psm[PSMCT24].rtxP = ReadTexture24; + mem.m_psm[PSMCT16].rtxP = ReadTexture16; + mem.m_psm[PSMCT16S].rtxP = ReadTexture16; + mem.m_psm[PSMT8].rtxP = ReadTexture8P; + mem.m_psm[PSMT4].rtxP = ReadTexture4P; + mem.m_psm[PSMT8H].rtxP = ReadTexture8HP; + mem.m_psm[PSMT4HL].rtxP = ReadTexture4HLP; + mem.m_psm[PSMT4HH].rtxP = ReadTexture4HHP; + mem.m_psm[PSMZ32].rtxP = ReadTexture32; + mem.m_psm[PSMZ24].rtxP = ReadTexture24; + mem.m_psm[PSMZ16].rtxP = ReadTexture16; + mem.m_psm[PSMZ16S].rtxP = ReadTexture16; - mem.m_psm[PSM_PSMCT24].rtxb = ReadTextureBlock24; - mem.m_psm[PSM_PSMCT16].rtxb = ReadTextureBlock16; - mem.m_psm[PSM_PSMCT16S].rtxb = ReadTextureBlock16; - mem.m_psm[PSM_PSMT8].rtxb = ReadTextureBlock8; - mem.m_psm[PSM_PSMT4].rtxb = ReadTextureBlock4; - mem.m_psm[PSM_PSMT8H].rtxb = ReadTextureBlock8H; - mem.m_psm[PSM_PSMT4HL].rtxb = ReadTextureBlock4HL; - mem.m_psm[PSM_PSMT4HH].rtxb = ReadTextureBlock4HH; - mem.m_psm[PSM_PSMZ32].rtxb = ReadTextureBlock32; - mem.m_psm[PSM_PSMZ24].rtxb = ReadTextureBlock24; - mem.m_psm[PSM_PSMZ16].rtxb = ReadTextureBlock16; - mem.m_psm[PSM_PSMZ16S].rtxb = ReadTextureBlock16; + mem.m_psm[PSMCT24].rtxb = ReadTextureBlock24; + mem.m_psm[PSMCT16].rtxb = ReadTextureBlock16; + mem.m_psm[PSMCT16S].rtxb = ReadTextureBlock16; + mem.m_psm[PSMT8].rtxb = ReadTextureBlock8; + mem.m_psm[PSMT4].rtxb = ReadTextureBlock4; + mem.m_psm[PSMT8H].rtxb = ReadTextureBlock8H; + mem.m_psm[PSMT4HL].rtxb = ReadTextureBlock4HL; + mem.m_psm[PSMT4HH].rtxb = ReadTextureBlock4HH; + mem.m_psm[PSMZ32].rtxb = ReadTextureBlock32; + mem.m_psm[PSMZ24].rtxb = ReadTextureBlock24; + mem.m_psm[PSMZ16].rtxb = ReadTextureBlock16; + mem.m_psm[PSMZ16S].rtxb = ReadTextureBlock16; - mem.m_psm[PSM_PSMCT24].rtxbP = ReadTextureBlock24; - mem.m_psm[PSM_PSMCT16].rtxbP = ReadTextureBlock16; - mem.m_psm[PSM_PSMCT16S].rtxbP = ReadTextureBlock16; - mem.m_psm[PSM_PSMT8].rtxbP = ReadTextureBlock8P; - mem.m_psm[PSM_PSMT4].rtxbP = ReadTextureBlock4P; - mem.m_psm[PSM_PSMT8H].rtxbP = ReadTextureBlock8HP; - mem.m_psm[PSM_PSMT4HL].rtxbP = ReadTextureBlock4HLP; - mem.m_psm[PSM_PSMT4HH].rtxbP = ReadTextureBlock4HHP; - mem.m_psm[PSM_PSMZ32].rtxbP = ReadTextureBlock32; - mem.m_psm[PSM_PSMZ24].rtxbP = ReadTextureBlock24; - mem.m_psm[PSM_PSMZ16].rtxbP = ReadTextureBlock16; - mem.m_psm[PSM_PSMZ16S].rtxbP = ReadTextureBlock16; + mem.m_psm[PSMCT24].rtxbP = ReadTextureBlock24; + mem.m_psm[PSMCT16].rtxbP = ReadTextureBlock16; + mem.m_psm[PSMCT16S].rtxbP = ReadTextureBlock16; + mem.m_psm[PSMT8].rtxbP = ReadTextureBlock8P; + mem.m_psm[PSMT4].rtxbP = ReadTextureBlock4P; + mem.m_psm[PSMT8H].rtxbP = ReadTextureBlock8HP; + mem.m_psm[PSMT4HL].rtxbP = ReadTextureBlock4HLP; + mem.m_psm[PSMT4HH].rtxbP = ReadTextureBlock4HHP; + mem.m_psm[PSMZ32].rtxbP = ReadTextureBlock32; + mem.m_psm[PSMZ24].rtxbP = ReadTextureBlock24; + mem.m_psm[PSMZ16].rtxbP = ReadTextureBlock16; + mem.m_psm[PSMZ16S].rtxbP = ReadTextureBlock16; #if _M_SSE == 0x501 if (g_cpu.hasSlowGather) { - mem.m_psm[PSM_PSMT8].rtx = ReadTexture8HSW; - mem.m_psm[PSM_PSMT8H].rtx = ReadTexture8HHSW; - mem.m_psm[PSM_PSMT8].rtxb = ReadTextureBlock8HSW; - mem.m_psm[PSM_PSMT8H].rtxb = ReadTextureBlock8HHSW; + mem.m_psm[PSMT8].rtx = ReadTexture8HSW; + mem.m_psm[PSMT8H].rtx = ReadTexture8HHSW; + mem.m_psm[PSMT8].rtxb = ReadTextureBlock8HSW; + mem.m_psm[PSMT8H].rtxb = ReadTextureBlock8HHSW; } #endif } @@ -226,14 +226,14 @@ void GSLocalMemoryFunctions::WriteImageColumn(GSLocalMemory& mem, int l, int r, { switch (psm) { - case PSM_PSMCT32: GSBlock::WriteColumn32(y, mem.BlockPtr32(x, y, bp, bw), &src[x * 4], srcpitch); break; - case PSM_PSMCT16: GSBlock::WriteColumn16(y, mem.BlockPtr16(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMCT16S: GSBlock::WriteColumn16(y, mem.BlockPtr16S(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMT8: GSBlock::WriteColumn8(y, mem.BlockPtr8(x, y, bp, bw), &src[x], srcpitch); break; - case PSM_PSMT4: GSBlock::WriteColumn4(y, mem.BlockPtr4(x, y, bp, bw), &src[x >> 1], srcpitch); break; - case PSM_PSMZ32: GSBlock::WriteColumn32(y, mem.BlockPtr32Z(x, y, bp, bw), &src[x * 4], srcpitch); break; - case PSM_PSMZ16: GSBlock::WriteColumn16(y, mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMZ16S: GSBlock::WriteColumn16(y, mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMCT32: GSBlock::WriteColumn32(y, mem.BlockPtr32(x, y, bp, bw), &src[x * 4], srcpitch); break; + case PSMCT16: GSBlock::WriteColumn16(y, mem.BlockPtr16(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMCT16S: GSBlock::WriteColumn16(y, mem.BlockPtr16S(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMT8: GSBlock::WriteColumn8(y, mem.BlockPtr8(x, y, bp, bw), &src[x], srcpitch); break; + case PSMT4: GSBlock::WriteColumn4(y, mem.BlockPtr4(x, y, bp, bw), &src[x >> 1], srcpitch); break; + case PSMZ32: GSBlock::WriteColumn32(y, mem.BlockPtr32Z(x, y, bp, bw), &src[x * 4], srcpitch); break; + case PSMZ16: GSBlock::WriteColumn16(y, mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMZ16S: GSBlock::WriteColumn16(y, mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; // TODO default: __assume(0); } @@ -253,14 +253,14 @@ void GSLocalMemoryFunctions::WriteImageBlock(GSLocalMemory& mem, int l, int r, i { switch (psm) { - case PSM_PSMCT32: GSBlock::WriteBlock32(mem.BlockPtr32(x, y, bp, bw), &src[x * 4], srcpitch); break; - case PSM_PSMCT16: GSBlock::WriteBlock16(mem.BlockPtr16(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMCT16S: GSBlock::WriteBlock16(mem.BlockPtr16S(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMT8: GSBlock::WriteBlock8(mem.BlockPtr8(x, y, bp, bw), &src[x], srcpitch); break; - case PSM_PSMT4: GSBlock::WriteBlock4(mem.BlockPtr4(x, y, bp, bw), &src[x >> 1], srcpitch); break; - case PSM_PSMZ32: GSBlock::WriteBlock32(mem.BlockPtr32Z(x, y, bp, bw), &src[x * 4], srcpitch); break; - case PSM_PSMZ16: GSBlock::WriteBlock16(mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; - case PSM_PSMZ16S: GSBlock::WriteBlock16(mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMCT32: GSBlock::WriteBlock32(mem.BlockPtr32(x, y, bp, bw), &src[x * 4], srcpitch); break; + case PSMCT16: GSBlock::WriteBlock16(mem.BlockPtr16(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMCT16S: GSBlock::WriteBlock16(mem.BlockPtr16S(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMT8: GSBlock::WriteBlock8(mem.BlockPtr8(x, y, bp, bw), &src[x], srcpitch); break; + case PSMT4: GSBlock::WriteBlock4(mem.BlockPtr4(x, y, bp, bw), &src[x >> 1], srcpitch); break; + case PSMZ32: GSBlock::WriteBlock32(mem.BlockPtr32Z(x, y, bp, bw), &src[x * 4], srcpitch); break; + case PSMZ16: GSBlock::WriteBlock16(mem.BlockPtr16Z(x, y, bp, bw), &src[x * 2], srcpitch); break; + case PSMZ16S: GSBlock::WriteBlock16(mem.BlockPtr16SZ(x, y, bp, bw), &src[x * 2], srcpitch); break; // TODO default: __assume(0); } @@ -280,14 +280,14 @@ void GSLocalMemoryFunctions::WriteImageLeftRight(GSLocalMemory& mem, int l, int { switch (psm) { - case PSM_PSMCT32: mem.WritePixel32(x, y, *(u32*)&src[x * 4], bp, bw); break; - case PSM_PSMCT16: mem.WritePixel16(x, y, *(u16*)&src[x * 2], bp, bw); break; - case PSM_PSMCT16S: mem.WritePixel16S(x, y, *(u16*)&src[x * 2], bp, bw); break; - case PSM_PSMT8: mem.WritePixel8(x, y, src[x], bp, bw); break; - case PSM_PSMT4: mem.WritePixel4(x, y, src[x >> 1] >> ((x & 1) << 2), bp, bw); break; - case PSM_PSMZ32: mem.WritePixel32Z(x, y, *(u32*)&src[x * 4], bp, bw); break; - case PSM_PSMZ16: mem.WritePixel16Z(x, y, *(u16*)&src[x * 2], bp, bw); break; - case PSM_PSMZ16S: mem.WritePixel16SZ(x, y, *(u16*)&src[x * 2], bp, bw); break; + case PSMCT32: mem.WritePixel32(x, y, *(u32*)&src[x * 4], bp, bw); break; + case PSMCT16: mem.WritePixel16(x, y, *(u16*)&src[x * 2], bp, bw); break; + case PSMCT16S: mem.WritePixel16S(x, y, *(u16*)&src[x * 2], bp, bw); break; + case PSMT8: mem.WritePixel8(x, y, src[x], bp, bw); break; + case PSMT4: mem.WritePixel4(x, y, src[x >> 1] >> ((x & 1) << 2), bp, bw); break; + case PSMZ32: mem.WritePixel32Z(x, y, *(u32*)&src[x * 4], bp, bw); break; + case PSMZ16: mem.WritePixel16Z(x, y, *(u16*)&src[x * 2], bp, bw); break; + case PSMZ16S: mem.WritePixel16SZ(x, y, *(u16*)&src[x * 2], bp, bw); break; // TODO default: __assume(0); } @@ -319,41 +319,41 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int switch (psm) { - case PSM_PSMCT32: dst = mem.BlockPtr32(x, y, bp, bw); break; - case PSM_PSMCT16: dst = mem.BlockPtr16(x, y, bp, bw); break; - case PSM_PSMCT16S: dst = mem.BlockPtr16S(x, y, bp, bw); break; - case PSM_PSMT8: dst = mem.BlockPtr8(x, y, bp, bw); break; - case PSM_PSMT4: dst = mem.BlockPtr4(x, y, bp, bw); break; - case PSM_PSMZ32: dst = mem.BlockPtr32Z(x, y, bp, bw); break; - case PSM_PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; - case PSM_PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; + case PSMCT32: dst = mem.BlockPtr32(x, y, bp, bw); break; + case PSMCT16: dst = mem.BlockPtr16(x, y, bp, bw); break; + case PSMCT16S: dst = mem.BlockPtr16S(x, y, bp, bw); break; + case PSMT8: dst = mem.BlockPtr8(x, y, bp, bw); break; + case PSMT4: dst = mem.BlockPtr4(x, y, bp, bw); break; + case PSMZ32: dst = mem.BlockPtr32Z(x, y, bp, bw); break; + case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; + case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; // TODO default: __assume(0); } switch (psm) { - case PSM_PSMCT32: - case PSM_PSMZ32: + case PSMCT32: + case PSMZ32: GSBlock::ReadColumn32(y, dst, buff, 32); memcpy(&buff[32], &src[x * 4], 32); GSBlock::WriteColumn32<32, 0xffffffff>(y, dst, buff, 32); break; - case PSM_PSMCT16: - case PSM_PSMCT16S: - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMCT16: + case PSMCT16S: + case PSMZ16: + case PSMZ16S: GSBlock::ReadColumn16(y, dst, buff, 32); memcpy(&buff[32], &src[x * 2], 32); GSBlock::WriteColumn16<32>(y, dst, buff, 32); break; - case PSM_PSMT8: + case PSMT8: GSBlock::ReadColumn8(y, dst, buff, 16); for (int i = 0, j = y2; i < h2; i++, j++) memcpy(&buff[j * 16], &src[i * srcpitch + x], 16); GSBlock::WriteColumn8<32>(y, dst, buff, 16); break; - case PSM_PSMT4: + case PSMT4: GSBlock::ReadColumn4(y, dst, buff, 16); for (int i = 0, j = y2; i < h2; i++, j++) memcpy(&buff[j * 16], &src[i * srcpitch + (x >> 1)], 16); @@ -412,41 +412,41 @@ void GSLocalMemoryFunctions::WriteImageTopBottom(GSLocalMemory& mem, int l, int switch (psm) { - case PSM_PSMCT32: dst = mem.BlockPtr32(x, y, bp, bw); break; - case PSM_PSMCT16: dst = mem.BlockPtr16(x, y, bp, bw); break; - case PSM_PSMCT16S: dst = mem.BlockPtr16S(x, y, bp, bw); break; - case PSM_PSMT8: dst = mem.BlockPtr8(x, y, bp, bw); break; - case PSM_PSMT4: dst = mem.BlockPtr4(x, y, bp, bw); break; - case PSM_PSMZ32: dst = mem.BlockPtr32Z(x, y, bp, bw); break; - case PSM_PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; - case PSM_PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; + case PSMCT32: dst = mem.BlockPtr32(x, y, bp, bw); break; + case PSMCT16: dst = mem.BlockPtr16(x, y, bp, bw); break; + case PSMCT16S: dst = mem.BlockPtr16S(x, y, bp, bw); break; + case PSMT8: dst = mem.BlockPtr8(x, y, bp, bw); break; + case PSMT4: dst = mem.BlockPtr4(x, y, bp, bw); break; + case PSMZ32: dst = mem.BlockPtr32Z(x, y, bp, bw); break; + case PSMZ16: dst = mem.BlockPtr16Z(x, y, bp, bw); break; + case PSMZ16S: dst = mem.BlockPtr16SZ(x, y, bp, bw); break; // TODO default: __assume(0); } switch (psm) { - case PSM_PSMCT32: - case PSM_PSMZ32: + case PSMCT32: + case PSMZ32: GSBlock::ReadColumn32(y, dst, buff, 32); memcpy(&buff[0], &src[x * 4], 32); GSBlock::WriteColumn32<32, 0xffffffff>(y, dst, buff, 32); break; - case PSM_PSMCT16: - case PSM_PSMCT16S: - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMCT16: + case PSMCT16S: + case PSMZ16: + case PSMZ16S: GSBlock::ReadColumn16(y, dst, buff, 32); memcpy(&buff[0], &src[x * 2], 32); GSBlock::WriteColumn16<32>(y, dst, buff, 32); break; - case PSM_PSMT8: + case PSMT8: GSBlock::ReadColumn8(y, dst, buff, 16); for (int i = 0; i < h; i++) memcpy(&buff[i * 16], &src[i * srcpitch + x], 16); GSBlock::WriteColumn8<32>(y, dst, buff, 16); break; - case PSM_PSMT4: + case PSMT4: GSBlock::ReadColumn4(y, dst, buff, 16); for (int i = 0; i < h; i++) memcpy(&buff[i * 16], &src[i * srcpitch + (x >> 1)], 16); @@ -855,8 +855,8 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c switch (BITBLTBUF.DPSM) { - case PSM_PSMCT32: - case PSM_PSMZ32: + case PSMCT32: + case PSMZ32: readWriteHelper(mem.vm32(), tx, ty, len / 4, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle32), [&](auto& pa, int x) { *pa.value(x) = *pd; @@ -864,8 +864,8 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c }); break; - case PSM_PSMCT24: - case PSM_PSMZ24: + case PSMCT24: + case PSMZ24: readWriteHelper(mem.vm32(), tx, ty, len / 3, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle32), [&](auto& pa, int x) { mem.WritePixel24(pa.value(x), *(u32*)pb); @@ -873,10 +873,10 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c }); break; - case PSM_PSMCT16: - case PSM_PSMCT16S: - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMCT16: + case PSMCT16S: + case PSMZ16: + case PSMZ16S: readWriteHelper(mem.vm16(), tx, ty, len / 2, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle16), [&](auto& pa, int x) { *pa.value(x) = *pw; @@ -884,16 +884,16 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c }); break; - case PSM_PSMT8: - readWriteHelper(mem.m_vm8, tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT8), [&](auto& pa, int x) + case PSMT8: + readWriteHelper(mem.m_vm8, tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT8), [&](auto& pa, int x) { *pa.value(x) = *pb; pb++; }); break; - case PSM_PSMT4: - readWriteHelper(tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4), [&](GSOffset::PAHelper& pa, int x) + case PSMT4: + readWriteHelper(tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4), [&](GSOffset::PAHelper& pa, int x) { mem.WritePixel4(pa.value(x), *pb & 0xf); mem.WritePixel4(pa.value(x + 1), *pb >> 4); @@ -901,16 +901,16 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c }); break; - case PSM_PSMT8H: - readWriteHelper(mem.vm32(), tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT8H), [&](auto& pa, int x) + case PSMT8H: + readWriteHelper(mem.vm32(), tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT8H), [&](auto& pa, int x) { mem.WritePixel8H(pa.value(x), *pb); pb++; }); break; - case PSM_PSMT4HL: - readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4HL), [&](auto& pa, int x) + case PSMT4HL: + readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4HL), [&](auto& pa, int x) { mem.WritePixel4HL(pa.value(x), *pb & 0xf); mem.WritePixel4HL(pa.value(x + 1), *pb >> 4); @@ -918,8 +918,8 @@ void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, c }); break; - case PSM_PSMT4HH: - readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4HH), [&](auto& pa, int x) + case PSMT4HH: + readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4HH), [&](auto& pa, int x) { mem.WritePixel4HH(pa.value(x), *pb & 0xf); mem.WritePixel4HH(pa.value(x + 1), *pb >> 4); @@ -952,8 +952,8 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& switch (BITBLTBUF.SPSM) { - case PSM_PSMCT32: - case PSM_PSMZ32: + case PSMCT32: + case PSMZ32: { // MGS1 intro, fade effect between two scenes (airplane outside-inside transition) @@ -1003,8 +1003,8 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& } break; - case PSM_PSMCT24: - case PSM_PSMZ24: + case PSMCT24: + case PSMZ24: { const int length = len / 3; const int aligned_length = (len + 2) / 3; @@ -1022,10 +1022,10 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& }); break; } - case PSM_PSMCT16: - case PSM_PSMCT16S: - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMCT16: + case PSMCT16S: + case PSMZ16: + case PSMZ16S: readWriteHelper(mem.vm16(), tx, ty, len / 2, 1, sx, w, off.assertSizesMatch(GSLocalMemory::swizzle16), [&](auto& pa, int x) { *pw = *pa.value(x); @@ -1033,16 +1033,16 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& }); break; - case PSM_PSMT8: - readWriteHelper(mem.m_vm8, tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT8), [&](auto& pa, int x) + case PSMT8: + readWriteHelper(mem.m_vm8, tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT8), [&](auto& pa, int x) { *pb = *pa.value(x); pb++; }); break; - case PSM_PSMT4: - readWriteHelper(tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4), [&](GSOffset::PAHelper& pa, int x) + case PSMT4: + readWriteHelper(tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4), [&](GSOffset::PAHelper& pa, int x) { u8 low = mem.ReadPixel4(pa.value(x)); u8 high = mem.ReadPixel4(pa.value(x + 1)); @@ -1050,16 +1050,16 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& }); break; - case PSM_PSMT8H: - readWriteHelper(mem.vm32(), tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT8H), [&](auto& pa, int x) + case PSMT8H: + readWriteHelper(mem.vm32(), tx, ty, len, 1, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT8H), [&](auto& pa, int x) { *pb = (u8)(*pa.value(x) >> 24); pb++; }); break; - case PSM_PSMT4HL: - readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4HL), [&](auto& pa, int x) + case PSMT4HL: + readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4HL), [&](auto& pa, int x) { u32 c0 = *pa.value(x) >> 24 & 0x0f; u32 c1 = *pa.value(x + 1) >> 20 & 0xf0; @@ -1068,8 +1068,8 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int& }); break; - case PSM_PSMT4HH: - readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSM_PSMT4HH), [&](auto& pa, int x) + case PSMT4HH: + readWriteHelper(mem.vm32(), tx, ty, len * 2, 2, sx, w, GSOffset::fromKnownPSM(bp, bw, PSMT4HH), [&](auto& pa, int x) { u32 c0 = *pa.value(x) >> 28 & 0x0f; u32 c1 = *pa.value(x + 1) >> 24 & 0xf0; diff --git a/pcsx2/GS/GSRegs.h b/pcsx2/GS/GSRegs.h index 163063fa2e..073e4751e1 100644 --- a/pcsx2/GS/GSRegs.h +++ b/pcsx2/GS/GSRegs.h @@ -158,20 +158,20 @@ enum GIF_FLG enum GS_PSM { - PSM_PSMCT32 = 0, // 0000-0000 - PSM_PSMCT24 = 1, // 0000-0001 - PSM_PSMCT16 = 2, // 0000-0010 - PSM_PSMCT16S = 10, // 0000-1010 - PSM_PSGPU24 = 18, // 0001-0010 - PSM_PSMT8 = 19, // 0001-0011 - PSM_PSMT4 = 20, // 0001-0100 - PSM_PSMT8H = 27, // 0001-1011 - PSM_PSMT4HL = 36, // 0010-0100 - PSM_PSMT4HH = 44, // 0010-1100 - PSM_PSMZ32 = 48, // 0011-0000 - PSM_PSMZ24 = 49, // 0011-0001 - PSM_PSMZ16 = 50, // 0011-0010 - PSM_PSMZ16S = 58, // 0011-1010 + PSMCT32 = 0, // 0000-0000 + PSMCT24 = 1, // 0000-0001 + PSMCT16 = 2, // 0000-0010 + PSMCT16S = 10, // 0000-1010 + PSGPU24 = 18, // 0001-0010 + PSMT8 = 19, // 0001-0011 + PSMT4 = 20, // 0001-0100 + PSMT8H = 27, // 0001-1011 + PSMT4HL = 36, // 0010-0100 + PSMT4HH = 44, // 0010-1100 + PSMZ32 = 48, // 0011-0000 + PSMZ24 = 49, // 0011-0001 + PSMZ16 = 50, // 0011-0010 + PSMZ16S = 58, // 0011-1010 }; enum GS_TFX @@ -827,9 +827,9 @@ REG_END2 // This is actually "does the texture span more than one page". if (TBW < 2) { - if (PSM == PSM_PSMT8) + if (PSM == PSMT8) return TW > 7 || TH > 6; - if (PSM == PSM_PSMT4) + if (PSM == PSMT4) return TW > 7 || TH > 7; } diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index ae2211102e..3a6da89d06 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -1294,20 +1294,20 @@ void GSState::GIFRegHandlerFRAME(const GIFReg* RESTRICT r) switch (m_env.CTXT[i].FRAME.PSM) { - case PSM_PSMT8H: + 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"); - m_env.CTXT[i].FRAME.PSM = PSM_PSMCT32; + m_env.CTXT[i].FRAME.PSM = PSMCT32; m_env.CTXT[i].FRAME.FBMSK = 0x00FFFFFF; break; - case PSM_PSMT4HH: // Not tested. Based on PSM_PSMT8H behavior + case PSMT4HH: // Not tested. Based on PSM_PSMT8H behavior GL_INS("CORRECT FRAME FORMAT replaces PSM_PSMT4HH by PSM_PSMCT32/0x0FFF_FFFF"); - m_env.CTXT[i].FRAME.PSM = PSM_PSMCT32; + m_env.CTXT[i].FRAME.PSM = PSMCT32; m_env.CTXT[i].FRAME.FBMSK = 0x0FFFFFFF; break; - case PSM_PSMT4HL: // Not tested. Based on PSM_PSMT8H behavior + case PSMT4HL: // Not tested. Based on PSM_PSMT8H behavior GL_INS("CORRECT FRAME FORMAT replaces PSM_PSMT4HL by PSM_PSMCT32/0xF0FF_FFFF"); - m_env.CTXT[i].FRAME.PSM = PSM_PSMCT32; + m_env.CTXT[i].FRAME.PSM = PSMCT32; m_env.CTXT[i].FRAME.FBMSK = 0xF0FFFFFF; break; default: @@ -1701,7 +1701,7 @@ void GSState::Write(const u8* mem, int len) if (m_game.title == CRC::SMTNocturne) // TODO: hack { - if (blit.DBP == 0 && blit.DPSM == PSM_PSMZ32 && w == 512 && h > 224) + if (blit.DBP == 0 && blit.DPSM == PSMZ32 && w == 512 && h > 224) { h = 224; m_env.TRXREG.RRH = 224; @@ -2037,16 +2037,16 @@ void GSState::Move() }); } } - else if (m_env.BITBLTBUF.SPSM == PSM_PSMT8 && m_env.BITBLTBUF.DPSM == PSM_PSMT8) + else if (m_env.BITBLTBUF.SPSM == PSMT8 && m_env.BITBLTBUF.DPSM == PSMT8) { - copyFast(m_mem.m_vm8, GSOffset::fromKnownPSM(dbp, dbw, PSM_PSMT8), GSOffset::fromKnownPSM(sbp, sbw, PSM_PSMT8), [](u8* d, u8* s) + copyFast(m_mem.m_vm8, GSOffset::fromKnownPSM(dbp, dbw, PSMT8), GSOffset::fromKnownPSM(sbp, sbw, PSMT8), [](u8* d, u8* s) { *d = *s; }); } - else if (m_env.BITBLTBUF.SPSM == PSM_PSMT4 && m_env.BITBLTBUF.DPSM == PSM_PSMT4) + else if (m_env.BITBLTBUF.SPSM == PSMT4 && m_env.BITBLTBUF.DPSM == PSMT4) { - copy(GSOffset::fromKnownPSM(dbp, dbw, PSM_PSMT4), GSOffset::fromKnownPSM(sbp, sbw, PSM_PSMT4), [&](u32 doff, u32 soff) + copy(GSOffset::fromKnownPSM(dbp, dbw, PSMT4), GSOffset::fromKnownPSM(sbp, sbw, PSMT4), [&](u32 doff, u32 soff) { m_mem.WritePixel4(doff, m_mem.ReadPixel4(soff)); }); @@ -3773,7 +3773,7 @@ bool GSState::IsOpaque() } else if (context->ALPHA.C == 1) { - if (context->FRAME.PSM == PSM_PSMCT24 || context->FRAME.PSM == PSM_PSMZ24) + if (context->FRAME.PSM == PSMCT24 || context->FRAME.PSM == PSMZ24) amin = amax = 0x80; } else if (context->ALPHA.C == 2) diff --git a/pcsx2/GS/GSUtil.cpp b/pcsx2/GS/GSUtil.cpp index a9b1ad5fe1..4007672574 100644 --- a/pcsx2/GS/GSUtil.cpp +++ b/pcsx2/GS/GSUtil.cpp @@ -72,14 +72,14 @@ public: CompatibleBitsField[i][i >> 5] |= 1U << (i & 0x1f); } - CompatibleBitsField[PSM_PSMCT32][PSM_PSMCT24 >> 5] |= 1 << (PSM_PSMCT24 & 0x1f); - CompatibleBitsField[PSM_PSMCT24][PSM_PSMCT32 >> 5] |= 1 << (PSM_PSMCT32 & 0x1f); - CompatibleBitsField[PSM_PSMCT16][PSM_PSMCT16S >> 5] |= 1 << (PSM_PSMCT16S & 0x1f); - CompatibleBitsField[PSM_PSMCT16S][PSM_PSMCT16 >> 5] |= 1 << (PSM_PSMCT16 & 0x1f); - CompatibleBitsField[PSM_PSMZ32][PSM_PSMZ24 >> 5] |= 1 << (PSM_PSMZ24 & 0x1f); - CompatibleBitsField[PSM_PSMZ24][PSM_PSMZ32 >> 5] |= 1 << (PSM_PSMZ32 & 0x1f); - CompatibleBitsField[PSM_PSMZ16][PSM_PSMZ16S >> 5] |= 1 << (PSM_PSMZ16S & 0x1f); - CompatibleBitsField[PSM_PSMZ16S][PSM_PSMZ16 >> 5] |= 1 << (PSM_PSMZ16 & 0x1f); + CompatibleBitsField[PSMCT32][PSMCT24 >> 5] |= 1 << (PSMCT24 & 0x1f); + CompatibleBitsField[PSMCT24][PSMCT32 >> 5] |= 1 << (PSMCT32 & 0x1f); + CompatibleBitsField[PSMCT16][PSMCT16S >> 5] |= 1 << (PSMCT16S & 0x1f); + CompatibleBitsField[PSMCT16S][PSMCT16 >> 5] |= 1 << (PSMCT16 & 0x1f); + CompatibleBitsField[PSMZ32][PSMZ24 >> 5] |= 1 << (PSMZ24 & 0x1f); + CompatibleBitsField[PSMZ24][PSMZ32 >> 5] |= 1 << (PSMZ32 & 0x1f); + CompatibleBitsField[PSMZ16][PSMZ16S >> 5] |= 1 << (PSMZ16S & 0x1f); + CompatibleBitsField[PSMZ16S][PSMZ16 >> 5] |= 1 << (PSMZ16 & 0x1f); memset(SwizzleField, 0, sizeof(SwizzleField)); @@ -88,33 +88,33 @@ public: SwizzleField[i][i >> 5] |= 1U << (i & 0x1f); } - SwizzleField[PSM_PSMCT32][PSM_PSMCT24 >> 5] |= 1 << (PSM_PSMCT24 & 0x1f); - SwizzleField[PSM_PSMCT24][PSM_PSMCT32 >> 5] |= 1 << (PSM_PSMCT32 & 0x1f); - SwizzleField[PSM_PSMT8H][PSM_PSMCT32 >> 5] |= 1 << (PSM_PSMCT32 & 0x1f); - SwizzleField[PSM_PSMCT32][PSM_PSMT8H >> 5] |= 1 << (PSM_PSMT8H & 0x1f); - SwizzleField[PSM_PSMT4HL][PSM_PSMCT32 >> 5] |= 1 << (PSM_PSMCT32 & 0x1f); - SwizzleField[PSM_PSMCT32][PSM_PSMT4HL >> 5] |= 1 << (PSM_PSMT4HL & 0x1f); - SwizzleField[PSM_PSMT4HH][PSM_PSMCT32 >> 5] |= 1 << (PSM_PSMCT32 & 0x1f); - SwizzleField[PSM_PSMCT32][PSM_PSMT4HH >> 5] |= 1 << (PSM_PSMT4HH & 0x1f); - SwizzleField[PSM_PSMZ32][PSM_PSMZ24 >> 5] |= 1 << (PSM_PSMZ24 & 0x1f); - SwizzleField[PSM_PSMZ24][PSM_PSMZ32 >> 5] |= 1 << (PSM_PSMZ32 & 0x1f); + SwizzleField[PSMCT32][PSMCT24 >> 5] |= 1 << (PSMCT24 & 0x1f); + SwizzleField[PSMCT24][PSMCT32 >> 5] |= 1 << (PSMCT32 & 0x1f); + SwizzleField[PSMT8H][PSMCT32 >> 5] |= 1 << (PSMCT32 & 0x1f); + SwizzleField[PSMCT32][PSMT8H >> 5] |= 1 << (PSMT8H & 0x1f); + SwizzleField[PSMT4HL][PSMCT32 >> 5] |= 1 << (PSMCT32 & 0x1f); + SwizzleField[PSMCT32][PSMT4HL >> 5] |= 1 << (PSMT4HL & 0x1f); + SwizzleField[PSMT4HH][PSMCT32 >> 5] |= 1 << (PSMCT32 & 0x1f); + SwizzleField[PSMCT32][PSMT4HH >> 5] |= 1 << (PSMT4HH & 0x1f); + SwizzleField[PSMZ32][PSMZ24 >> 5] |= 1 << (PSMZ24 & 0x1f); + SwizzleField[PSMZ24][PSMZ32 >> 5] |= 1 << (PSMZ32 & 0x1f); memset(SharedBitsField, 0, sizeof(SharedBitsField)); - SharedBitsField[PSM_PSMCT24][PSM_PSMT8H >> 5] |= 1 << (PSM_PSMT8H & 0x1f); - SharedBitsField[PSM_PSMCT24][PSM_PSMT4HL >> 5] |= 1 << (PSM_PSMT4HL & 0x1f); - SharedBitsField[PSM_PSMCT24][PSM_PSMT4HH >> 5] |= 1 << (PSM_PSMT4HH & 0x1f); - SharedBitsField[PSM_PSMZ24][PSM_PSMT8H >> 5] |= 1 << (PSM_PSMT8H & 0x1f); - SharedBitsField[PSM_PSMZ24][PSM_PSMT4HL >> 5] |= 1 << (PSM_PSMT4HL & 0x1f); - SharedBitsField[PSM_PSMZ24][PSM_PSMT4HH >> 5] |= 1 << (PSM_PSMT4HH & 0x1f); - SharedBitsField[PSM_PSMT8H][PSM_PSMCT24 >> 5] |= 1 << (PSM_PSMCT24 & 0x1f); - SharedBitsField[PSM_PSMT8H][PSM_PSMZ24 >> 5] |= 1 << (PSM_PSMZ24 & 0x1f); - SharedBitsField[PSM_PSMT4HL][PSM_PSMCT24 >> 5] |= 1 << (PSM_PSMCT24 & 0x1f); - SharedBitsField[PSM_PSMT4HL][PSM_PSMZ24 >> 5] |= 1 << (PSM_PSMZ24 & 0x1f); - SharedBitsField[PSM_PSMT4HL][PSM_PSMT4HH >> 5] |= 1 << (PSM_PSMT4HH & 0x1f); - SharedBitsField[PSM_PSMT4HH][PSM_PSMCT24 >> 5] |= 1 << (PSM_PSMCT24 & 0x1f); - SharedBitsField[PSM_PSMT4HH][PSM_PSMZ24 >> 5] |= 1 << (PSM_PSMZ24 & 0x1f); - SharedBitsField[PSM_PSMT4HH][PSM_PSMT4HL >> 5] |= 1 << (PSM_PSMT4HL & 0x1f); + SharedBitsField[PSMCT24][PSMT8H >> 5] |= 1 << (PSMT8H & 0x1f); + SharedBitsField[PSMCT24][PSMT4HL >> 5] |= 1 << (PSMT4HL & 0x1f); + SharedBitsField[PSMCT24][PSMT4HH >> 5] |= 1 << (PSMT4HH & 0x1f); + SharedBitsField[PSMZ24][PSMT8H >> 5] |= 1 << (PSMT8H & 0x1f); + SharedBitsField[PSMZ24][PSMT4HL >> 5] |= 1 << (PSMT4HL & 0x1f); + SharedBitsField[PSMZ24][PSMT4HH >> 5] |= 1 << (PSMT4HH & 0x1f); + SharedBitsField[PSMT8H][PSMCT24 >> 5] |= 1 << (PSMCT24 & 0x1f); + SharedBitsField[PSMT8H][PSMZ24 >> 5] |= 1 << (PSMZ24 & 0x1f); + SharedBitsField[PSMT4HL][PSMCT24 >> 5] |= 1 << (PSMCT24 & 0x1f); + SharedBitsField[PSMT4HL][PSMZ24 >> 5] |= 1 << (PSMZ24 & 0x1f); + SharedBitsField[PSMT4HL][PSMT4HH >> 5] |= 1 << (PSMT4HH & 0x1f); + SharedBitsField[PSMT4HH][PSMCT24 >> 5] |= 1 << (PSMCT24 & 0x1f); + SharedBitsField[PSMT4HH][PSMZ24 >> 5] |= 1 << (PSMZ24 & 0x1f); + SharedBitsField[PSMT4HH][PSMT4HL >> 5] |= 1 << (PSMT4HL & 0x1f); } } s_maps; @@ -180,12 +180,12 @@ u32 GSUtil::GetChannelMask(u32 spsm) { switch (spsm) { - case PSM_PSMCT24: - case PSM_PSMZ24: + case PSMCT24: + case PSMZ24: return 0x7; - case PSM_PSMT8H: - case PSM_PSMT4HH: // This sucks, I'm sorry, but we don't have a way to do half channels - case PSM_PSMT4HL: // So uuhh TODO I guess. + case PSMT8H: + case PSMT4HH: // This sucks, I'm sorry, but we don't have a way to do half channels + case PSMT4HL: // So uuhh TODO I guess. return 0x8; default: return 0xf; @@ -222,25 +222,25 @@ const char* psm_str(int psm) switch (psm) { // Normal color - case PSM_PSMCT32: return "C_32"; - case PSM_PSMCT24: return "C_24"; - case PSM_PSMCT16: return "C_16"; - case PSM_PSMCT16S: return "C_16S"; + case PSMCT32: return "C_32"; + case PSMCT24: return "C_24"; + case PSMCT16: return "C_16"; + case PSMCT16S: return "C_16S"; // Palette color - case PSM_PSMT8: return "P_8"; - case PSM_PSMT4: return "P_4"; - case PSM_PSMT8H: return "P_8H"; - case PSM_PSMT4HL: return "P_4HL"; - case PSM_PSMT4HH: return "P_4HH"; + case PSMT8: return "P_8"; + case PSMT4: return "P_4"; + case PSMT8H: return "P_8H"; + case PSMT4HL: return "P_4HL"; + case PSMT4HH: return "P_4HH"; // Depth - case PSM_PSMZ32: return "Z_32"; - case PSM_PSMZ24: return "Z_24"; - case PSM_PSMZ16: return "Z_16"; - case PSM_PSMZ16S: return "Z_16S"; + case PSMZ32: return "Z_32"; + case PSMZ24: return "Z_24"; + case PSMZ16: return "Z_16"; + case PSMZ16S: return "Z_16S"; - case PSM_PSGPU24: return "PS24"; + case PSGPU24: return "PS24"; default:break; } diff --git a/pcsx2/GS/Renderers/Common/GSDirtyRect.cpp b/pcsx2/GS/Renderers/Common/GSDirtyRect.cpp index 81a4a041b1..1272475f05 100644 --- a/pcsx2/GS/Renderers/Common/GSDirtyRect.cpp +++ b/pcsx2/GS/Renderers/Common/GSDirtyRect.cpp @@ -19,7 +19,7 @@ GSDirtyRect::GSDirtyRect() : r(GSVector4i::zero()), - psm(PSM_PSMCT32), + psm(PSMCT32), bw(1), rgba({}), req_linear(false) diff --git a/pcsx2/GS/Renderers/HW/GSHwHack.cpp b/pcsx2/GS/Renderers/HW/GSHwHack.cpp index f4ce5dfc72..b02a0855d0 100644 --- a/pcsx2/GS/Renderers/HW/GSHwHack.cpp +++ b/pcsx2/GS/Renderers/HW/GSHwHack.cpp @@ -58,13 +58,13 @@ bool GSHwHack::GSC_DeathByDegreesTekkenNinaWilliams(GSRendererHW& r, int& skip) // See https://forums.pcsx2.net/Thread-GSDX-Texture-Cache-Bug-Report-Death-By-Degrees-SLUS-20934-NTSC if (skip == 0) { - if (!s_nativeres && RTME && RFBP == 0 && RTBP0 == 0x34a0 && RTPSM == PSM_PSMCT32) + if (!s_nativeres && RTME && RFBP == 0 && RTBP0 == 0x34a0 && RTPSM == PSMCT32) { // Don't enable hack on native res if crc is below aggressive. // Upscaling issue similar to Tekken 5. skip = 1; // Animation pane } - else if (CRC_Aggressive && RFBP == 0x3500 && RTPSM == PSM_PSMT8 && RFBMSK == 0xFFFF00FF) + else if (CRC_Aggressive && RFBP == 0x3500 && RTPSM == PSMT8 && RFBMSK == 0xFFFF00FF) { // Needs to be further tested so put it on Aggressive for now, likely channel shuffle. skip = 4; // Underwater white fog @@ -86,7 +86,7 @@ bool GSHwHack::GSC_GiTS(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x03000 && RFPSM == PSM_PSMCT32 && RTPSM == PSM_PSMT8) + if (RTME && RFBP == 0x03000 && RFPSM == PSMCT32 && RTPSM == PSMT8) { // Channel effect not properly supported yet skip = 9; @@ -119,7 +119,7 @@ bool GSHwHack::GSC_Manhunt2(GSRendererHW& r, int& skip) */ if (skip == 0) { - if (RTME && RFBP == 0x03c20 && RFPSM == PSM_PSMCT32 && RTBP0 == 0x01400 && RTPSM == PSM_PSMT8) + if (RTME && RFBP == 0x03c20 && RFPSM == PSMCT32 && RTBP0 == 0x01400 && RTPSM == PSMT8) { skip = 640; } @@ -135,7 +135,7 @@ bool GSHwHack::GSC_SacredBlaze(GSRendererHW& r, int& skip) // So let's throw it at the SW renderer to deal with. if (skip == 0) { - if ((RFBP == 0x2680 || RFBP == 0x26c0 || RFBP == 0x2780 || RFBP == 0x2880 || RFBP == 0x2a80) && RTPSM == PSM_PSMCT32 && RFBW <= 2 && + if ((RFBP == 0x2680 || RFBP == 0x26c0 || RFBP == 0x2780 || RFBP == 0x2880 || RFBP == 0x2a80) && RTPSM == PSMCT32 && RFBW <= 2 && (!RTME || (RTBP0 == 0x0 || RTBP0 == 0xe00 || RTBP0 == 0x3e00))) { r.SwPrimRender(r, RTBP0 > 0x1000); @@ -150,25 +150,25 @@ bool GSHwHack::GSC_SakuraTaisen(GSRendererHW& r, int& skip) { if (skip == 0) { - if (!RTME && (RFBP == 0x0 || RFBP == 0x1180) && (RTBP0 != 0x3fc0 && RTBP0 != 0x3c9a && RTBP0 != 0x3dec /*GSC_TBP0 ==0x38d0 || GSC_TBP0==0x3912 ||GSC_TBP0==0x3bdc ||GSC_TBP0==0x3ab3 ||GSC_TBP0<=0x3a92*/) && RFPSM == PSM_PSMCT32 && (RTPSM == PSM_PSMT8 || RTPSM == PSM_PSMT4) && (RFBMSK == 0x00FFFFFF || !RFBMSK)) + if (!RTME && (RFBP == 0x0 || RFBP == 0x1180) && (RTBP0 != 0x3fc0 && RTBP0 != 0x3c9a && RTBP0 != 0x3dec /*GSC_TBP0 ==0x38d0 || GSC_TBP0==0x3912 ||GSC_TBP0==0x3bdc ||GSC_TBP0==0x3ab3 ||GSC_TBP0<=0x3a92*/) && RFPSM == PSMCT32 && (RTPSM == PSMT8 || RTPSM == PSMT4) && (RFBMSK == 0x00FFFFFF || !RFBMSK)) { skip = 0; //3dec 3fc0 3c9a } - if (!RTME && (RFBP | RTBP0) != 0 && (RFBP | RTBP0) != 0x1180 && (RFBP | RTBP0) != 0x3be0 && (RFBP | RTBP0) != 0x3c80 && RTBP0 != 0x3c9a && (RFBP | RTBP0) != 0x3d80 && RTBP0 != 0x3dec && RFPSM == PSM_PSMCT32 && (RFBMSK == 0)) + if (!RTME && (RFBP | RTBP0) != 0 && (RFBP | RTBP0) != 0x1180 && (RFBP | RTBP0) != 0x3be0 && (RFBP | RTBP0) != 0x3c80 && RTBP0 != 0x3c9a && (RFBP | RTBP0) != 0x3d80 && RTBP0 != 0x3dec && RFPSM == PSMCT32 && (RFBMSK == 0)) { skip = 0; //3dec 3fc0 3c9a } - if (!RTME && (RFBP | RTBP0) != 0 && (RFBP | RTBP0) != 0x1180 && (RFBP | RTBP0) != 0x3be0 && (RFBP | RTBP0) != 0x3c80 && (RFBP | RTBP0) != 0x3d80 && RTBP0 != 0x3c9a && RTBP0 != 0x3de && RFPSM == PSM_PSMCT32 && (RFBMSK == 0)) + if (!RTME && (RFBP | RTBP0) != 0 && (RFBP | RTBP0) != 0x1180 && (RFBP | RTBP0) != 0x3be0 && (RFBP | RTBP0) != 0x3c80 && (RFBP | RTBP0) != 0x3d80 && RTBP0 != 0x3c9a && RTBP0 != 0x3de && RFPSM == PSMCT32 && (RFBMSK == 0)) { skip = 1; //3dec 3fc0 3c9a } - else if (RTME && (RFBP == 0 || RFBP == 0x1180) && RTBP0 == 0x35B8 && RTPSM == PSM_PSMT4) + else if (RTME && (RFBP == 0 || RFBP == 0x1180) && RTBP0 == 0x35B8 && RTPSM == PSMT4) { skip = 1; } else { - if (!RTME && (RFBP | RTBP0) == 0x38d0 && RFPSM == PSM_PSMCT32) + if (!RTME && (RFBP | RTBP0) == 0x38d0 && RFPSM == PSMCT32) { skip = 1; //3dec 3fc0 3c9a } @@ -182,7 +182,7 @@ bool GSHwHack::GSC_SFEX3(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x00500 && RFPSM == PSM_PSMCT16 && RTBP0 == 0x00f00 && RTPSM == PSM_PSMCT16) + if (RTME && RFBP == 0x00500 && RFPSM == PSMCT16 && RTBP0 == 0x00f00 && RTPSM == PSMCT16) { // Not an upscaling issue. // Elements on the screen show double/distorted. @@ -197,7 +197,7 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip) { if (skip == 0) { - if (!s_nativeres && RTME && (RFBP == 0x02d60 || RFBP == 0x02d80 || RFBP == 0x02ea0 || RFBP == 0x03620 || RFBP == 0x03640) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSM_PSMCT32) + if (!s_nativeres && RTME && (RFBP == 0x02d60 || RFBP == 0x02d80 || RFBP == 0x02ea0 || RFBP == 0x03620 || RFBP == 0x03640) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSMCT32) { // Don't enable hack on native res if crc is below aggressive. // Fixes/removes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling. @@ -205,7 +205,7 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip) // Let's enable this hack for Aggressive only since it's an upscaling issue for both renders. skip = 95; } - else if (RZTST == 1 && RTME && (RFBP == 0x02bc0 || RFBP == 0x02be0 || RFBP == 0x02d00 || RFBP == 0x03480 || RFBP == 0x034a0) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSM_PSMCT32) + 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. @@ -220,7 +220,7 @@ bool GSHwHack::GSC_TombRaiderAnniversary(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSM_PSMCT32) + if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSMCT32) { skip = 1; // Garbage TC } @@ -234,11 +234,11 @@ bool GSHwHack::GSC_TombRaiderLegend(GSRendererHW& r, int& skip) if (skip == 0) { // ||GSC_TBP0 ==0x2F00 - if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSM_PSMCT32 && (RTBP0 == 0x2b60 || RTBP0 == 0x2b80 || RTBP0 == 0x2E60 || RTBP0 == 0x3020 || RTBP0 == 0x3200 || RTBP0 == 0x3320)) + if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSMCT32 && (RTBP0 == 0x2b60 || RTBP0 == 0x2b80 || RTBP0 == 0x2E60 || RTBP0 == 0x3020 || RTBP0 == 0x3200 || RTBP0 == 0x3320)) { skip = 1; // Garbage TC } - else if (RTPSM == PSM_PSMCT32 && (RTPSM | RFBP) == 0x2fa0 && (RTBP0 == 0x2bc0) && RFBMSK == 0) + else if (RTPSM == PSMCT32 && (RTPSM | RFBP) == 0x2fa0 && (RTBP0 == 0x2bc0) && RFBMSK == 0) { skip = 2; // Underwater black screen } @@ -251,11 +251,11 @@ bool GSHwHack::GSC_TombRaiderUnderWorld(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSM_PSMCT32 && (RTBP0 == 0x2B60 /*|| GSC_TBP0 == 0x2EFF || GSC_TBP0 ==0x2F00 || GSC_TBP0 == 0x3020*/ || (RTBP0 >= 0x2C01 && RTBP0 != 0x3029 && RTBP0 != 0x302d))) + if (RTME && RFBP == 0x01000 && RFPSM == RTPSM && RTPSM == PSMCT32 && (RTBP0 == 0x2B60 /*|| GSC_TBP0 == 0x2EFF || GSC_TBP0 ==0x2F00 || GSC_TBP0 == 0x3020*/ || (RTBP0 >= 0x2C01 && RTBP0 != 0x3029 && RTBP0 != 0x302d))) { skip = 1; // Garbage TC } - else if (RTPSM == PSM_PSMCT32 && (RTPSM | RFBP) == 0x2c00 && (RTBP0 == 0x0ee0) && RFBMSK == 0) + else if (RTPSM == PSMCT32 && (RTPSM | RFBP) == 0x2c00 && (RTBP0 == 0x0ee0) && RFBMSK == 0) { skip = 2; // Underwater black screen } @@ -267,7 +267,7 @@ bool GSHwHack::GSC_TombRaiderUnderWorld(GSRendererHW& r, int& skip) bool GSHwHack::GSC_BurnoutGames(GSRendererHW& r, int& skip) { // We don't check if we already have a skip here, because it gets confused when auto flush is on. - if (RTME && (RFBP == 0x01dc0 || RFBP == 0x01c00 || RFBP == 0x01f00 || RFBP == 0x01d40 || RFBP == 0x02200 || RFBP == 0x02000) && RFPSM == RTPSM && (RTBP0 == 0x01dc0 || RTBP0 == 0x01c00 || RTBP0 == 0x01f00 || RTBP0 == 0x01d40 || RTBP0 == 0x02200 || RTBP0 == 0x02000) && RTPSM == PSM_PSMCT32) + if (RTME && (RFBP == 0x01dc0 || RFBP == 0x01c00 || RFBP == 0x01f00 || RFBP == 0x01d40 || RFBP == 0x02200 || RFBP == 0x02000) && RFPSM == RTPSM && (RTBP0 == 0x01dc0 || RTBP0 == 0x01c00 || RTBP0 == 0x01f00 || RTBP0 == 0x01d40 || RTBP0 == 0x02200 || RTBP0 == 0x02000) && RTPSM == PSMCT32) { // 0x01dc0 01c00(MP) ntsc, 0x01f00 0x01d40(MP) ntsc progressive, 0x02200(MP) pal. // Yellow stripes. @@ -289,9 +289,9 @@ bool GSHwHack::GSC_BlackAndBurnoutSky(GSRendererHW& r, int& skip) const GIFRegALPHA& ALPHA = RCONTEXT->ALPHA; if (RPRIM->PRIM == GS_SPRITE && !RPRIM->IIP && RPRIM->TME && !RPRIM->FGE && RPRIM->ABE && !RPRIM->AA1 && !RPRIM->FST && !RPRIM->FIX && - ALPHA.A == ALPHA.B && ALPHA.D == 0 && FRAME.PSM == PSM_PSMCT32 && TEX0.CPSM == PSM_PSMCT32 && TEX0.TCC && !TEX0.TFX && !TEX0.CSM) + ALPHA.A == ALPHA.B && ALPHA.D == 0 && FRAME.PSM == PSMCT32 && TEX0.CPSM == PSMCT32 && TEX0.TCC && !TEX0.TFX && !TEX0.CSM) { - if (TEX0.TBW == 16 && TEX0.TW == 10 && TEX0.PSM == PSM_PSMT8 && TEX0.TH == 8 && FRAME.FBW == 16) + if (TEX0.TBW == 16 && TEX0.TW == 10 && TEX0.PSM == PSMT8 && TEX0.TH == 8 && FRAME.FBW == 16) { // Readback clouds being rendered during level loading. // Later the alpha channel from the 32 bit frame buffer is used as an 8 bit indexed texture to draw @@ -301,7 +301,7 @@ bool GSHwHack::GSC_BlackAndBurnoutSky(GSRendererHW& r, int& skip) r.SwPrimRender(r, true); skip = 1; } - if (TEX0.TBW == 2 && TEX0.TW == 7 && ((TEX0.PSM == PSM_PSMT4 && FRAME.FBW == 3) || (TEX0.PSM == PSM_PSMT8 && FRAME.FBW == 2)) && TEX0.TH == 6 && (FRAME.FBMSK & 0xFFFFFF) == 0xFFFFFF) + if (TEX0.TBW == 2 && TEX0.TW == 7 && ((TEX0.PSM == PSMT4 && FRAME.FBW == 3) || (TEX0.PSM == PSMT8 && FRAME.FBW == 2)) && TEX0.TH == 6 && (FRAME.FBMSK & 0xFFFFFF) == 0xFFFFFF) { // Rendering of the glass smashing effect and some chassis decal in to the alpha channel of the FRAME on boot (before the menu). // This gets ejected from the texture cache due to old age, but never gets written back. @@ -317,7 +317,7 @@ bool GSHwHack::GSC_MidnightClub3(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && (RFBP > 0x01d00 && RFBP <= 0x02a00) && RFPSM == PSM_PSMCT32 && (RFBP >= 0x01600 && RFBP < 0x03260) && RTPSM == PSM_PSMT8H) + if (RTME && (RFBP > 0x01d00 && RFBP <= 0x02a00) && RFPSM == PSMCT32 && (RFBP >= 0x01600 && RFBP < 0x03260) && RTPSM == PSMT8H) { // Vram usage. // Tested: tokyo default cruise. @@ -333,15 +333,15 @@ bool GSHwHack::GSC_TalesOfLegendia(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && (RFBP == 0x3f80 || RFBP == 0x03fa0) && RFPSM == PSM_PSMCT32 && RTPSM == PSM_PSMT8) + if (RTME && (RFBP == 0x3f80 || RFBP == 0x03fa0) && RFPSM == PSMCT32 && RTPSM == PSMT8) { skip = 3; // 3, 9 } - if (RTME && RFBP == 0x3800 && RFPSM == PSM_PSMCT32 && RTPSM == PSM_PSMZ32) + if (RTME && RFBP == 0x3800 && RFPSM == PSMCT32 && RTPSM == PSMZ32) { skip = 2; } - if (RTME && RFBP && RFPSM == PSM_PSMCT32 && RTBP0 == 0x3d80) + if (RTME && RFBP && RFPSM == PSMCT32 && RTBP0 == 0x3d80) { skip = 1; // Missing block 2a00 in the upper left } @@ -362,7 +362,7 @@ bool GSHwHack::GSC_Kunoichi(GSRendererHW& r, int& skip) { if (skip == 0) { - if (!RTME && (RFBP == 0x0 || RFBP == 0x00700 || RFBP == 0x00800) && RFPSM == PSM_PSMCT32 && RFBMSK == 0x00FFFFFF) + if (!RTME && (RFBP == 0x0 || RFBP == 0x00700 || RFBP == 0x00800) && RFPSM == PSMCT32 && RFBMSK == 0x00FFFFFF) { // Removes depth effects(shadows) not rendered correctly on all renders. skip = 3; @@ -374,7 +374,7 @@ bool GSHwHack::GSC_Kunoichi(GSRendererHW& r, int& skip) } else { - if (RTME && (RFBP == 0x0e00) && RFPSM == PSM_PSMCT32 && RFBMSK == 0xFF000000) + if (RTME && (RFBP == 0x0e00) && RFPSM == PSMCT32 && RFBMSK == 0xFF000000) { skip = 0; } @@ -387,15 +387,15 @@ bool GSHwHack::GSC_ZettaiZetsumeiToshi2(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RTPSM == PSM_PSMCT16S && (RFBMSK >= 0x6FFFFFFF || RFBMSK == 0)) + if (RTME && RTPSM == PSMCT16S && (RFBMSK >= 0x6FFFFFFF || RFBMSK == 0)) { skip = 1000; } - else if (RTME && RTPSM == PSM_PSMCT32 && RFBMSK == 0xFF000000) + else if (RTME && RTPSM == PSMCT32 && RFBMSK == 0xFF000000) { skip = 2; // Fog } - else if ((RFBP | RTBP0) && RFPSM == RTPSM && RTPSM == PSM_PSMCT16 && RFBMSK == 0x3FFF) + else if ((RFBP | RTBP0) && RFPSM == RTPSM && RTPSM == PSMCT16 && RFBMSK == 0x3FFF) { // Note start of the effect (texture shuffle) is fixed but maybe not the extra draw call skip = 1000; @@ -403,27 +403,27 @@ bool GSHwHack::GSC_ZettaiZetsumeiToshi2(GSRendererHW& r, int& skip) } else { - if (!RTME && RTPSM == PSM_PSMCT32 && RFBP == 0x1180 && RTBP0 == 0x1180 && (RFBMSK == 0)) + if (!RTME && RTPSM == PSMCT32 && RFBP == 0x1180 && RTBP0 == 0x1180 && (RFBMSK == 0)) { skip = 0; } - if (RTME && RTPSM == PSM_PSMT4 && RFBP && (RTBP0 != 0x3753)) + if (RTME && RTPSM == PSMT4 && RFBP && (RTBP0 != 0x3753)) { skip = 0; } - if (RTME && RTPSM == PSM_PSMT8H && RFBP == 0x22e0 && RTBP0 == 0x36e0) + if (RTME && RTPSM == PSMT8H && RFBP == 0x22e0 && RTBP0 == 0x36e0) { skip = 0; } - if (!RTME && RTPSM == PSM_PSMT8H && RFBP == 0x22e0) + if (!RTME && RTPSM == PSMT8H && RFBP == 0x22e0) { skip = 0; } - if (RTME && RTPSM == PSM_PSMT8 && (RFBP == 0x1180 || RFBP == 0) && (RTBP0 != 0x3764 && RTBP0 != 0x370f)) + if (RTME && RTPSM == PSMT8 && (RFBP == 0x1180 || RFBP == 0) && (RTBP0 != 0x3764 && RTBP0 != 0x370f)) { skip = 0; } - if (RTME && RTPSM == PSM_PSMCT16S && (RFBP == 0x1180)) + if (RTME && RTPSM == PSMCT16S && (RFBP == 0x1180)) { skip = 2; } @@ -444,7 +444,7 @@ bool GSHwHack::GSC_SakuraWarsSoLongMyLove(GSRendererHW& r, int& skip) { skip = 3; // Remove darkness } - else if (RTME && (RFBP == 0 || RFBP == 0x1180) && RFPSM == PSM_PSMCT32 && RTBP0 == 0x3F3F && RTPSM == PSM_PSMT8) + else if (RTME && (RFBP == 0 || RFBP == 0x1180) && RFPSM == PSMCT32 && RTBP0 == 0x3F3F && RTPSM == PSMT8) { skip = 1; // Floodlight } @@ -457,7 +457,7 @@ bool GSHwHack::GSC_GodHand(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && (RFBP == 0x0) && (RTBP0 == 0x2800) && RFPSM == RTPSM && RTPSM == PSM_PSMCT32) + if (RTME && (RFBP == 0x0) && (RTBP0 == 0x2800) && RFPSM == RTPSM && RTPSM == PSMCT32) { skip = 1; // Blur } @@ -470,11 +470,11 @@ bool GSHwHack::GSC_KnightsOfTheTemple2(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTPSM == PSM_PSMT8H && RFBMSK == 0) + if (RTPSM == PSMT8H && RFBMSK == 0) { skip = 1; // Ghosting } - else if (RTPSM == 0x00000 && PSM_PSMCT24 && RTME && (RFBP == 0x3400 || RFBP == 0x3a00)) + else if (RTPSM == 0x00000 && PSMCT24 && RTME && (RFBP == 0x3400 || RFBP == 0x3a00)) { skip = 1; // Light source } @@ -487,7 +487,7 @@ bool GSHwHack::GSC_UltramanFightingEvolution(GSRendererHW& r, int& skip) { if (skip == 0) { - if (!s_nativeres && RTME && RFBP == 0x2a00 && RFPSM == PSM_PSMZ24 && RTBP0 == 0x1c00 && RTPSM == PSM_PSMZ24) + if (!s_nativeres && RTME && RFBP == 0x2a00 && RFPSM == PSMZ24 && RTBP0 == 0x1c00 && RTPSM == PSMZ24) { // Don't enable hack on native res if crc is below aggressive. skip = 5; // blur @@ -501,7 +501,7 @@ bool GSHwHack::GSC_TalesofSymphonia(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFPSM == PSM_PSMCT32 && (RTBP0 == 0x2bc0 || RTBP0 <= 0x0200) && (RFBMSK == 0xFF000000 || RFBMSK == 0x00FFFFFF)) + if (RTME && RFPSM == PSMCT32 && (RTBP0 == 0x2bc0 || RTBP0 <= 0x0200) && (RFBMSK == 0xFF000000 || RFBMSK == 0x00FFFFFF)) { skip = 1; //GSC_FBMSK==0 Causing an animated black screen to speed up the battle } @@ -538,7 +538,7 @@ bool GSHwHack::GSC_UrbanReign(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x0000 && RTBP0 == 0x3980 && RFPSM == RTPSM && RTPSM == PSM_PSMCT32 && RFBMSK == 0x0) + if (RTME && RFBP == 0x0000 && RTBP0 == 0x3980 && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0x0) { skip = 1; // Black shadow } @@ -547,7 +547,7 @@ bool GSHwHack::GSC_UrbanReign(GSRendererHW& r, int& skip) // which would be fine, except their texture coordinates appear to be off by one. Which prevents the page translation // from matching the last column, because it's trying to fit the last 65 columns of a 640x448 (effectively 641x448) // texture into a 640x448 render target. - if (RTME && RTBP0 != RFBP && RFPSM == PSM_PSMCT32 && RTPSM == PSM_PSMCT32 && + if (RTME && RTBP0 != RFBP && RFPSM == PSMCT32 && RTPSM == PSMCT32 && RFRAME.FBW == (RTEX0.TBW / 2) && RCLAMP.WMS == CLAMP_REGION_CLAMP && RCLAMP.WMT == CLAMP_REGION_CLAMP && ((r.m_vt.m_max.t == GSVector4(64.0f, 448.0f)).mask() == 0x3)) { @@ -564,7 +564,7 @@ bool GSHwHack::GSC_SteambotChronicles(GSRendererHW& r, int& skip) if (skip == 0) { // Author: miseru99 on forums.pcsx2.net - if (RTME && RTPSM == PSM_PSMCT16S) + if (RTME && RTPSM == PSMCT16S) { if (RFBP == 0x1180) { @@ -592,7 +592,7 @@ bool GSHwHack::GSC_GetawayGames(GSRendererHW& r, int& skip) { if (skip == 0) { - if ((RFBP == 0 || RFBP == 0x1180 || RFBP == 0x1400) && RTPSM == PSM_PSMT8H && RFBMSK == 0) + if ((RFBP == 0 || RFBP == 0x1180 || RFBP == 0x1400) && RTPSM == PSMT8H && RFBMSK == 0) { skip = 1; // Removes fog wall. } @@ -614,7 +614,7 @@ bool GSHwHack::GSC_AceCombat4(GSRendererHW& r, int& skip) if (skip == 0) { - if (RTME && RFBP == 0x02a00 && RFPSM == PSM_PSMZ24 && RTBP0 == 0x01600 && RTPSM == PSM_PSMZ24) + if (RTME && RFBP == 0x02a00 && RFPSM == PSMZ24 && RTBP0 == 0x01600 && RTPSM == PSMZ24) { skip = 71; // clouds (z, 16-bit) } @@ -630,7 +630,7 @@ bool GSHwHack::GSC_FFXGames(GSRendererHW& r, int& skip) if (RTME) { // depth textures (bully, mgs3s1 intro, Front Mission 5) - if ((RTPSM == PSM_PSMZ32 || RTPSM == PSM_PSMZ24 || RTPSM == PSM_PSMZ16 || RTPSM == PSM_PSMZ16S) || + if ((RTPSM == PSMZ32 || RTPSM == PSMZ24 || RTPSM == PSMZ16 || RTPSM == PSMZ16S) || // General, often problematic post processing (GSUtil::HasSharedBits(RFBP, RFPSM, RTBP0, RTPSM))) { @@ -646,14 +646,14 @@ bool GSHwHack::GSC_Okami(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x00e00 && RFPSM == PSM_PSMCT32 && RTBP0 == 0x00000 && RTPSM == PSM_PSMCT32) + if (RTME && RFBP == 0x00e00 && RFPSM == PSMCT32 && RTBP0 == 0x00000 && RTPSM == PSMCT32) { skip = 1000; } } else { - if (RTME && RFBP == 0x00e00 && RFPSM == PSM_PSMCT32 && RTBP0 == 0x03800 && RTPSM == PSM_PSMT4) + if (RTME && RFBP == 0x00e00 && RFPSM == PSMCT32 && RTBP0 == 0x03800 && RTPSM == PSMT4) { skip = 0; } @@ -666,7 +666,7 @@ bool GSHwHack::GSC_RedDeadRevolver(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RFBP == 0x03700 && RFPSM == PSM_PSMCT32 && RTPSM == PSM_PSMCT24) + if (RFBP == 0x03700 && RFPSM == PSMCT32 && RTPSM == PSMCT24) { skip = 2; // Blur } @@ -679,23 +679,23 @@ bool GSHwHack::GSC_ShinOnimusha(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTME && RFBP == 0x001000 && (RTBP0 == 0 || RTBP0 == 0x0800) && RTPSM == PSM_PSMT8H && RFBMSK == 0x00FFFFFF) + if (RTME && RFBP == 0x001000 && (RTBP0 == 0 || RTBP0 == 0x0800) && RTPSM == PSMT8H && RFBMSK == 0x00FFFFFF) { skip = 0; // Water ripple not needed ? } - else if (RTPSM == PSM_PSMCT24 && RTME && RFBP == 0x01000) // || GSC_FBP == 0x00000 + else if (RTPSM == PSMCT24 && RTME && RFBP == 0x01000) // || GSC_FBP == 0x00000 { skip = 28; //28 30 56 64 } - else if (RFBP && RTPSM == PSM_PSMT8H && RFBMSK == 0xFFFFFF) + else if (RFBP && RTPSM == PSMT8H && RFBMSK == 0xFFFFFF) { skip = 0; //24 33 40 9 } - else if (RTPSM == PSM_PSMT8H && RFBMSK == 0xFF000000) + else if (RTPSM == PSMT8H && RFBMSK == 0xFF000000) { skip = 1; // White fog when picking up things } - else if (RTME && (RTBP0 == 0x1400 || RTBP0 == 0x1000 || RTBP0 == 0x1200) && (RTPSM == PSM_PSMCT32 || RTPSM == PSM_PSMCT24)) + else if (RTME && (RTBP0 == 0x1400 || RTBP0 == 0x1000 || RTBP0 == 0x1200) && (RTPSM == PSMCT32 || RTPSM == PSMCT24)) { skip = 1; // Eliminate excessive flooding, water and other light and shadow } @@ -708,7 +708,7 @@ bool GSHwHack::GSC_XenosagaE3(GSRendererHW& r, int& skip) { if (skip == 0) { - if (RTPSM == PSM_PSMT8H && RFBMSK >= 0xEFFFFFFF) + if (RTPSM == PSMT8H && RFBMSK >= 0xEFFFFFFF) { skip = 73; // Animation } @@ -721,7 +721,7 @@ bool GSHwHack::GSC_XenosagaE3(GSRendererHW& r, int& skip) if (RTME) { // depth textures (bully, mgs3s1 intro, Front Mission 5) - if ((RTPSM == PSM_PSMZ32 || RTPSM == PSM_PSMZ24 || RTPSM == PSM_PSMZ16 || RTPSM == PSM_PSMZ16S) || + if ((RTPSM == PSMZ32 || RTPSM == PSMZ24 || RTPSM == PSMZ16 || RTPSM == PSMZ16S) || // General, often problematic post processing (GSUtil::HasSharedBits(RFBP, RFPSM, RTBP0, RTPSM))) { @@ -742,7 +742,7 @@ bool GSHwHack::GSC_NFSUndercover(GSRendererHW& r, int& skip) const GIFRegTEX0& Texture = RTEX0; const GIFRegFRAME& Frame = RFRAME; - if (RPRIM->TME && Frame.PSM == PSM_PSMCT16S && Frame.FBMSK != 0 && Frame.FBW == 10 && Texture.TBW == 1 && Texture.TBP0 == 0x02800 && Texture.PSM == PSM_PSMZ16S) + if (RPRIM->TME && Frame.PSM == PSMCT16S && Frame.FBMSK != 0 && Frame.FBW == 10 && Texture.TBW == 1 && Texture.TBP0 == 0x02800 && Texture.PSM == PSMZ16S) { GSVertex* v = &r.m_vertex.buff[1]; v[0].XYZ.X = static_cast(RCONTEXT->XYOFFSET.OFX + (r.m_r.z << 4)); @@ -782,7 +782,7 @@ bool GSHwHack::GSC_BlueTongueGames(GSRendererHW& r, int& skip) // Catch the mipmap draws. Barnyard only uses 16/32-bit, Jurassic Park uses 24-bit. // Also used for Nicktoons Unite, same engine it appears. - if ((context->FRAME.PSM == PSM_PSMCT16S || context->FRAME.PSM <= PSM_PSMCT24) && context->FRAME.FBW <= 5) + if ((context->FRAME.PSM == PSMCT16S || context->FRAME.PSM <= PSMCT24) && context->FRAME.FBW <= 5) { r.SwPrimRender(r, true); skip = 1; @@ -814,7 +814,7 @@ bool GSHwHack::OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds && n_vertices <= 256 // Small draws. && is_copy // Copy (no blending). && !r.PRIM->TME // No texturing please. - && r.m_context->FRAME.PSM == PSM_PSMCT32 // Only 32-bit pixel format (CLUT format). + && r.m_context->FRAME.PSM == PSMCT32 // Only 32-bit pixel format (CLUT format). && !r.PRIM->FGE // No FOG. && !r.PRIM->AA1 // No antialiasing. && !r.PRIM->FIX // Normal fragment value control. @@ -868,7 +868,7 @@ bool GSHwHack::OI_BigMuthaTruckers(GSRendererHW& r, GSTexture* rt, GSTexture* ds Frame.TBW = RFRAME.FBW; Frame.TBP0 = RFRAME.Block(); - if (RPRIM->TME && Frame.TBW == 10 && Texture.TBW == 10 && Frame.TBP0 == 0x00a00 && Texture.PSM == PSM_PSMT8H && (r.m_r.y == 256 || r.m_r.y == 224)) + if (RPRIM->TME && Frame.TBW == 10 && Texture.TBW == 10 && Frame.TBP0 == 0x00a00 && Texture.PSM == PSMT8H && (r.m_r.y == 256 || r.m_r.y == 224)) { // 224 ntsc, 256 pal. GL_INS("OI_BigMuthaTruckers half bottom offset"); @@ -990,7 +990,7 @@ bool GSHwHack::OI_FFX(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCa const u32 ZBP = RZBUF.Block(); const u32 TBP = RTEX0.TBP0; - if ((FBP == 0x00d00 || FBP == 0x00000) && ZBP == 0x02100 && RPRIM->TME && TBP == 0x01a00 && RTEX0.PSM == PSM_PSMCT16S) + if ((FBP == 0x00d00 || FBP == 0x00000) && ZBP == 0x02100 && RPRIM->TME && TBP == 0x01a00 && RTEX0.PSM == PSMCT16S) { // random battle transition (z buffer written directly, clear it now) GL_INS("OI_FFX ZB clear"); diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index f25224c42d..8dd0899ce4 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -786,7 +786,7 @@ GSVector2i GSRendererHW::GetTargetSize(const GSTextureCache::Source* tex) bool GSRendererHW::IsPossibleChannelShuffle() const { - if (!PRIM->TME || m_cached_ctx.TEX0.PSM != PSM_PSMT8 || // 8-bit texture draw + if (!PRIM->TME || m_cached_ctx.TEX0.PSM != PSMT8 || // 8-bit texture draw m_vt.m_primclass != GS_SPRITE_CLASS) // draw_sprite_tex { return false; @@ -1063,8 +1063,8 @@ void GSRendererHW::SwSpriteRender() ASSERT(!m_draw_env->PABE.PABE); // No PABE // PSMCT32 pixel format - ASSERT(!PRIM->TME || m_cached_ctx.TEX0.PSM == PSM_PSMCT32); - ASSERT(m_cached_ctx.FRAME.PSM == PSM_PSMCT32); + ASSERT(!PRIM->TME || m_cached_ctx.TEX0.PSM == PSMCT32); + ASSERT(m_cached_ctx.FRAME.PSM == PSMCT32); // No rasterization required ASSERT(PRIM->PRIM == GS_SPRITE @@ -1251,13 +1251,13 @@ bool GSRendererHW::CanUseSwSpriteRender() return false; if (m_cached_ctx.DepthRead() || m_cached_ctx.DepthWrite()) // No depth handling return false; - if (m_cached_ctx.FRAME.PSM != PSM_PSMCT32) // Frame buffer format is 32 bit color + if (m_cached_ctx.FRAME.PSM != PSMCT32) // Frame buffer format is 32 bit color return false; if (PRIM->TME) { // Texture mapping enabled - if (m_cached_ctx.TEX0.PSM != PSM_PSMCT32) // Input texture format is 32 bit color + if (m_cached_ctx.TEX0.PSM != PSMCT32) // Input texture format is 32 bit color return false; if (IsMipMapDraw()) // No mipmapping. return false; @@ -1471,7 +1471,7 @@ void GSRendererHW::Draw() // When the format is 24bit (Z or C), DATE ceases to function. // It was believed that in 24bit mode all pixels pass because alpha doesn't exist // however after testing this on a PS2 it turns out nothing passes, it ignores the draw. - if ((m_cached_ctx.FRAME.PSM & 0xF) == PSM_PSMCT24 && m_context->TEST.DATE) + if ((m_cached_ctx.FRAME.PSM & 0xF) == PSMCT24 && m_context->TEST.DATE) { GL_CACHE("DATE on a 24bit format, Frame PSM %x", m_context->FRAME.PSM); return; @@ -1846,7 +1846,7 @@ void GSRendererHW::Draw() // then reinterpreting it as P8. We need to keep the off-screen intermediate textures at native resolution, // but not propagate that through to the normal render targets. Test Case: Crash Wrath of Cortex. if (no_ds && src && !m_channel_shuffle && GSConfig.UserHacks_NativePaletteDraw && src->m_from_target && - src->m_scale == 1.0f && (src->m_TEX0.PSM == PSM_PSMT8 || src->m_TEX0.TBP0 == m_cached_ctx.FRAME.Block())) + src->m_scale == 1.0f && (src->m_TEX0.PSM == PSMT8 || src->m_TEX0.TBP0 == m_cached_ctx.FRAME.Block())) { GL_CACHE("Using native resolution for target based on texture source"); target_scale = 1.0f; @@ -2804,7 +2804,7 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool // memory, which ends up with blue rubbish becuase the shuffle isn't correctly emulated. pxAssertMsg((m_context->TEX0.TBP0 & 31) == 0, "TEX0 should be page aligned"); m_cached_ctx.FRAME.FBP = m_context->TEX0.TBP0 >> 5; - m_cached_ctx.FRAME.PSM = PSM_PSMCT24; + m_cached_ctx.FRAME.PSM = PSMCT24; return true; } @@ -3600,7 +3600,7 @@ __ri void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Target* rt, if (tex && m_vt.m_primclass == GS_SPRITE_CLASS && m_vertex.next == 2 && PRIM->ABE && // Blend texture ((v[1].U == 8200 && v[1].V == 7176 && mode == GSVideoMode::NTSC) || // at display resolution 512x448 (v[1].U == 8200 && v[1].V == 8200 && mode == GSVideoMode::PAL)) && // at display resolution 512x512 - tex->m_TEX0.PSM == PSM_PSMT8H) // i.e. read the alpha channel of a 32 bits texture + tex->m_TEX0.PSM == PSMT8H) // i.e. read the alpha channel of a 32 bits texture { // Note potentially we can limit to TBP0:0x2800 @@ -3755,9 +3755,9 @@ __ri void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Target* rt, if (tex->m_palette) { // FIXME Potentially improve fmt field in GSLocalMemory - if (m_cached_ctx.TEX0.PSM == PSM_PSMT4HL) + if (m_cached_ctx.TEX0.PSM == PSMT4HL) m_conf.ps.pal_fmt = 1; - else if (m_cached_ctx.TEX0.PSM == PSM_PSMT4HH) + else if (m_cached_ctx.TEX0.PSM == PSMT4HH) m_conf.ps.pal_fmt = 2; else m_conf.ps.pal_fmt = 3; @@ -4213,7 +4213,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta #endif const GSDrawingEnvironment& env = *m_draw_env; - const bool DATE = m_cached_ctx.TEST.DATE && m_cached_ctx.FRAME.PSM != PSM_PSMCT24; + const bool DATE = m_cached_ctx.TEST.DATE && m_cached_ctx.FRAME.PSM != PSMCT24; bool DATE_PRIMID = false; bool DATE_BARRIER = false; bool DATE_one = false; diff --git a/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp b/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp index a36578a392..7918366fd9 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHWMultiISA.cpp @@ -107,7 +107,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc) // When the format is 24bit (Z or C), DATE ceases to function. // It was believed that in 24bit mode all pixels pass because alpha doesn't exist // however after testing this on a PS2 it turns out nothing passes, it ignores the draw. - if ((context->FRAME.PSM & 0xF) == PSM_PSMCT24 && context->TEST.DATE) + if ((context->FRAME.PSM & 0xF) == PSMCT24 && context->TEST.DATE) { //DevCon.Warning("DATE on a 24bit format, Frame PSM %x", context->FRAME.PSM); return false; @@ -151,7 +151,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc) } const bool fwrite = (fm & fm_mask) != fm_mask; - const bool ftest = gd.sel.atst != ATST_ALWAYS || (context->TEST.DATE && context->FRAME.PSM != PSM_PSMCT24); + const bool ftest = gd.sel.atst != ATST_ALWAYS || (context->TEST.DATE && context->FRAME.PSM != PSMCT24); const bool zwrite = zm != 0xffffffff; const bool ztest = context->TEST.ZTE && context->TEST.ZTST > ZTST_ALWAYS; @@ -410,7 +410,7 @@ bool GSRendererHWFunctions::SwPrimRender(GSRendererHW& hw, bool invalidate_tc) gd.fga = (env.FOGCOL.U32[0] >> 8) & 0x00ff00ff; } - if (context->FRAME.PSM != PSM_PSMCT24) + if (context->FRAME.PSM != PSMCT24) { gd.sel.date = context->TEST.DATE; gd.sel.datm = context->TEST.DATM; diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 804fe96599..62ec790510 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -833,7 +833,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con // 1/ it just works :) // 2/ even with upscaling // 3/ for both Direct3D and OpenGL - if (GSConfig.UserHacks_CPUFBConversion && (psm == PSM_PSMT4 || psm == PSM_PSMT8)) + if (GSConfig.UserHacks_CPUFBConversion && (psm == PSMT4 || psm == PSMT8)) { // Forces 4-bit and 8-bit frame buffer conversion to be done on the CPU instead of the GPU, but performance will be slower. // There is no dedicated shader to handle 4-bit conversion (Stuntman has been confirmed to use 4-bit). @@ -871,8 +871,8 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con } // Make sure the texture actually is INSIDE the RT, it's possibly not valid if it isn't. // Also check BP >= TBP, create source isn't equpped to expand it backwards and all data comes from the target. (GH3) - else if (GSConfig.UserHacks_TextureInsideRt >= GSTextureInRtMode::InsideTargets && psm >= PSM_PSMCT32 && - psm <= PSM_PSMCT16S && t->m_TEX0.PSM == psm && (t->Overlaps(bp, bw, psm, r) || t_wraps) && + else if (GSConfig.UserHacks_TextureInsideRt >= GSTextureInRtMode::InsideTargets && psm >= PSMCT32 && + psm <= PSMCT16S && t->m_TEX0.PSM == psm && (t->Overlaps(bp, bw, psm, r) || t_wraps) && t->m_age <= 1 && !found_t) { // PSM equality needed because CreateSource does not handle PSM conversion. @@ -1816,9 +1816,9 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r { // If it's a 32bit value and only the alpha channel is being killed // instead of losing the RGB data, drop it back to 24bit. - if (rgba._u32 == 0x8 && t->m_TEX0.PSM == PSM_PSMCT32) + if (rgba._u32 == 0x8 && t->m_TEX0.PSM == PSMCT32) { - t->m_TEX0.PSM = PSM_PSMCT24; + t->m_TEX0.PSM = PSMCT24; t->m_dirty_alpha = false; ++i; } @@ -2040,8 +2040,8 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r { Target* t = *it; - if (t->m_32_bits_fmt && t->m_TEX0.PSM > PSM_PSMZ24) - t->m_TEX0.PSM = PSM_PSMZ32; + if (t->m_32_bits_fmt && t->m_TEX0.PSM > PSMZ24) + t->m_TEX0.PSM = PSMZ32; // Check the offset of the read, if they're not pointing at or inside this texture, it's probably not what we want. //const bool expecting_this_tex = ((bp <= t->m_TEX0.TBP0 && read_start >= t->m_TEX0.TBP0) || bp >= t->m_TEX0.TBP0) && read_end <= t->m_end_block; @@ -2156,8 +2156,8 @@ void GSTextureCache::InvalidateLocalMem(const GSOffset& off, const GSVector4i& r { Target* t = *it; - if (t->m_32_bits_fmt && t->m_TEX0.PSM > PSM_PSMCT24) - t->m_TEX0.PSM = PSM_PSMCT32; + if (t->m_32_bits_fmt && t->m_TEX0.PSM > PSMCT24) + t->m_TEX0.PSM = PSMCT32; const bool exact_bp = t->m_TEX0.TBP0 == bp; // pass 0 == Exact match, pass 1 == partial match @@ -2417,7 +2417,7 @@ bool GSTextureCache::ShuffleMove(u32 BP, u32 BW, u32 PSM, int sx, int sy, int dx // from the original red/green channels, and writes to the blue/alpha channels. Who knows why they did it this way, // when they could've used sprites, but it means that they had to offset the block pointer for each move. So, we // need to use tex-in-rt here to figure out what the offset into the original PSMCT32 texture was, and HLE the move. - if (PSM != PSM_PSMCT16) + if (PSM != PSMCT16) return false; GL_CACHE("Trying ShuffleMove: BP=%04X BW=%u PSM=%u SX=%d SY=%d DX=%d DY=%d W=%d H=%d", BP, BW, PSM, sx, sy, dx, dy, w, h); @@ -2425,7 +2425,7 @@ bool GSTextureCache::ShuffleMove(u32 BP, u32 BW, u32 PSM, int sx, int sy, int dx GSTextureCache::Target* tgt = nullptr; for (auto t : m_dst[RenderTarget]) { - if (t->m_TEX0.PSM == PSM_PSMCT32 && BP >= t->m_TEX0.TBP0 && BP <= t->m_end_block) + if (t->m_TEX0.PSM == PSMCT32 && BP >= t->m_TEX0.TBP0 && BP <= t->m_end_block) { const SurfaceOffset so(ComputeSurfaceOffset(BP, BW, PSM, GSVector4i(sx, sy, sx + w, sy + h), t)); if (so.is_valid) @@ -2869,7 +2869,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con ShaderConvert shader = dst->m_type != RenderTarget ? ShaderConvert::FLOAT32_TO_RGBA8 : ShaderConvert::COPY; channel_shuffle = GSRendererHW::GetInstance()->TestChannelShuffle(dst); - const bool is_8bits = TEX0.PSM == PSM_PSMT8 && !channel_shuffle; + const bool is_8bits = TEX0.PSM == PSMT8 && !channel_shuffle; if (is_8bits) { GL_INS("Reading RT as a packed-indexed 8 bits format"); @@ -3128,7 +3128,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con ASSERT(src->m_texture); ASSERT(src->m_target == (dst != nullptr)); ASSERT(src->m_from_target == dst); - ASSERT(src->m_scale == ((!dst || (TEX0.PSM == PSM_PSMT8 && !channel_shuffle)) ? 1.0f : dst->m_scale)); + ASSERT(src->m_scale == ((!dst || (TEX0.PSM == PSMT8 && !channel_shuffle)) ? 1.0f : dst->m_scale)); if (src != m_temporary_source) { @@ -3673,29 +3673,29 @@ void GSTextureCache::Read(Target* t, const GSVector4i& r) std::unique_ptr* dltex; switch (TEX0.PSM) { - case PSM_PSMCT32: - case PSM_PSMCT24: + case PSMCT32: + case PSMCT24: fmt = GSTexture::Format::Color; ps_shader = ShaderConvert::COPY; dltex = &m_color_download_texture; break; - case PSM_PSMCT16: - case PSM_PSMCT16S: + case PSMCT16: + case PSMCT16S: fmt = GSTexture::Format::UInt16; ps_shader = ShaderConvert::RGBA8_TO_16_BITS; dltex = &m_uint16_download_texture; break; - case PSM_PSMZ32: - case PSM_PSMZ24: + case PSMZ32: + case PSMZ24: fmt = GSTexture::Format::UInt32; ps_shader = ShaderConvert::FLOAT32_TO_32_BITS; dltex = &m_uint32_download_texture; break; - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMZ16: + case PSMZ16S: fmt = GSTexture::Format::UInt16; ps_shader = ShaderConvert::FLOAT32_TO_16_BITS; dltex = &m_uint16_download_texture; @@ -3758,16 +3758,16 @@ void GSTextureCache::Read(Target* t, const GSVector4i& r) switch (TEX0.PSM) { - case PSM_PSMCT32: - case PSM_PSMZ32: - case PSM_PSMCT24: - case PSM_PSMZ24: + case PSMCT32: + case PSMZ32: + case PSMCT24: + case PSMZ24: g_gs_renderer->m_mem.WritePixel32(bits, pitch, off, r, write_mask); break; - case PSM_PSMCT16: - case PSM_PSMCT16S: - case PSM_PSMZ16: - case PSM_PSMZ16S: + case PSMCT16: + case PSMCT16S: + case PSMZ16: + case PSMZ16S: g_gs_renderer->m_mem.WritePixel16(bits, pitch, off, r); break; diff --git a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp index c56d1b8e21..4cd6341d43 100644 --- a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp +++ b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp @@ -153,7 +153,7 @@ GSTexture* GSRendererSW::GetOutput(int i, float& scale, int& y_offset) // Display doesn't use texa, and instead uses the equivalent of this GIFRegTEXA texa = {}; texa.AEM = 0; - texa.TA0 = (curFramebuffer.PSM == PSM_PSMCT24 || curFramebuffer.PSM == PSM_PSGPU24) ? 0x80 : 0; + texa.TA0 = (curFramebuffer.PSM == PSMCT24 || curFramebuffer.PSM == PSGPU24) ? 0x80 : 0; texa.TA1 = 0x80; // Top left rect @@ -966,7 +966,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) // When the format is 24bit (Z or C), DATE ceases to function. // It was believed that in 24bit mode all pixels pass because alpha doesn't exist // however after testing this on a PS2 it turns out nothing passes, it ignores the draw. - if ((m_context->FRAME.PSM & 0xF) == PSM_PSMCT24 && m_context->TEST.DATE) + if ((m_context->FRAME.PSM & 0xF) == PSMCT24 && m_context->TEST.DATE) { //DevCon.Warning("DATE on a 24bit format, Frame PSM %x", m_context->FRAME.PSM); return false; @@ -1010,7 +1010,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) } bool fwrite = (fm & fm_mask) != fm_mask; - bool ftest = gd.sel.atst != ATST_ALWAYS || (context->TEST.DATE && context->FRAME.PSM != PSM_PSMCT24); + bool ftest = gd.sel.atst != ATST_ALWAYS || (context->TEST.DATE && context->FRAME.PSM != PSMCT24); bool zwrite = zm != 0xffffffff; bool ztest = context->TEST.ZTE && context->TEST.ZTST > ZTST_ALWAYS; @@ -1285,7 +1285,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) gd.fga = (env.FOGCOL.U32[0] >> 8) & 0x00ff00ff; } - if (context->FRAME.PSM != PSM_PSMCT24) + if (context->FRAME.PSM != PSMCT24) { gd.sel.date = context->TEST.DATE; gd.sel.datm = context->TEST.DATM;