diff --git a/pcsx2/Hw.cpp b/pcsx2/Hw.cpp index 1e13ed661e..0623634bcd 100644 --- a/pcsx2/Hw.cpp +++ b/pcsx2/Hw.cpp @@ -30,11 +30,12 @@ static bool hwInitialized = false; void hwInit() { + // [TODO] / FIXME: PCSX2 no longer works on an Init system. It assumes that the + // static global vars for the process will be initialized when the process is created, and + // then issues *resets only* from then on. All PCSX2 if( hwInitialized ) return; VifUnpackSSE_Init(); - vif0Init(); - vif1Init(); gsInit(); sifInit(); diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index dc3663eb72..3fe205c904 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -25,9 +25,6 @@ vifStruct vif0; vifStruct vif1; tGSTransferStatus GSTransferStatus((STOPPED_MODE<<4) | (STOPPED_MODE<<2) | STOPPED_MODE); -void vif0Init() { initNewVif(0); } -void vif1Init() { initNewVif(1); } - void vif0Reset() { /* Reset the whole VIF, meaning the internal pcsx2 vars and all the registers */ diff --git a/pcsx2/Vif_Dma.h b/pcsx2/Vif_Dma.h index 5424707645..707f9febd1 100644 --- a/pcsx2/Vif_Dma.h +++ b/pcsx2/Vif_Dma.h @@ -82,13 +82,11 @@ extern vifStruct* vif; extern vifStruct vif0, vif1; extern u8 schedulepath3msk; -extern void vif0Init(); extern void vif0Interrupt(); extern void vif0Write32(u32 mem, u32 value); extern void vif0Reset(); extern void vif1Interrupt(); -extern void vif1Init(); extern void Vif1MskPath3(); extern void vif1Write32(u32 mem, u32 value); extern void vif1Reset(); diff --git a/pcsx2/Vif_Unpack.h b/pcsx2/Vif_Unpack.h index 70543a58c9..703c73ad87 100644 --- a/pcsx2/Vif_Unpack.h +++ b/pcsx2/Vif_Unpack.h @@ -52,7 +52,6 @@ struct VIFUnpackFuncTable extern const __aligned16 VIFUnpackFuncTable VIFfuncTable[32]; extern int nVifUnpack (int idx, u8 *data); -extern void initNewVif (int idx); extern void resetNewVif(int idx); extern __forceinline void vif0UnpackSetup(u32 *data); diff --git a/pcsx2/x86/newVif.h b/pcsx2/x86/newVif.h index 737791b64b..49e291d3f0 100644 --- a/pcsx2/x86/newVif.h +++ b/pcsx2/x86/newVif.h @@ -36,7 +36,6 @@ typedef void (__fastcall *nVifrecCall)(uptr dest, uptr src); extern void mVUmergeRegs(int dest, int src, int xyzw, bool modXYZW = 0); extern void _nVifUnpack (int idx, u8 *data, u32 size, bool isFill); extern void dVifUnpack (int idx, u8 *data, u32 size, bool isFill); -extern void dVifInit (int idx); extern void dVifReset (int idx); extern void dVifClose (int idx); extern void VifUnpackSSE_Init(); @@ -94,6 +93,15 @@ struct nVifStruct { BlockBuffer* vifCache; // Block Buffer HashBucket<_tParams>* vifBlocks; // Vif Blocks int numBlocks; // # of Blocks Recompiled + + nVifStruct() + { + vifCache = NULL; + vifBlocks = NULL; + numBlocks = 0; + recPtr = NULL; + recEnd = NULL; + } }; extern __aligned16 nVifStruct nVif[2]; diff --git a/pcsx2/x86/newVif_Dynarec.cpp b/pcsx2/x86/newVif_Dynarec.cpp index 23f52a19cf..db57d8ec48 100644 --- a/pcsx2/x86/newVif_Dynarec.cpp +++ b/pcsx2/x86/newVif_Dynarec.cpp @@ -21,21 +21,8 @@ #include "newVif_UnpackSSE.h" static __aligned16 nVifBlock _vBlock = {0}; -static bool dVifIsInitialized[2] = { false, false }; - -void dVifInit(int idx) { - nVif[idx].vifCache = NULL; - nVif[idx].vifBlocks = NULL; - nVif[idx].numBlocks = 0; - nVif[idx].recPtr = NULL; - nVif[idx].recEnd = NULL; - - dVifIsInitialized[idx] = true; -} void dVifReset(int idx) { - if( !dVifIsInitialized[idx] ) return; - // If the VIF cache is greater than 12mb, then it's due for a complete reset back // down to a reasonable starting point of 4mb. if( nVif[idx].vifCache && (nVif[idx].vifCache->getAllocSize() > _1mb*12) ) diff --git a/pcsx2/x86/newVif_Unpack.cpp b/pcsx2/x86/newVif_Unpack.cpp index d9911564f9..6b23083a06 100644 --- a/pcsx2/x86/newVif_Unpack.cpp +++ b/pcsx2/x86/newVif_Unpack.cpp @@ -87,11 +87,6 @@ void resetNewVif(int idx) if (newVifDynaRec) dVifReset(idx); } -void initNewVif(int idx) { - resetNewVif(idx); - if (newVifDynaRec) dVifInit(idx); -} - void closeNewVif(int idx) { if (newVifDynaRec) dVifClose(idx); }