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
This commit is contained in:
cottonvibes 2010-03-03 14:27:11 +00:00
parent ad62866bcb
commit a93b0fe4a4
1 changed files with 14 additions and 22 deletions

View File

@ -31,15 +31,11 @@ _vifT void runMark(u32* &data) {
} }
} }
// Returns 1 if i-bit && finished vifcode && i-bit not masked && next vifcode != MARK // Returns 1 if i-bit && finished vifcode && i-bit not masked
_vifT bool analyzeIbit(u32* &data, int iBit, bool isTag) { _vifT bool analyzeIbit(u32* &data, int iBit) {
if (iBit && !vifX.cmd && !vifXRegs->err.MII) { if (iBit && !vifX.cmd && !vifXRegs->err.MII) {
//DevCon.WriteLn("Vif I-Bit IRQ"); //DevCon.WriteLn("Vif I-Bit IRQ");
vifX.irq++; vifX.irq++;
if (isTag) {
//DevCon.WriteLn("Vif isTag Hack!?");
vifX.stallontag = true;
}
runMark<idx>(data); runMark<idx>(data);
return 1; return 1;
} }
@ -47,7 +43,7 @@ _vifT bool analyzeIbit(u32* &data, int iBit, bool isTag) {
} }
// Interprets packet // Interprets packet
_vifT void vifTransferLoop(u32* &data, bool isTag) { _vifT void vifTransferLoop(u32* &data) {
u32& tSize = vifX.tag.size; u32& tSize = vifX.tag.size;
u32& pSize = vifX.vifpacketsize; u32& pSize = vifX.vifpacketsize;
int iBit = vifX.cmd >> 7; int iBit = vifX.cmd >> 7;
@ -64,20 +60,21 @@ _vifT void vifTransferLoop(u32* &data, bool isTag) {
vifXCode[vifX.cmd & 0x7f](0, data); vifXCode[vifX.cmd & 0x7f](0, data);
data++; pSize--; data++; pSize--;
if (analyzeIbit<idx>(data, iBit, isTag)) break; if (analyzeIbit<idx>(data, iBit)) break;
continue; continue;
} }
int ret = vifXCode[vifX.cmd & 0x7f](1, data); int ret = vifXCode[vifX.cmd & 0x7f](1, data);
data += ret; data += ret;
pSize -= ret; pSize -= ret;
if (analyzeIbit<idx>(data, iBit, isTag)) break; if (analyzeIbit<idx>(data, iBit)) break;
} }
if (vifX.cmd) vifXRegs->stat.VPS = VPS_WAITING; if (vifX.cmd) vifXRegs->stat.VPS = VPS_WAITING;
else vifXRegs->stat.VPS = VPS_IDLE; 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) // irqoffset necessary to add up the right qws, or else will spin (spiderman)
int transferred = vifX.vifstalled ? vifX.irqoffset : 0; 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.stallontag = false;
vifX.vifpacketsize = size; vifX.vifpacketsize = size;
vifTransferLoop<idx>(data, isTag); vifTransferLoop<idx>(data);
transferred += size - vifX.vifpacketsize; transferred += size - vifX.vifpacketsize;
g_vifCycles +=(transferred >> 2) * BIAS; /* guessing */ g_vifCycles +=(transferred >> 2) * BIAS; /* guessing */
vifX.irqoffset = transferred % 4; // cannot lose the offset vifX.irqoffset = transferred % 4; // cannot lose the offset
if (!isTag) {
transferred = transferred >> 2; transferred = transferred >> 2;
vifXch->madr +=(transferred << 4); vifXch->madr +=(transferred << 4);
vifXch->qwc -= transferred; 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) { if (vifX.irq && vifX.cmd == 0) {
//DevCon.WriteLn("Vif IRQ!"); //DevCon.WriteLn("Vif IRQ!");
vifX.vifstalled = true; vifX.vifstalled = true;
vifXRegs->stat.VIS = true; // Note: commenting this out fixes WALL-E? 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; if (!vifXch->qwc && !vifX.irqoffset) vifX.inprogress = 0;
return false; return false;
} }
@ -116,8 +108,8 @@ _vifT _f bool vifTransfer(u32 *data, int size, bool isTag) {
} }
bool VIF0transfer(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) { bool VIF1transfer(u32 *data, int size, bool istag) {
return vifTransfer<1>(data, size, istag); return vifTransfer<1>(data, size);
} }