From b1eac6d058d017d2d92fba2b1f87fe27c1bad405 Mon Sep 17 00:00:00 2001 From: gabest11 Date: Sat, 19 Mar 2011 00:54:03 +0000 Subject: [PATCH] GSdx: I've mixed up the bits of TEX1.MMIN, sfex looks nice again. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4454 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSRendererSW.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index 11ed1e4e7e..3461842be6 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -353,13 +353,36 @@ void GSRendererSW::GetScanlineGlobalData(GSScanlineGlobalData& gd) if(m_mipmap && context->TEX1.MXL > 0 && context->TEX1.MMIN >= 2 && context->TEX1.MMIN <= 5 && m_vt.m_lod.y > 0) { - //gd.sel.ltf = context->TEX1.MMIN & 1; // TODO: mmag != (mmin & 1) && lod <= 0 - gd.sel.mmin = context->TEX1.MMIN >> 1; + // TEX1.MMIN + // 000 p + // 001 l + // 010 p round + // 011 p tri + // 100 l round + // 101 l tri + + // TODO: (int)m_vt.m_lod.x >= mxl => LCM == 1 + + if(m_vt.m_lod.x > 0) + { + gd.sel.ltf = (context->TEX1.MMIN & 5) ? 1 : 0; + } + else + { + // TODO: isbilinear(mmag) != isbilinear(mmin) && m_vt.m_lod.x <= 0 && m_vt.m_lod.y > 0 + } + + gd.sel.mmin = (context->TEX1.MMIN & 1) + 1; // 1: round, 2: tri gd.sel.lcm = context->TEX1.LCM; - int mxl = (std::min((int)context->TEX1.MXL, 6) << 16) - 1; + int mxl = (std::min((int)context->TEX1.MXL, 6) << 16); int k = context->TEX1.K << 12; + if(gd.sel.mmin == 2) + { + mxl--; + } + gd.mxl = GSVector4((float)mxl); gd.l = GSVector4((float)(-0x10000 << context->TEX1.L)); gd.k = GSVector4((float)k);