Regression fix for GT4, crashes presumably due to the zero division on this check

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1007 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2009-04-18 15:02:41 +00:00
parent 71e391d010
commit a4abcf1206
1 changed files with 2 additions and 1 deletions

View File

@ -732,7 +732,8 @@ static void VIFunpack(u32 *data, vifCode *v, unsigned int size, const unsigned i
else /* filling write */
{
if((u32)(((size / ft->gsize) / vifRegs->cycle.cl) * vifRegs->cycle.wl) < vifRegs->num && vifRegs->cycle.cl != 0)
if(vifRegs->cycle.cl > 0) // Quicker and avoids zero division :P
if((u32)(((size / ft->gsize) / vifRegs->cycle.cl) * vifRegs->cycle.wl) < vifRegs->num)
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);