Vif: Clean up some old (incorrect) code.

This commit is contained in:
refractionpcsx2 2021-01-10 11:02:19 +00:00
parent 8ec4e40ae1
commit 89991594de
1 changed files with 2 additions and 14 deletions

View File

@ -139,24 +139,12 @@ _vifT int nVifUnpack(const u8* data) {
// to read back from it mid-transfer. Since so few games actually use partial transfers
// of VIF unpacks, this code should not be any bottleneck.
// We can optimize the calculation either way as some games have big partial chunks (Guitar Hero).
// Skipping writes are easy, filling is a bit more complex, so for now until we can
// be sure its right (if it happens) it just prints debug stuff and processes the old way.
if (!isFill) {
vifRegs.num -= (size / vSize);
}
else {
int guessedsize = (size / vSize);
guessedsize = vifRegs.num - (((guessedsize / vifRegs.cycle.cl) * (vifRegs.cycle.wl - vifRegs.cycle.cl)) + guessedsize);
while (size >= vSize) {
--vifRegs.num;
++vif.cl;
if (vif.cl <= vifRegs.cycle.cl) size -= vSize;
else if (vif.cl == vifRegs.cycle.wl) vif.cl = 0;
}
DevCon.Warning("Fill!! Partial num left = %x, guessed %x", vifRegs.num, guessedsize);
int dataSize = (size / vSize);
vifRegs.num = vifRegs.num - (((dataSize / vifRegs.cycle.cl) * (vifRegs.cycle.wl - vifRegs.cycle.cl)) + dataSize);
}
}