From 702f71d5f17ed0c8de1d1e4ae40c744a52123f91 Mon Sep 17 00:00:00 2001 From: refraction Date: Tue, 18 Oct 2011 18:16:27 +0000 Subject: [PATCH] VIF: Removed the vu cycle counting craziness mentioned in r4941 comments. It was intended to pretend if the VU "ran" for longer than the VIF did, but it didn't really change a lot :P Savestate version bump again git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4942 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/SaveState.h | 2 +- pcsx2/Vif.cpp | 4 ---- pcsx2/Vif0_Dma.cpp | 15 --------------- pcsx2/Vif1_Dma.cpp | 17 ----------------- pcsx2/Vif1_MFIFO.cpp | 4 ---- pcsx2/Vif_Codes.cpp | 9 --------- pcsx2/Vif_Dma.h | 5 +---- pcsx2/Vif_Transfer.cpp | 17 ----------------- 8 files changed, 2 insertions(+), 71 deletions(-) diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 4a47fb3b54..b4ff71ff1b 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 = (0x9A04 << 16) | 0x0000; +static const u32 g_SaveVersion = (0x9A05 << 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/Vif.cpp b/pcsx2/Vif.cpp index 8aa23ecd39..2ce8ddb6c6 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -47,8 +47,6 @@ void SaveStateBase::vif0Freeze() FreezeTag("VIF0dma"); Freeze(g_vif0Cycles); - Freeze(g_vu0Cycles); - Freeze(g_packetsizeonvu0); Freeze(vif0); @@ -61,8 +59,6 @@ void SaveStateBase::vif1Freeze() FreezeTag("VIF1dma"); Freeze(g_vif1Cycles); - Freeze(g_vu1Cycles); - Freeze(g_packetsizeonvu1); Freeze(vif1); diff --git a/pcsx2/Vif0_Dma.cpp b/pcsx2/Vif0_Dma.cpp index 47256fdbda..83a13fc6b9 100644 --- a/pcsx2/Vif0_Dma.cpp +++ b/pcsx2/Vif0_Dma.cpp @@ -25,20 +25,6 @@ u32 g_vif0Cycles = 0; // because its vif stalling not the EE core... __fi void vif0FLUSH() { - if(g_packetsizeonvu0 > vif0.vifpacketsize && g_vu0Cycles > 0) - { - //DevCon.Warning("Adding on same packet"); - if( ((g_packetsizeonvu0 - vif0.vifpacketsize) >> 1) > g_vu0Cycles) - g_vu0Cycles -= (g_packetsizeonvu0 - vif0.vifpacketsize) >> 1; - else g_vu0Cycles = 0; - } - if(g_vu0Cycles > 0) - { - //DevCon.Warning("Adding %x cycles to VIF0", g_vu0Cycles * BIAS); - g_vif0Cycles += g_vu0Cycles; - g_vu0Cycles = 0; - } - g_vu0Cycles = 0; if (!(VU0.VI[REG_VPU_STAT].UL & 1)) return; if(VU0.flags & VUFLAG_MFLAGSET) { @@ -249,7 +235,6 @@ void dmaVIF0() vif0ch.tadr, vif0ch.asr0, vif0ch.asr1); g_vif0Cycles = 0; - g_vu0Cycles = 0; //if(vif0.irqoffset != 0 && vif0.vifstalled == true) DevCon.Warning("Offset on VIF0 start! offset %x, Progress %x", vif0.irqoffset, vif0.vifstalled); /*vif0.irqoffset = 0; vif0.vifstalled = false; diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index f010b7c996..ba8501c9dd 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -25,21 +25,6 @@ u32 g_vif1Cycles = 0; __fi void vif1FLUSH() { - if(g_packetsizeonvu1 > vif1.vifpacketsize && g_vu1Cycles > 0) - { - //DevCon.Warning("Adding on same packet"); - if( ((g_packetsizeonvu1 - vif1.vifpacketsize) >> 1) > g_vu1Cycles) - g_vu1Cycles -= (g_packetsizeonvu1 - vif1.vifpacketsize) >> 1; - else g_vu1Cycles = 0; - } - if(g_vu1Cycles > 0) - { - //DevCon.Warning("Adding %x cycles to VIF1", g_vu1Cycles * BIAS); - g_vif1Cycles += g_vu1Cycles; - g_vu1Cycles = 0; - - } - g_vu1Cycles = 0;//else DevCon.Warning("VIF1 Different Packet, how can i work this out :/"); if (VU0.VI[REG_VPU_STAT].UL & 0x100) { int _cycles = VU1.cycle; @@ -344,7 +329,6 @@ __fi void vif1Interrupt() vif1ch.chcr.STR = false; vif1.vifstalled = false; g_vif1Cycles = 0; - g_vu1Cycles = 0; DMA_LOG("VIF1 DMA End"); hwDmacIrq(DMAC_VIF1); @@ -364,7 +348,6 @@ void dmaVIF1() vif1.vifstalled = false; vif1.inprogress = 0;*/ g_vif1Cycles = 0; - g_vu1Cycles = 0; #ifdef PCSX2_DEVBUILD if (dmacRegs.ctrl.STD == STD_VIF1) diff --git a/pcsx2/Vif1_MFIFO.cpp b/pcsx2/Vif1_MFIFO.cpp index c967125de1..9355961a84 100644 --- a/pcsx2/Vif1_MFIFO.cpp +++ b/pcsx2/Vif1_MFIFO.cpp @@ -20,10 +20,6 @@ #include "Vif_Dma.h" u16 vifqwc = 0; -u32 g_vu0Cycles = 0; -u32 g_vu1Cycles = 0; -u32 g_packetsizeonvu0 = 0; -u32 g_packetsizeonvu1 = 0; static u32 qwctag(u32 mask) diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index cd31b538de..e2b87e232c 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -41,7 +41,6 @@ static __fi void vifFlush(int idx) { static __fi void vuExecMicro(int idx, u32 addr) { VIFregisters& vifRegs = vifXRegs; - int startcycles = 0; //vifFlush(idx); //if(vifX.vifstalled == true) return; @@ -70,17 +69,9 @@ static __fi void vuExecMicro(int idx, u32 addr) { } } - if (!idx) startcycles = VU0.cycle; - else startcycles = VU1.cycle; - if (!idx) vu0ExecMicro(addr); else vu1ExecMicro(addr); - if (!idx || !THREAD_VU1) { - if (!idx) { g_vu0Cycles += (VU0.cycle-startcycles); g_packetsizeonvu0 = vif0.vifpacketsize; } - else { g_vu1Cycles += (VU1.cycle-startcycles); g_packetsizeonvu1 = vif1.vifpacketsize; } - } - //DevCon.Warning("Ran VU%x, VU0 Cycles %x, VU1 Cycles %x, start %x cycle %x", idx, g_vu0Cycles, g_vu1Cycles, startcycles, VU1.cycle); GetVifX.vifstalled = true; } diff --git a/pcsx2/Vif_Dma.h b/pcsx2/Vif_Dma.h index c1536f9439..3e9fa0a3ba 100644 --- a/pcsx2/Vif_Dma.h +++ b/pcsx2/Vif_Dma.h @@ -119,9 +119,6 @@ static const unsigned int VIF1intc = 5; extern u32 g_vif0Cycles; extern u32 g_vif1Cycles; -extern u32 g_vu0Cycles; -extern u32 g_vu1Cycles; -extern u32 g_packetsizeonvu0; -extern u32 g_packetsizeonvu1; + extern void vif0FLUSH(); extern void vif1FLUSH(); diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index cfa13b6dd8..635fffed25 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -121,23 +121,6 @@ _vifT static __fi bool vifTransfer(u32 *data, int size, bool TTE) { vifTransferLoop(data); transferred += size - vifX.vifpacketsize; - if (!idx) { - g_packetsizeonvu0 = size; - g_vif0Cycles +=((transferred * BIAS) >> 2) ; /* guessing */ - } - else { - g_packetsizeonvu1 = size; - g_vif1Cycles +=((transferred * BIAS) >> 2) ; /* guessing */ - } - - if(!idx && g_vu0Cycles > 0) { - if (g_vif0Cycles < g_vu0Cycles) g_vu0Cycles -= g_vif0Cycles; - elif(g_vif0Cycles >= g_vu0Cycles) g_vu0Cycles = 0; - } - if (idx && g_vu1Cycles > 0) { - if (g_vif1Cycles < g_vu1Cycles) g_vu1Cycles -= g_vif1Cycles; - elif(g_vif1Cycles >= g_vu1Cycles) g_vu1Cycles = 0; - } vifX.irqoffset = transferred % 4; // cannot lose the offset