From b0b5c27fec502284297c109acc8a8a009e585b82 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 10 Dec 2016 12:34:57 +0100 Subject: [PATCH] vif: remove useless state from nVifStruct --- pcsx2/x86/newVif.h | 13 +++++-------- pcsx2/x86/newVif_Dynarec.cpp | 7 ++----- pcsx2/x86/newVif_Unpack.cpp | 3 --- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pcsx2/x86/newVif.h b/pcsx2/x86/newVif.h index bdef4c468c..f78211e0d5 100644 --- a/pcsx2/x86/newVif.h +++ b/pcsx2/x86/newVif.h @@ -78,19 +78,16 @@ struct nVifStruct { // Maximum buffer size is 256 (vifRegs.Num max range) * 16 (quadword) __aligned16 u8 buffer[256*16]; u32 bSize; // Size of 'buffer' - u32 bPtr; - - uint recReserveSizeMB; // reserve size, in megabytes. - RecompiledCodeReserve* recReserve; - u8* recWritePtr; // current write pos into the reserve - - HashBucket<_tParams>* vifBlocks; // Vif Blocks - int numBlocks; // # of Blocks Recompiled // VIF0 or VIF1 - provided for debugging helpfulness only, and is generally unused. // (templates are used for most or all VIF indexing) u32 idx; + RecompiledCodeReserve* recReserve; + u8* recWritePtr; // current write pos into the reserve + + HashBucket<_tParams>* vifBlocks; // Vif Blocks + nVifStruct(); }; diff --git a/pcsx2/x86/newVif_Dynarec.cpp b/pcsx2/x86/newVif_Dynarec.cpp index b9160f8ab3..b1794607b8 100644 --- a/pcsx2/x86/newVif_Dynarec.cpp +++ b/pcsx2/x86/newVif_Dynarec.cpp @@ -26,7 +26,7 @@ void dVifReserve(int idx) { if(!nVif[idx].recReserve) nVif[idx].recReserve = new RecompiledCodeReserve(pxsFmt(L"VIF%u Unpack Recompiler Cache", idx), _8mb); - nVif[idx].recReserve->Reserve( nVif[idx].recReserveSizeMB * _1mb, idx ? HostMemoryMap::VIF1rec : HostMemoryMap::VIF0rec ); + nVif[idx].recReserve->Reserve( 8 * _1mb, idx ? HostMemoryMap::VIF1rec : HostMemoryMap::VIF0rec ); } void dVifReset(int idx) { @@ -39,13 +39,10 @@ void dVifReset(int idx) { nVif[idx].recReserve->Reset(); - nVif[idx].numBlocks = 0; nVif[idx].recWritePtr = nVif[idx].recReserve->GetPtr(); - //memset(nVif[idx].recWritePtr, 0xcc, nVif[idx].recReserveSizeMB * _1mb); } void dVifClose(int idx) { - nVif[idx].numBlocks = 0; if (nVif[idx].recReserve) nVif[idx].recReserve->Reset(); @@ -341,7 +338,7 @@ _vifT __fi void dVifUnpack(const u8* data, bool isFill) { // values here which cause false recblock cache misses. v.block.mask = doMask ? vifRegs.mask : 0; - //DevCon.WriteLn("nVif%d: Recompiled Block! [%d]", idx, nVif[idx].numBlocks++); + //DevCon.WriteLn("nVif%d: Recompiled Block!", idx); //DevCon.WriteLn(L"[num=% 3d][upkType=0x%02x][scl=%d][cl=%d][wl=%d][mode=%d][m=%d][mask=%s]", // v.Block.num, v.Block.upkType, v.Block.scl, v.Block.cl, v.Block.wl, v.Block.mode, // doMask >> 4, doMask ? wxsFormat( L"0x%08x", v.Block.mask ).c_str() : L"ignored" diff --git a/pcsx2/x86/newVif_Unpack.cpp b/pcsx2/x86/newVif_Unpack.cpp index 0886bcf0b1..78f8006306 100644 --- a/pcsx2/x86/newVif_Unpack.cpp +++ b/pcsx2/x86/newVif_Unpack.cpp @@ -74,9 +74,6 @@ static const __aligned16 Fnptr_VifUnpackLoop UnpackLoopTable[2][2][2] = { nVifStruct::nVifStruct() { vifBlocks = NULL; - numBlocks = 0; - - recReserveSizeMB = 8; } void reserveNewVif(int idx)