newVif: fixed a bug... fixes Digital Devil Saga crashing.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2431 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-01-16 03:01:10 +00:00
parent 4327e93053
commit 0fd4e40286
2 changed files with 5 additions and 4 deletions

View File

@ -58,7 +58,7 @@ extern void VifUnpackSSE_Init();
#endif
// nVifBlock - Ordered for Hashing; the 'num' field and the lower 6 bits of upkType are
// used as the hash bucke selector.
// used as the hash bucket selector.
//
struct __aligned16 nVifBlock {
u8 num; // [00] Num Field

View File

@ -132,9 +132,10 @@ int nVifUnpack(int idx, u8* data) {
const bool doMode = vifRegs->mode && !(vif->tag.cmd & 0x10);
const u8 upkNum = vif->cmd & 0x1f;
const int diff = vifT - v.partTransfer;
if (size < diff) DevCon.WriteLn("newVif: Still not enough data for unpack!");
memcpy(&v.partBuffer[v.partTransfer], data, diff);
UnpackSingleTable[idx][doMode][isFill](v.partBuffer, size);
//DevCon.WriteLn("Diff = %d; vifT = %d; size = %d", diff, vifT, size);
UnpackSingleTable[idx][doMode][isFill](v.partBuffer, size + v.partTransfer);
//DevCon.WriteLn("[Diff=%d][size=%d][vifT=%d][pTrans=%d]", diff, size, vifT, v.partTransfer);
data += diff;
size -= diff;
v.partTransfer = 0;