diff --git a/pcsx2/x86/newVif.h b/pcsx2/x86/newVif.h index 4a996321f2..bf3e840836 100644 --- a/pcsx2/x86/newVif.h +++ b/pcsx2/x86/newVif.h @@ -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 diff --git a/pcsx2/x86/newVif_Unpack.cpp b/pcsx2/x86/newVif_Unpack.cpp index 9bd714d4a9..ed806168fe 100644 --- a/pcsx2/x86/newVif_Unpack.cpp +++ b/pcsx2/x86/newVif_Unpack.cpp @@ -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; @@ -145,7 +146,7 @@ int nVifUnpack(int idx, u8* data) { vif->tag.size = 0; vif->cmd = 0; } - else { // Partial Transfer + else { // Partial Transfer _nVifUnpack(idx, data, size, isFill); vif->tag.size -= ret; }