From a93b0fe4a43d723a40e8398ad1708ad5b29fbfe8 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 3 Mar 2010 14:27:11 +0000 Subject: [PATCH] Vif - Partially removed some hack. Comment if this breaks anything. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2661 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif_Transfer.cpp | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index 7e4d5c1bee..7a7fe16181 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -31,15 +31,11 @@ _vifT void runMark(u32* &data) { } } -// Returns 1 if i-bit && finished vifcode && i-bit not masked && next vifcode != MARK -_vifT bool analyzeIbit(u32* &data, int iBit, bool isTag) { +// Returns 1 if i-bit && finished vifcode && i-bit not masked +_vifT bool analyzeIbit(u32* &data, int iBit) { if (iBit && !vifX.cmd && !vifXRegs->err.MII) { //DevCon.WriteLn("Vif I-Bit IRQ"); vifX.irq++; - if (isTag) { - //DevCon.WriteLn("Vif isTag Hack!?"); - vifX.stallontag = true; - } runMark(data); return 1; } @@ -47,7 +43,7 @@ _vifT bool analyzeIbit(u32* &data, int iBit, bool isTag) { } // Interprets packet -_vifT void vifTransferLoop(u32* &data, bool isTag) { +_vifT void vifTransferLoop(u32* &data) { u32& tSize = vifX.tag.size; u32& pSize = vifX.vifpacketsize; int iBit = vifX.cmd >> 7; @@ -64,20 +60,21 @@ _vifT void vifTransferLoop(u32* &data, bool isTag) { vifXCode[vifX.cmd & 0x7f](0, data); data++; pSize--; - if (analyzeIbit(data, iBit, isTag)) break; + if (analyzeIbit(data, iBit)) break; continue; } int ret = vifXCode[vifX.cmd & 0x7f](1, data); data += ret; pSize -= ret; - if (analyzeIbit(data, iBit, isTag)) break; + if (analyzeIbit(data, iBit)) break; } if (vifX.cmd) vifXRegs->stat.VPS = VPS_WAITING; else vifXRegs->stat.VPS = VPS_IDLE; + if (pSize) vifX.vifstalled = true; } -_vifT _f bool vifTransfer(u32 *data, int size, bool isTag) { +_vifT _f bool vifTransfer(u32 *data, int size) { // irqoffset necessary to add up the right qws, or else will spin (spiderman) int transferred = vifX.vifstalled ? vifX.irqoffset : 0; @@ -86,28 +83,23 @@ _vifT _f bool vifTransfer(u32 *data, int size, bool isTag) { vifX.stallontag = false; vifX.vifpacketsize = size; - vifTransferLoop(data, isTag); + vifTransferLoop(data); transferred += size - vifX.vifpacketsize; g_vifCycles +=(transferred >> 2) * BIAS; /* guessing */ vifX.irqoffset = transferred % 4; // cannot lose the offset - if (!isTag) { - transferred = transferred >> 2; - vifXch->madr +=(transferred << 4); - vifXch->qwc -= transferred; - } + transferred = transferred >> 2; + vifXch->madr +=(transferred << 4); + vifXch->qwc -= transferred; - if (!vifXch->qwc && (!vifX.irqoffset || isTag)) vifX.inprogress &= ~0x1; + if (!vifXch->qwc && !vifX.irqoffset) vifX.inprogress &= ~0x1; if (vifX.irq && vifX.cmd == 0) { //DevCon.WriteLn("Vif IRQ!"); vifX.vifstalled = true; vifXRegs->stat.VIS = true; // Note: commenting this out fixes WALL-E? - // spiderman doesn't break on qw boundaries - if (isTag) return false; - if (!vifXch->qwc && !vifX.irqoffset) vifX.inprogress = 0; return false; } @@ -116,8 +108,8 @@ _vifT _f bool vifTransfer(u32 *data, int size, bool isTag) { } bool VIF0transfer(u32 *data, int size, bool istag) { - return vifTransfer<0>(data, size, istag); + return vifTransfer<0>(data, size); } bool VIF1transfer(u32 *data, int size, bool istag) { - return vifTransfer<1>(data, size, istag); + return vifTransfer<1>(data, size); }