From c53ecee57234aa1387412b8699e71136d6d63470 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Thu, 18 Mar 2010 04:52:57 +0000 Subject: [PATCH] Fixed a bug in the newVif unpack dynarec with filling writes... (was some optimization i had, but only was working correctly for skipping writes...) Fixes half-life... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2732 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/newVif_Dynarec.cpp | 7 ++++--- pcsx2/x86/newVif_Unpack.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pcsx2/x86/newVif_Dynarec.cpp b/pcsx2/x86/newVif_Dynarec.cpp index 51e0105372..6f57d6d237 100644 --- a/pcsx2/x86/newVif_Dynarec.cpp +++ b/pcsx2/x86/newVif_Dynarec.cpp @@ -57,8 +57,8 @@ _f void VifUnpackSSE_Dynarec::SetMasks(int cS) const { u32 m3 = (m1>>1) & ~m0; u32* row = (v.idx) ? g_vifmask.Row1 : g_vifmask.Row0; u32* col = (v.idx) ? g_vifmask.Col1 : g_vifmask.Col0; - if((m2&&doMask) || doMode) { xMOVAPS(xmmRow, ptr32[row]); } - if (m3&&doMask) { + if (isFill||(m2&&doMask)||doMode) { xMOVAPS(xmmRow, ptr32[row]); } + if (isFill||(m3&&doMask)) { xMOVAPS(xmmCol0, ptr32[col]); if ((cS>=2) && (m3&0x0000ff00)) xPSHUF.D(xmmCol1, xmmCol0, _v1); if ((cS>=3) && (m3&0x00ff0000)) xPSHUF.D(xmmCol2, xmmCol0, _v2); @@ -135,7 +135,8 @@ void VifUnpackSSE_Dynarec::CompileRoutine() { vCL = v.vif->cl; doMode = upkNum == 0xf ? 0 : doMode; - SetMasks(cycleSize); + // Value passed determines # of col regs we need to load + SetMasks(isFill ? blockSize : cycleSize); while (vNum) { diff --git a/pcsx2/x86/newVif_Unpack.cpp b/pcsx2/x86/newVif_Unpack.cpp index a2eda151f7..aba3436b07 100644 --- a/pcsx2/x86/newVif_Unpack.cpp +++ b/pcsx2/x86/newVif_Unpack.cpp @@ -127,10 +127,10 @@ int nVifUnpack(int idx, u8* data) { data = v.buffer; size = v.bSize; } - if (size > 0) { + if (size > 0 || isFill) { if (newVifDynaRec) dVifUnpack(idx, data, size, isFill); else _nVifUnpack(idx, data, size, isFill); - } else if (isFill) _nVifUnpack(idx, data, size, isFill); + } vif->tag.size = 0; vif->cmd = 0; v.bSize = 0;