From de62189834d989e743ea80e8cbabd5e46840dec5 Mon Sep 17 00:00:00 2001 From: refraction Date: Tue, 22 May 2012 12:31:56 +0000 Subject: [PATCH] Path3 Masking: Fix for Need For Speed Underground - This got broken when the new GIF Unit went in, probably affects many games which use streams of NOP commands before issuing the mask. Game still requires EE Timing Fix however. VIF Stall Delay hack: Modified slightly for Onimusha Blade Warriors. This expects the end of the packet to all be in the VIF1 FIFO (which doesn't exist) and the VIF to have finished, so the Stall is technically ignored now, doesn't hurt SOCOM 2. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5220 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif1_Dma.cpp | 2 +- pcsx2/Vif_Codes.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index 79c4c8cd09..14319655dd 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -295,7 +295,7 @@ __fi void vif1Interrupt() //NFSHPS stalls when the whole packet has gone across (it stalls in the last 32bit cmd) //In this case VIF will end vif1Regs.stat.FQC = min((u16)0x10, vif1ch.qwc); - if(vif1ch.qwc > 0 || !vif1.done) + if((vif1ch.qwc > 0 || !vif1.done) && !CHECK_VIF1STALLHACK) { VIF_LOG("VIF1 Stalled"); return; diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index b7678bd823..2da7299eee 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -358,7 +358,17 @@ vifOp(vifCode_MskPath3) { } vifOp(vifCode_Nop) { - pass1 { GetVifX.cmd = 0; } + pass1 { + GetVifX.cmd = 0; + if(idx && vif1ch.chcr.STR == true) + { + //Some games use a huge stream of NOPS to wait for a GIF packet to start, alas the way PCSX2 works it never starts + //So the mask can go on before the packet continues, causing desync. + + if(((data[1] >> 24) & 0x7f) == 0x6) //Look in to the future and see if we have a mask path 3 command (NFSU) + GetVifX.vifstalled = true; //Stall if we do to get the timing right. + } + } pass3 { VifCodeLog("Nop"); } return 0; }