From 80b92bf52975655fc1abfa7bda46a379fa079e6b Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 8 Jul 2010 15:59:52 +0000 Subject: [PATCH] microVU: minor cleanup using a typedef to eliminate some redundant list.list-> syntax. :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3427 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 28 ++++++++++++++-------------- pcsx2/x86/microVU.h | 6 ++---- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index b5ef54341a..229f7fe9bb 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -91,7 +91,7 @@ _f void mVUinit(VURegs* vuRegsPtr, int vuIndex) { mVU->regAlloc = new microRegAlloc(mVU->regs); for (u32 i = 0; i < (mVU->progSize / 2); i++) { - mVU->prog.prog[i].list = new deque(); + mVU->prog.prog[i] = new deque(); } mVU->dispCache = SysMmapEx(NULL, mVUdispCacheSize, 0, (mVU->index ? "Micro VU1 Dispatcher" : "Micro VU0 Dispatcher")); @@ -133,12 +133,12 @@ _f void mVUreset(mV) { mVU->prog.x86end = (u8*)((uptr)z + (uptr)(mVU->cacheSize - mVUcacheSafeZone)); // "Safe Zone" for (u32 i = 0; i < (mVU->progSize / 2); i++) { - deque::iterator it = mVU->prog.prog[i].list->begin(); - for ( ; it != mVU->prog.prog[i].list->end(); it++) { + deque::iterator it = mVU->prog.prog[i]->begin(); + for ( ; it != mVU->prog.prog[i]->end(); it++) { if (!isVU1) mVUdeleteProg<0>(it[0]); else mVUdeleteProg<1>(it[0]); } - mVU->prog.prog[i].list->clear(); + mVU->prog.prog[i]->clear(); mVU->prog.quick[i].block = NULL; mVU->prog.quick[i].prog = NULL; } @@ -152,12 +152,12 @@ _f void mVUclose(mV) { // Delete Programs and Block Managers for (u32 i = 0; i < (mVU->progSize / 2); i++) { - deque::iterator it = mVU->prog.prog[i].list->begin(); - for ( ; it != mVU->prog.prog[i].list->end(); it++) { + deque::iterator it = mVU->prog.prog[i]->begin(); + for ( ; it != mVU->prog.prog[i]->end(); it++) { if (!isVU1) mVUdeleteProg<0>(it[0]); else mVUdeleteProg<1>(it[0]); } - safe_delete(mVU->prog.prog[i].list); + safe_delete(mVU->prog.prog[i]); } safe_delete(mVU->regAlloc); @@ -236,7 +236,7 @@ _mVUt _f microProgram* mVUcreateProg(int startPC) { double cacheUsed =((double)((u32)mVU->prog.x86ptr - (u32)mVU->prog.x86start)) / cacheSize * 100; ConsoleColors c = vuIndex ? Color_Orange : Color_Magenta; Console.WriteLn(c, "microVU%d: Cached MicroPrograms = [%03d] [PC=%04x] [List=%02d] (Cache = %3.3f%%)", - vuIndex, prog->idx, startPC, mVU->prog.prog[startPC].list->size()+1, cacheUsed); + vuIndex, prog->idx, startPC, mVU->prog.prog[startPC]->size()+1, cacheUsed); return prog; } @@ -278,15 +278,15 @@ _mVUt _f bool mVUcmpProg(microProgram& prog, const bool cmpWholeProg) { _mVUt _f void* mVUsearchProg(u32 startPC, uptr pState) { microVU* mVU = mVUx; microProgramQuick& quick = mVU->prog.quick[startPC/8]; - microProgramList& list = mVU->prog.prog [startPC/8]; + microProgramList* list = mVU->prog.prog [startPC/8]; if(!quick.prog) { // If null, we need to search for new program - deque::iterator it( list.list->begin() ); - for ( ; it != list.list->end(); it++) { + deque::iterator it( list->begin() ); + for ( ; it != list->end(); it++) { if (mVUcmpProg(*it[0], 0)) { quick.block = it[0]->block[startPC/8]; quick.prog = it[0]; - list.list->erase(it); - list.list->push_front(quick.prog); + list->erase(it); + list->push_front(quick.prog); return mVUentryGet(mVU, quick.block, startPC, pState); } } @@ -298,7 +298,7 @@ _mVUt _f void* mVUsearchProg(u32 startPC, uptr pState) { void* entryPoint = mVUblockFetch(mVU, startPC, pState); quick.block = mVU->prog.cur->block[startPC/8]; quick.prog = mVU->prog.cur; - list.list->push_front(mVU->prog.cur); + list->push_front(mVU->prog.cur); return entryPoint; } // If list.quick, then we've already found and recompiled the program ;) diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index a0eea16632..f85b29ea3a 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -132,9 +132,7 @@ struct microProgram { int idx; // Program index }; -struct microProgramList { - deque* list; // List of microPrograms who start with the same startPC value -}; +typedef deque microProgramList; struct microProgramQuick { microBlockManager* block; // Quick reference to valid microBlockManager for current startPC @@ -143,7 +141,7 @@ struct microProgramQuick { struct microProgManager { microIR IRinfo; // IR information - microProgramList prog [mProgSize/2]; // List of microPrograms indexed by startPC values + microProgramList* prog [mProgSize/2]; // List of microPrograms indexed by startPC values microProgramQuick quick[mProgSize/2]; // Quick reference to valid microPrograms for current execution microProgram* cur; // Pointer to currently running MicroProgram int total; // Total Number of valid MicroPrograms