GifPath: Fixed Reglist optimization for split transfers, might fix the Tekken 4 hang (if you are experiencing it)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3420 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-07-07 19:36:05 +00:00
parent b62dbc545a
commit 7243568e5f
1 changed files with 26 additions and 8 deletions

View File

@ -434,16 +434,26 @@ __forceinline int GIFPath::ParseTagQuick(GIF_PATH pathidx, const u8* pMem, u32 s
break; break;
case GIF_FLG_REGLIST: case GIF_FLG_REGLIST:
{ {
GIF_LOG("Reglist Mode"); GIF_LOG("Reglist Mode EOP %x", tag.EOP);
numregs = ((tag.NREG-1)&0xf) + 1; numregs = ((tag.NREG-1)&0xf) + 1;
size *= 2; size *= 2;
u32 len = aMin(size, nloop * numregs); u32 len = aMin(size, (nloop * numregs)-curreg);
if(len < (nloop * numregs)) nloop -= len / numregs;
else nloop = 0; if(len < (nloop * numregs)-curreg)
{
const int regs_not_copied = len % numregs;
curreg += regs_not_copied;
nloop -= len / numregs;
}
else nloop = 0;
incTag(8 * len, len); incTag(8 * len, len);
if (size & 1) { incTag(8, 1); } if (size & 1) { incTag(8, 1); }
size /= 2; size /= 2;
if(curreg != 0) DevCon.Warning("Oops Q %x", curreg);
if(nloop = 0) curreg = 0;
} }
break; break;
case GIF_FLG_IMAGE: case GIF_FLG_IMAGE:
@ -623,13 +633,21 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
numregs = ((tag.NREG-1)&0xf) + 1; numregs = ((tag.NREG-1)&0xf) + 1;
size *= 2; size *= 2;
u32 len = aMin(size, nloop * numregs); u32 len = aMin(size, (nloop * numregs)-curreg);
if(len < (nloop * numregs)) nloop -= len / numregs;
else nloop = 0; if(len < (nloop * numregs)-curreg)
{
const int regs_not_copied = len % numregs;
curreg += regs_not_copied;
nloop -= len / numregs;
}
else nloop = 0;
incTag(8 * len, len); incTag(8 * len, len);
if (size & 1) { incTag(8, 1); } if (size & 1) { incTag(8, 1); }
size /= 2; size /= 2;
if(curreg != 0) DevCon.Warning("Oops Q %x", curreg);
if(nloop = 0) curreg = 0;
} }
break; break;
case GIF_FLG_IMAGE: case GIF_FLG_IMAGE: