Fixed Issue 157

removed redundant code arcum pointed out I'd committed

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@991 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2009-04-16 23:28:18 +00:00
parent 1279fe2c21
commit 7308ae1b71
2 changed files with 20 additions and 33 deletions

View File

@ -1370,7 +1370,6 @@ int FIFOto_write(u32* pMem, int size)
} \ } \
} }
#define gif ((DMACh*)&PS2MEM_HW[0xA000])
extern void gsInterrupt(); extern void gsInterrupt();
int IPU1dma() int IPU1dma()

View File

@ -543,16 +543,11 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
memsize = size; memsize = size;
#endif #endif
if (vifRegs->cycle.cl >= vifRegs->cycle.wl) // skipping write
#ifdef VIFUNPACKDEBUG
if((vif->tag.addr + (size / (VIFfuncTable[ vif->cmd & 0xf ].gsize * vifRegs->cycle.wl)) *
((vifRegs->cycle.cl - vifRegs->cycle.wl) * 16)) > (u32)(VIFdmanum ? 0x4000 : 0x1000))
{ {
//Sanity Check (memory overflow)
DevCon::Notice("VIF%x Unpack ending %x > %x", params VIFdmanum, vif->tag.addr, VIFdmanum ? 0x4000 : 0x1000);
} #ifdef _DEBUG
static int s_count = 0;
#endif #endif
tempsize = (vif->tag.addr + (size / (ft->gsize * vifRegs->cycle.wl)) * tempsize = (vif->tag.addr + (size / (ft->gsize * vifRegs->cycle.wl)) *
@ -562,18 +557,11 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
if(tempsize > (u32)(VIFdmanum ? 0x4000 : 0x1000)) if(tempsize > (u32)(VIFdmanum ? 0x4000 : 0x1000))
{ {
// DevCon::Notice("VIF%x Unpack ending %x > %x", params VIFdmanum, tempsize, VIFdmanum ? 0x4000 : 0x1000); DevCon::Notice("VIF%x Unpack ending %x > %x", params VIFdmanum, tempsize, VIFdmanum ? 0x4000 : 0x1000);
tempsize = size; tempsize = size;
size = 0; size = 0;
} else tempsize = 0; } else tempsize = 0;
if (vifRegs->cycle.cl >= vifRegs->cycle.wl) // skipping write
{
#ifdef _DEBUG
static int s_count = 0;
#endif
if (size >= ft->gsize) if (size >= ft->gsize)
{ {
@ -735,8 +723,8 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
else /* filling write */ else /* filling write */
{ {
if((u32)(size / ft->gsize) < vifRegs->num && vifRegs->cycle.cl != 0) if((u32)(((size / ft->gsize) / vifRegs->cycle.cl) * vifRegs->cycle.wl) < vifRegs->num && vifRegs->cycle.cl != 0)
DevCon::Notice("Filling write warning! Size < packet size and CL != 0"); DevCon::Notice("Filling write warning! %x < %x and CL = %x WL = %x", params (size / ft->gsize), vifRegs->num, vifRegs->cycle.cl, vifRegs->cycle.wl);
VIFUNPACK_LOG("filling write %d cl %d, wl %d mask %x mode %x unpacktype %x", vifRegs->num, vifRegs->cycle.cl, vifRegs->cycle.wl, vifRegs->mask, vifRegs->mode, unpackType); VIFUNPACK_LOG("filling write %d cl %d, wl %d mask %x mode %x unpacktype %x", vifRegs->num, vifRegs->cycle.cl, vifRegs->cycle.wl, vifRegs->mask, vifRegs->mode, unpackType);
while (vifRegs->num > 0) while (vifRegs->num > 0)
@ -748,6 +736,11 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
if (vif->cl < vifRegs->cycle.cl) /* unpack one qword */ if (vif->cl < vifRegs->cycle.cl) /* unpack one qword */
{ {
if(size < ft->gsize)
{
VIF_LOG("Out of Filling write data");
break;
}
func(dest, (u32*)cdata, ft->qsize); func(dest, (u32*)cdata, ft->qsize);
cdata += ft->gsize; cdata += ft->gsize;
size -= ft->gsize; size -= ft->gsize;
@ -757,11 +750,6 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
{ {
vif->cl = 0; vif->cl = 0;
} }
if(size < ft->gsize)
{
VIF_LOG("Out of Filling write data");
break;
}
} }
else else
{ {