From ca25a31d79cc0636d6497d819701a4a328a19a7a Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 28 Jan 2023 22:40:37 -0600 Subject: [PATCH] GS: Display output ignores TEXA --- pcsx2/GS/Renderers/SW/GSRendererSW.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp index 8c9f1edbc3..3fdf961409 100644 --- a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp +++ b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp @@ -173,8 +173,14 @@ GSTexture* GSRendererSW::GetOutput(int i, int& y_offset) const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[DISPFB.PSM]; + // Display doesn't use texa, and instead uses the equivalent of this + GIFRegTEXA texa = {}; + texa.AEM = 0; + texa.TA0 = (DISPFB.PSM == PSM_PSMCT24 || DISPFB.PSM == PSM_PSGPU24) ? 0x80 : 0; + texa.TA1 = 0x80; + // Top left rect - psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), r.ralign(psm.bs), m_output, pitch, m_env.TEXA); + psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), r.ralign(psm.bs), m_output, pitch, texa); int top = (h_wrap) ? ((r.bottom - r.top) * pitch) : 0; int left = (w_wrap) ? (r.right - r.left) * (GSLocalMemory::m_psm[DISPFB.PSM].bpp / 8) : 0; @@ -183,18 +189,18 @@ GSTexture* GSRendererSW::GetOutput(int i, int& y_offset) // Top right rect if (w_wrap) - psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rw.ralign(psm.bs), &m_output[left], pitch, m_env.TEXA); + psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rw.ralign(psm.bs), &m_output[left], pitch, texa); // Bottom left rect if (h_wrap) - psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rh.ralign(psm.bs), &m_output[top], pitch, m_env.TEXA); + psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rh.ralign(psm.bs), &m_output[top], pitch, texa); // Bottom right rect if (h_wrap && w_wrap) { // Needs also rw with the start/end height of rh, fills in the bottom right rect which will be missing if both overflow. const GSVector4i rwh(rw.left, rh.top, rw.right, rh.bottom); - psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rwh.ralign(psm.bs), &m_output[top + left], pitch, m_env.TEXA); + psm.rtx(m_mem, m_mem.GetOffset(DISPFB.Block(), DISPFB.FBW, DISPFB.PSM), rwh.ralign(psm.bs), &m_output[top + left], pitch, texa); } m_texture[i]->Update(out_r, m_output, pitch);