From c475b36daa50aa8fd364d21e9aa98a47ffa30b41 Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 19 Mar 2010 01:30:35 +0000 Subject: [PATCH] Updated cotton's MARK test, the last one completely killed Max Payne, explained why in the file. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2743 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif_Transfer.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index 794a90518d..e4c9425b59 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -24,9 +24,9 @@ // Doesn't stall if the next vifCode is the Mark command _vifT bool runMark(u32* &data) { - if (vifX.vifpacketsize && (((data[0]>>24)&0x7f)==7)) { - Console.WriteLn("Vif%d: Running Mark after I-bit", idx); - return 0; // No Stall? + if (((vifXRegs->code >> 24) & 0x7f) == 0x7) { + Console.WriteLn("Vif%d: Running Mark with I-bit", idx); + return 1; // No Stall? } return 1; // Stall } @@ -38,12 +38,21 @@ _vifT bool analyzeIbit(u32* &data, int iBit) { vifX.irq++; // On i-bit, the command is run, vif stalls etc, // however if the vifcode is MARK, you do NOT stall, just send IRQ. - Max Payne shows this up. - if((vifX.cmd & 0x7f) == 0x7) return 0; + //if(((vifXRegs->code >> 24) & 0x7f) == 0x7) return 0; // If we have a vifcode with i-bit, the following instruction // should stall unless its MARK?.. we test that case here... // Not 100% sure if this is the correct behavior, so printing // a console message to see games that use this. (cottonvibes) + + // Okay did some testing with Max Payne, it does this + // VifMark value = 0x666 (i know, evil!) + // NOP with I Bit + // VifMark value = 0 + // + // If you break after the 2nd Mark has run, the game reports invalid mark 0 and the game dies. + // So it has to occur here, testing a theory that it only doesn't stall if the command with + // the iBit IS mark, but still sends the IRQ to let the cpu know the mark is there. (Refraction) return runMark(data); } return 0; @@ -103,8 +112,11 @@ _vifT _f bool vifTransfer(u32 *data, int size) { if (vifX.irq && vifX.cmd == 0) { //DevCon.WriteLn("Vif IRQ!"); - vifX.vifstalled = true; - vifXRegs->stat.VIS = true; // Note: commenting this out fixes WALL-E? + if(((vifXRegs->code >> 24) & 0x7f) != 0x7) + { + vifX.vifstalled = true; + vifXRegs->stat.VIS = true; // Note: commenting this out fixes WALL-E? + } if (!vifXch->qwc && !vifX.irqoffset) vifX.inprogress = 0; return false;