From b3f8c59cf48bb5eb70e27e54a875754464472bb6 Mon Sep 17 00:00:00 2001 From: refraction Date: Sat, 7 Apr 2012 12:27:19 +0000 Subject: [PATCH] -Bumped savestate version, forgot to do that in my last commit. -Fixed a bug stopping GT4 running. -VIF now waits if the VU is busy rather than spinning, causing huge slowdowns. -Filled in some bits i missed git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5149 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/SaveState.h | 2 +- pcsx2/VU0.cpp | 2 ++ pcsx2/Vif0_Dma.cpp | 5 ++++- pcsx2/Vif1_Dma.cpp | 15 ++++++++++++++- pcsx2/Vif1_MFIFO.cpp | 2 +- pcsx2/Vif_Codes.cpp | 2 +- pcsx2/x86/microVU_Macro.inl | 1 + 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 11b8745e9a..485176b32c 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -24,7 +24,7 @@ // the lower 16 bit value. IF the change is breaking of all compatibility with old // states, increment the upper 16 bit value, and clear the lower 16 bits to 0. -static const u32 g_SaveVersion = (0x9A06 << 16) | 0x0000; +static const u32 g_SaveVersion = (0x9A07 << 16) | 0x0000; // this function is meant to be used in the place of GSfreeze, and provides a safe layer // between the GS saving function and the MTGS's needs. :) diff --git a/pcsx2/VU0.cpp b/pcsx2/VU0.cpp index 9ece6dd2d5..40bd817cc8 100644 --- a/pcsx2/VU0.cpp +++ b/pcsx2/VU0.cpp @@ -29,6 +29,7 @@ #include "R5900OpcodeTables.h" #include "VUmicro.h" +#include "Vif_Dma.h" #define _Ft_ _Rt_ #define _Fs_ _Rd_ @@ -164,6 +165,7 @@ void CTC2() { case REG_CMSAR1: // REG_CMSAR1 if (!(VU0.VI[REG_VPU_STAT].UL & 0x100) ) { vu1ExecMicro(cpuRegs.GPR.r[_Rt_].US[0]); // Execute VU1 Micro SubRoutine + vif1VUFinish(); } break; default: diff --git a/pcsx2/Vif0_Dma.cpp b/pcsx2/Vif0_Dma.cpp index 0c8f73c4fd..85b720115d 100644 --- a/pcsx2/Vif0_Dma.cpp +++ b/pcsx2/Vif0_Dma.cpp @@ -157,6 +157,9 @@ __fi void vif0VUFinish() { vif0.waitforvu = false; ExecuteVU(0); + //Make sure VIF0 isnt already scheduled to spin. + if(!(cpuRegs.interrupt & 0x1)) + vif0Interrupt(); } //DevCon.Warning("VU0 state cleared"); } @@ -194,7 +197,7 @@ __fi void vif0Interrupt() if(vif0.waitforvu == true) { //DevCon.Warning("Waiting on VU0"); - CPU_INT(DMAC_VIF0, 16); + //CPU_INT(DMAC_VIF0, 16); return; } //Must go after the Stall, incase it's still in progress, GTC africa likes to see it still transferring. diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index 59a7e5d142..79c4c8cd09 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -229,6 +229,14 @@ __fi void vif1VUFinish() { vif1.waitforvu = false; ExecuteVU(1); + //Check if VIF is already scheduled to interrupt, if it's waiting, kick it :P + if((cpuRegs.interrupt & (1<