Did some testing on the V3_# unpacks, they do some strange stuff for what goes in the W vector every 6qw of original data. Also fixed the use of the size variable so Xmen works again.

Note: Nobody will notice this as SSE unpacks are forced on (for now)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@916 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2009-04-06 23:48:59 +00:00
parent 923802f936
commit 60e7428671
3 changed files with 16 additions and 6 deletions

View File

@ -357,8 +357,10 @@ static void _UNPACKpart(u32 offnum, u32 &x, T y)
}
template <class T>
static void _UNPACKpart(u32 offnum, u32 &x, T y, int &size)
static void _UNPACKpart(u32 offnum, u32 &x, T y, int size)
{
if(size == 0) return;
if (_vifRegs->offset == offnum)
{
switch (offnum)
@ -409,7 +411,12 @@ void __fastcall UNPACK_V3(u32 *dest, T *data, int size)
_UNPACKpart(OFFSET_X, *dest++, *data++, size);
_UNPACKpart(OFFSET_Y, *dest++, *data++, size);
_UNPACKpart(OFFSET_Z, *dest++, *data++, size);
_UNPACKpart(OFFSET_W, *dest, *data);
//V3-# does some bizzare thing with alignment, every 6qw of data the W becomes 0 (strange console!)
if((_vif->qwcalign % 24) == 0)
_UNPACKpart(OFFSET_W, *dest, 0);
else
_UNPACKpart(OFFSET_W, *dest, *data);
if (_vifRegs->offset == 4) _vifRegs->offset = 0;
}

View File

@ -440,7 +440,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
Console::WriteLn("Unpack align offset = 0");
}
destinc = (4 - ft->qsize) + unpacksize;
vif->qwcalign += unpacksize * ft->dsize;
func(dest, (u32*)cdata, unpacksize);
size -= unpacksize * ft->dsize;
cdata += unpacksize * ft->dsize;
@ -482,6 +482,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
while ((size >= ft->gsize) && (vifRegs->num > 0))
{
vif->qwcalign += ft->gsize;
func(dest, (u32*)cdata, ft->qsize);
cdata += ft->gsize;
size -= ft->gsize;
@ -595,6 +596,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
while ((size >= ft->gsize) && (vifRegs->num > 0))
{
vif->qwcalign += ft->gsize; //Must do this before the transfer, else the confusing packets dont go right :P
func(dest, (u32*)cdata, ft->qsize);
cdata += ft->gsize;
size -= ft->gsize;
@ -649,6 +651,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
//VIF_LOG("warning, end with size = %d", size);
/* unpack one qword */
vif->qwcalign += (size / ft->dsize) * ft->dsize;
func(dest, (u32*)cdata, size / ft->dsize);
size = 0;
@ -786,7 +789,7 @@ static __forceinline void vif0UNPACK(u32 *data)
len = ((((32 >> vl) * (vn + 1)) * n) + 31) >> 5;
}
vif0.wl = 0;
vif0.qwcalign = 0;
vif0.cl = 0;
vif0.tag.cmd = vif0.cmd;
vif0.tag.addr &= 0xfff;
@ -1516,9 +1519,9 @@ static __forceinline void vif1UNPACK(u32 *data)
else
vif1.tag.addr = vif1Regs->code & 0x3ff;
vif1.qwcalign = 0;
vif1.cl = 0;
vif1.tag.addr <<= 4;
vif1.tag.cmd = vif1.cmd;
}

View File

@ -32,7 +32,7 @@ struct vifStruct {
int cmd;
int irq;
int cl;
int wl;
int qwcalign;
u8 usn;
// The next three should be boolean, and will be next time I break savestate compatability. --arcum42