mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
4327e93053
commit
0fd4e40286
|
@ -58,7 +58,7 @@ extern void VifUnpackSSE_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// nVifBlock - Ordered for Hashing; the 'num' field and the lower 6 bits of upkType are
|
// 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 {
|
struct __aligned16 nVifBlock {
|
||||||
u8 num; // [00] Num Field
|
u8 num; // [00] Num Field
|
||||||
|
|
|
@ -132,9 +132,10 @@ int nVifUnpack(int idx, u8* data) {
|
||||||
const bool doMode = vifRegs->mode && !(vif->tag.cmd & 0x10);
|
const bool doMode = vifRegs->mode && !(vif->tag.cmd & 0x10);
|
||||||
const u8 upkNum = vif->cmd & 0x1f;
|
const u8 upkNum = vif->cmd & 0x1f;
|
||||||
const int diff = vifT - v.partTransfer;
|
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);
|
memcpy(&v.partBuffer[v.partTransfer], data, diff);
|
||||||
UnpackSingleTable[idx][doMode][isFill](v.partBuffer, size);
|
UnpackSingleTable[idx][doMode][isFill](v.partBuffer, size + v.partTransfer);
|
||||||
//DevCon.WriteLn("Diff = %d; vifT = %d; size = %d", diff, vifT, size);
|
//DevCon.WriteLn("[Diff=%d][size=%d][vifT=%d][pTrans=%d]", diff, size, vifT, v.partTransfer);
|
||||||
data += diff;
|
data += diff;
|
||||||
size -= diff;
|
size -= diff;
|
||||||
v.partTransfer = 0;
|
v.partTransfer = 0;
|
||||||
|
@ -145,7 +146,7 @@ int nVifUnpack(int idx, u8* data) {
|
||||||
vif->tag.size = 0;
|
vif->tag.size = 0;
|
||||||
vif->cmd = 0;
|
vif->cmd = 0;
|
||||||
}
|
}
|
||||||
else { // Partial Transfer
|
else { // Partial Transfer
|
||||||
_nVifUnpack(idx, data, size, isFill);
|
_nVifUnpack(idx, data, size, isFill);
|
||||||
vif->tag.size -= ret;
|
vif->tag.size -= ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue