From c755435eeb9b825575698ae0a05ec03974b7e9bc Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Tue, 19 Jun 2012 00:12:35 +0000 Subject: [PATCH] GSDX: Do not interpret TEXA while filling the gsdx internal temporary CLUT buffer used in texture creation and updating (I didn't realise this was happening and it's incompatible with my approach). Probably generally fixes stuff in combination with the other changes in palette handling, at the very least I know it fixes lines in sprites in Ar Tonelico 2 (currently needs the "sprite hack"), a bug which I spent a long time trying to fix after it was pointed out to me before. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5309 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSRendererHW.cpp | 2 -- plugins/GSdx/GSTextureCache.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index cb27133cab..13a332b1cd 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -206,8 +206,6 @@ void GSRendererHW::Draw() if(PRIM->TME) { - m_mem.m_clut.Read32(context->TEX0, env.TEXA); - GSVector4i r; GetTextureMinMax(r, context->TEX0, context->CLAMP, m_vt.IsLinear()); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 15e85bdbb6..418a9005c3 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -57,6 +57,14 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con { const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM]; const GSLocalMemory::psm_t& cpsm = psm.pal > 0 ? GSLocalMemory::m_psm[TEX0.CPSM] : psm; + + GIFRegTEXA plainTEXA; + + plainTEXA.AEM = 1; + plainTEXA.TA0 = 0; + plainTEXA.TA1 = 0x80; + m_renderer->m_mem.m_clut.Read32(TEX0, plainTEXA); + const uint32* clut = m_renderer->m_mem.m_clut; Source* src = NULL; @@ -1036,6 +1044,8 @@ void GSTextureCache::Source::Flush(uint32 count) pitch >>= 2; rtx = psm.rtxP; } + else if (psm.pal > 0) + m_renderer->m_mem.m_clut.Read32(m_TEX0, m_TEXA); uint8* buff = m_temp;