From 71065506c10de8114c432d0efb9a25de57b16a6f Mon Sep 17 00:00:00 2001 From: refraction Date: Sat, 8 Dec 2012 13:00:31 +0000 Subject: [PATCH] Vif: Modified VIF FIFO reverse while VIF is active hack. Now just makes sure VIF is stopped before it swaps direction either way. Fixes Sled Storm. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5477 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index 0c023a9b14..c313a36a51 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -272,13 +272,17 @@ __fi void vif1STAT(u32 value) { if ((vif1Regs.stat.FDR) ^ ((tVIF_STAT&)value).FDR) { // different so can't be stalled if (vif1Regs.stat.test(VIF1_STAT_INT | VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS)) { - DevCon.WriteLn("changing dir when vif1 fifo stalled done = %x qwc = %x", vif1.done, vif1ch.qwc); - - //Hack!! Hotwheels seems to leave 1QW in the fifo and expect the DMA to be ready for a reverse FIFO - //There's no important data in there so for it to work, we will just end it. - vif1ch.chcr.STR = false; - //This is actually more important for our handling, else the DMA for reverse fifo doesnt start properly. + DevCon.WriteLn("changing dir when vif1 fifo stalled done = %x qwc = %x", vif1.done, vif1ch.qwc); } + + //Hack!! Hotwheels seems to leave 1QW in the fifo and expect the DMA to be ready for a reverse FIFO + //There's no important data in there so for it to work, we will just end it. + //Hotwheels had this in the "direction when stalled" area, however Sled Storm seems to keep an eye on the dma + //position, as we clear it and set it to the end well before the interrupt, the game assumes it's finished, + //then proceeds to reverse the dma before we have even done it ourselves. So lets just make sure VIF is ready :) + vif1ch.chcr.STR = false; + cpuRegs.interrupt &= ~((1 << DMAC_VIF1) | (1 << DMAC_MFIFO_VIF)); + //This is actually more important for our handling, else the DMA for reverse fifo doesnt start properly. } vif1Regs.stat.FDR = VIF_STAT(value).FDR;