From f905ea60f5d6ea907866b5c55bbae44f365e3dc2 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 18 Oct 2008 10:09:06 +0000 Subject: [PATCH] Assorted cleanup. Deleting and commenting out unused variables & code, and a few minor changes to the Linux code. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@213 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/Cache.c | 4 +-- pcsx2/DebugTools/DisR5900asm.c | 23 ++++++------- pcsx2/Elfheader.c | 15 ++++----- pcsx2/GS.cpp | 1 - pcsx2/IPU/IPU.c | 11 +++++-- pcsx2/Linux/GtkGui.h | 35 -------------------- pcsx2/Linux/Linux.h | 38 ++++++++++++++++++++++ pcsx2/Linux/LnxMain.c | 10 ++++++ pcsx2/Linux/LnxMain.h | 6 ++-- pcsx2/Misc.c | 2 +- pcsx2/PsxCounters.c | 11 +++---- pcsx2/PsxDma.c | 4 +-- pcsx2/Vif.c | 2 -- pcsx2/VifDma.c | 4 +-- pcsx2/windows/VCprojects/pcsx2_2008.vcproj | 12 ++++--- pcsx2/x86/iCore.h | 2 ++ pcsx2/x86/iR3000A.cpp | 13 ++++++-- pcsx2/x86/iVU0micro.c | 6 ++-- pcsx2/x86/iVU1micro.c | 5 +-- pcsx2/x86/iVUmicro.c | 24 +++++++------- pcsx2/x86/iVUzerorec.cpp | 37 +++++++++++---------- pcsx2/x86/ix86-32/iR5900-32.c | 4 +-- pcsx2/x86/ix86-64/iR5900-64.c | 8 ++--- pcsx2/x86/ix86-64/iR5900AritImm-64.c | 2 -- pcsx2/x86/ix86-64/iR5900LoadStore-64.c | 5 --- pcsx2/x86/ix86-64/iR5900Move-64.c | 1 - pcsx2/x86/ix86/ix86_cpudetect.c | 1 + 27 files changed, 151 insertions(+), 135 deletions(-) diff --git a/pcsx2/Cache.c b/pcsx2/Cache.c index 67a759e38b..cbd66506f0 100644 --- a/pcsx2/Cache.c +++ b/pcsx2/Cache.c @@ -51,7 +51,7 @@ int getFreeCache(u32 mem, int mode, int * way) { if(pCache[i].tag[number] & 0x60) // Valid Dirty { - t = (char *)(taddr[number]); + t = (char *)(taddr[number]); // fixme - this should probably be cast to (u8*) out = (u8*)(t + (mem & 0xFC0)); ((u64*)out)[0] = ((u64*)pCache[i].data[number][0].b8._8)[0]; ((u64*)out)[1] = ((u64*)pCache[i].data[number][0].b8._8)[1]; @@ -328,7 +328,7 @@ void CACHE() { { int index = (addr >> 6) & 0x3F; int way = addr & 0x1; - u8 * out = pCache[index].data[way][(addr>>4) & 0x3].b8._8; + //u8 * out = pCache[index].data[way][(addr>>4) & 0x3].b8._8; *(u32*)(&pCache[index].data[way][(addr>>4) & 0x3].b8._8[(addr&0xf)]) = cpuRegs.CP0.r[28]; #ifdef CACHE_LOG CACHE_LOG("CACHE DXSDT addr %x, index %d, way %d, DATA %x\n",addr,index,way,cpuRegs.CP0.r[28]); diff --git a/pcsx2/DebugTools/DisR5900asm.c b/pcsx2/DebugTools/DisR5900asm.c index cdafb99a6c..e4528ead30 100644 --- a/pcsx2/DebugTools/DisR5900asm.c +++ b/pcsx2/DebugTools/DisR5900asm.c @@ -1531,26 +1531,27 @@ void P_BC2TL(char *buf){ sprintf(buf, "bc2tl\t%s", offset_decode()); } const char *dest_string(void) { - static char str[5]; - int i; - i = 0; - if(_X) str[i++] = 'x'; - if(_Y) str[i++] = 'y'; - if(_Z) str[i++] = 'z'; - if(_W) str[i++] = 'w'; - str[i++] = 0; - return (const char *)str; + static char str[5]; + int i = 0; + + if(_X) str[i++] = 'x'; + if(_Y) str[i++] = 'y'; + if(_Z) str[i++] = 'z'; + if(_W) str[i++] = 'w'; + str[i++] = 0; + + return (const char *)str; } char dest_fsf() { - const arr[4] = { 'x', 'y', 'z', 'w' }; + const char arr[4] = { 'x', 'y', 'z', 'w' }; return arr[(cpuRegs.code>>21)&3]; } char dest_ftf() { - const arr[4] = { 'x', 'y', 'z', 'w' }; + const char arr[4] = { 'x', 'y', 'z', 'w' }; return arr[(cpuRegs.code>>23)&3]; } diff --git a/pcsx2/Elfheader.c b/pcsx2/Elfheader.c index 31d79e01a2..f405089f0f 100644 --- a/pcsx2/Elfheader.c +++ b/pcsx2/Elfheader.c @@ -165,10 +165,10 @@ unsigned int parseCommandLine( char *filename ) i; args_ptr -= 256; - if ( args_ptr < 0 ) + /*if ( args_ptr < 0 ) //fixme - This, of course is impossible. { return 0; - } + }*/ args[ 255 ] = 0; memcpy( &PS2MEM_BASE[ args_ptr ], args, 256 ); //params 1, 2, etc copied memset( &PS2MEM_BASE[ args_ptr + strlen( args ) ], 0, 256 - strlen( args ) ); @@ -188,10 +188,10 @@ unsigned int parseCommandLine( char *filename ) p = filename; } args_ptr -= strlen( p ) + 1; - if ( args_ptr < 0 ) + /* if ( args_ptr < 0 ) // fixme- This is still impossible. { return 0; - } + }*/ strcpy( (char*)&PS2MEM_BASE[ args_ptr ], p ); //fill param 0; i.e. name of the program for ( i = strlen( p ) + 1 + 256, argc = 0; i > 0; i-- ) @@ -211,7 +211,7 @@ unsigned int parseCommandLine( char *filename ) if ( ( PS2MEM_BASE[ args_ptr + i ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i ] != 32 ) ) { //i==0 argc++; - if ( args_ptr - 4 - 4 - argc * 4 < 0 ) + if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int? { return 0; } @@ -222,7 +222,7 @@ unsigned int parseCommandLine( char *filename ) if ( ( PS2MEM_BASE[ args_ptr + i + 1 ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i + 1 ] != 32 ) ) { argc++; - if ( args_ptr - 4 - 4 - argc * 4 < 0 ) + if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int? { return 0; } @@ -565,8 +565,7 @@ extern int LoadPatch(char *patchfile); extern void LoadGameSpecificSettings(); int loadElfFile(char *filename) { - char str[256]; - char str2[256]; + char str[256],str2[256]; u32 crc; u32 i; diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index b08dfc8114..e044025314 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -1259,7 +1259,6 @@ void dmaGIF() { #define spr0 ((DMACh*)&PS2MEM_HW[0xD000]) static unsigned int mfifocycles; -static unsigned int giftempqwc = 0; static unsigned int gifqwc = 0; static unsigned int gifdone = 0; diff --git a/pcsx2/IPU/IPU.c b/pcsx2/IPU/IPU.c index 149fbd1ad7..33bd51d3f7 100644 --- a/pcsx2/IPU/IPU.c +++ b/pcsx2/IPU/IPU.c @@ -404,13 +404,18 @@ void ipuConstRead64(u32 mem, int mmreg) #else -int ipuConstRead32(u32 x86reg, u32 mem) +int ipuConstRead32(u32 x86reg, u32 mem) { + // Let's see if this ever gets called + printf("ipuConstRead32 called on a 64-bit system!\n"); assert(0); + return 0; //It won't return, but it makes the compiler happy. } void ipuConstRead64(u32 mem, int mmreg) { + // Let's see if this ever gets called + printf("ipuConstRead64 called on a 64-bit system!\n"); assert(0); } @@ -1928,8 +1933,8 @@ int IPU0dma() int readsize; void* pMem; - int qwc = ipu0dma->qwc; - u32 chcr = ipu0dma->chcr; + //int qwc = ipu0dma->qwc; + //u32 chcr = ipu0dma->chcr; if( !(ipu0dma->chcr & 0x100) || (cpuRegs.interrupt & (1<key)) shift = 1; + if (CAPS_LOCK_EVT(ev->key)) + { + //Set up anything we want to happen while caps lock is down. + //Config_hacks_backup = Config.Hacks; + } switch (ev->key) { case XK_F1: ProcessFKeys(1, shift); break; @@ -327,6 +332,11 @@ void KeyEvent(keyEvent* ev) { { if (SHIFT_EVT(ev->key)) shift = 0; + if (CAPS_LOCK_EVT(ev->key)) + { + //Release caps lock + //Config_hacks_backup = Config.Hacks; + } } return; diff --git a/pcsx2/Linux/LnxMain.h b/pcsx2/Linux/LnxMain.h index 2658891007..8d6bf4b969 100644 --- a/pcsx2/Linux/LnxMain.h +++ b/pcsx2/Linux/LnxMain.h @@ -43,10 +43,10 @@ char* phelpmsg = "\n" #endif "Load Plugins:\n" - "\t-cdvd [dllpath] {specify the dll load path of the CDVD plugin}\n" - "\t-gs [dllpath] {specify the dll load path of the GS plugin}\n" + "\t-cdvd [libpath] {specify the library load path of the CDVD plugin}\n" + "\t-gs [libpath] {specify the library load path of the GS plugin}\n" "-pad [tsxcal] {specify to hold down on the triangle, square, circle, x, start, select buttons}\n" - "\t-spu [dllpath] {specify the dll load path of the SPU2 plugin}\n" + "\t-spu [libpath] {specify the library load path of the SPU2 plugin}\n" "\n"; #endif diff --git a/pcsx2/Misc.c b/pcsx2/Misc.c index 9483e63be0..eceb9da32c 100644 --- a/pcsx2/Misc.c +++ b/pcsx2/Misc.c @@ -758,7 +758,7 @@ int SaveGSState(char *file) return 0; } -extern long pDsp; +extern uptr pDsp; int LoadGSState(char *file) { int ret; diff --git a/pcsx2/PsxCounters.c b/pcsx2/PsxCounters.c index 5ea516a760..cd1ba9b6cd 100644 --- a/pcsx2/PsxCounters.c +++ b/pcsx2/PsxCounters.c @@ -22,7 +22,6 @@ psxCounter psxCounters[8]; u32 psxNextCounter, psxNextsCounter; -static int cnts = 6; u8 psxhblankgate = 0; u8 psxvblankgate = 0; u8 psxcntmask = 0; @@ -35,12 +34,12 @@ static void psxRcntUpd32(u32 index) { psxCounters[index].sCycleT = psxRegs.cycle; } -static void psxRcntReset16(u32 index) { - psxCounters[index].count = 0; +//static void psxRcntReset16(u32 index) { +// psxCounters[index].count = 0; - psxCounters[index].mode&= ~0x18301C00; - psxRcntUpd16(index); -} +// psxCounters[index].mode&= ~0x18301C00; +// psxRcntUpd16(index); +//} static void psxRcntReset32(u32 index) { psxCounters[index].count = 0; diff --git a/pcsx2/PsxDma.c b/pcsx2/PsxDma.c index c5656dafc8..bcfb913643 100644 --- a/pcsx2/PsxDma.c +++ b/pcsx2/PsxDma.c @@ -166,7 +166,7 @@ int psxDma7Interrupt() { extern int eesifbusy[2]; void psxDma9(u32 madr, u32 bcr, u32 chcr) { - DMACh *dma = (DMACh*)&PS2MEM_HW[0xc000]; + //DMACh *dma = (DMACh*)&PS2MEM_HW[0xc000]; //Not used #ifdef SIF_LOG SIF_LOG("IOP: dmaSIF0 chcr = %lx, madr = %lx, bcr = %lx, tadr = %lx\n", chcr, madr, bcr, HW_DMA9_TADR); @@ -182,7 +182,7 @@ void psxDma9(u32 madr, u32 bcr, u32 chcr) { } void psxDma10(u32 madr, u32 bcr, u32 chcr) { - DMACh *dma = (DMACh*)&PS2MEM_HW[0xc400]; + //DMACh *dma = (DMACh*)&PS2MEM_HW[0xc400]; //Not used #ifdef SIF_LOG SIF_LOG("IOP: dmaSIF1 chcr = %lx, madr = %lx, bcr = %lx\n", chcr, madr, bcr); diff --git a/pcsx2/Vif.c b/pcsx2/Vif.c index b755e94ac8..2d614804f8 100644 --- a/pcsx2/Vif.c +++ b/pcsx2/Vif.c @@ -37,7 +37,6 @@ u32* _vifRow = NULL, *_vifCol = NULL; vifStruct *_vif; static int n; -static int i; __inline static int _limit( int a, int max ) { @@ -484,7 +483,6 @@ __inline int mfifoVIF1chain() { } #define spr0 ((DMACh*)&PS2MEM_HW[0xD000]) -static int tempqwc = 0; void mfifoVIF1transfer(int qwc) { u32 *ptag; diff --git a/pcsx2/VifDma.c b/pcsx2/VifDma.c index f8d5be6bf6..19f7e11432 100644 --- a/pcsx2/VifDma.c +++ b/pcsx2/VifDma.c @@ -1176,7 +1176,7 @@ int VIF0transfer(u32 *data, int size, int istag) { int _VIF0chain() { u32 *pMem; - u32 qwc = vif0ch->qwc; + //u32 qwc = vif0ch->qwc; u32 ret; if (vif0ch->qwc == 0 && vif0.vifstalled == 0) return 0; @@ -2084,7 +2084,7 @@ int VIF1transfer(u32 *data, int size, int istag) { int _VIF1chain() { u32 *pMem; - u32 qwc = vif1ch->qwc; + //u32 qwc = vif1ch->qwc; u32 ret; diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 62cd061251..211d53ba22 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -1,7 +1,7 @@ - - @@ -756,6 +754,10 @@ RelativePath="..\cheats\cheats.h" > + + =0&&((reg)&MEM_PSXCONSTTAG)) #define IS_MMXREG(reg) (reg>=0&&((reg)&MEM_MMXTAG)) #define IS_XMMREG(reg) (reg>=0&&((reg)&MEM_XMMTAG)) + +// fixme - these 4 are only called for u32 registers; should the reg>=0 really be there? #define IS_X86REG(reg) (reg>=0&&((reg)&MEM_X86TAG)) #define IS_GPRREG(reg) (reg>=0&&((reg)&MEM_GPRTAG)) #define IS_CONSTREG(reg) (reg>=0&&((reg)&MEM_CONSTTAG)) diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 89697b2e4c..bce680e331 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -64,6 +64,8 @@ u32 g_psxMaxRecMem = 0; extern char *disRNameGPR[]; extern char* disR3000Fasm(u32 code, u32 pc); +u32 s_psxrecblocks[] = {0}; + void psxRecRecompile(u32 startpc); uptr *psxRecLUT; @@ -79,7 +81,6 @@ uptr *psxRecLUT; // R3000A statics int psxreclog = 0; -static u32 s_BranchCount = 0; static char *recMem; // the recompiled blocks will be here static BASEBLOCK *recRAM; // and the ptr to the blocks here static BASEBLOCK *recROM; // and here @@ -93,7 +94,11 @@ static u32 s_nInstCacheSize = 0; static BASEBLOCK* s_pCurBlock = NULL; static BASEBLOCKEX* s_pCurBlockEx = NULL; + +#if defined(_MSC_VER) && !defined(__x86_64__) static BASEBLOCK* s_pDispatchBlock = NULL; +#endif + static u32 s_nEndBlock = 0; // what psxpc the current block ends static u32 s_nNextBlock = 0; // next free block in recBlocks @@ -140,6 +145,7 @@ BASEBLOCKEX* PSX_GETBLOCKEX(BASEBLOCK* p) } //////////////////////////////////////////////////// +#ifdef _DEBUG static void iDumpBlock( int startpc, char * ptr ) { FILE *f; @@ -224,6 +230,7 @@ sprintf( filename, "dumps\\psxdump%.8X.txt", startpc); f = fopen( filename, "a+" ); #endif } +#endif u8 _psxLoadWritesRs(u32 tempcode) { @@ -1197,6 +1204,7 @@ void iDumpPsxRegisters(u32 startpc, u32 temp) void iDumpPsxRegisters(u32 startpc); +#ifdef _DEBUG static void printfn() { static int lastrec = 0; @@ -1227,8 +1235,7 @@ static void printfn() lastrec = g_psxlastpc; } } - -u32 s_psxrecblocks[] = {0}; +#endif void psxRecRecompile(u32 startpc) { diff --git a/pcsx2/x86/iVU0micro.c b/pcsx2/x86/iVU0micro.c index 0a59689425..2434344109 100644 --- a/pcsx2/x86/iVU0micro.c +++ b/pcsx2/x86/iVU0micro.c @@ -51,9 +51,9 @@ static VURegs * const VU = (VURegs*)&VU0; extern u32 vudump; #endif -static u32 vuprogcount = 0; +//static u32 vuprogcount = 0; -void recExecuteVU0Block( void ) +void recExecuteVU0Block( void ) // fixme - are all these comments at all useful, or can they be removed? { //SysPrintf("executeVU0 %x\n", VU0.VI[ REG_TPC ].UL); //QueryPerformanceCounter(&vu0base); @@ -64,7 +64,7 @@ void recExecuteVU0Block( void ) return; } #ifdef _DEBUG - vuprogcount++; + //vuprogcount++; // __Log("VU: %x %x\n", VU0.VI[ REG_TPC ].UL, vuprogcount); // iDumpVU0Registers(); diff --git a/pcsx2/x86/iVU1micro.c b/pcsx2/x86/iVU1micro.c index 8e468ebeaf..ceeba45c31 100644 --- a/pcsx2/x86/iVU1micro.c +++ b/pcsx2/x86/iVU1micro.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "Common.h" #include "InterTables.h" @@ -50,8 +51,6 @@ u32 vu1recpcold = -1; u32 vu1reccountold = -1; -static _vuopinfo _opinfo[256]; - //Lower/Upper instructions can use that.. #define _Ft_ ((VU1.code >> 16) & 0x1F) // The rt part of the instruction register #define _Fs_ ((VU1.code >> 11) & 0x1F) // The rd part of the instruction register @@ -83,8 +82,6 @@ static _vuopinfo _opinfo[256]; #define VU1_ACCz_ADDR (uptr)&VU1.ACC.UL[2] #define VU1_ACCw_ADDR (uptr)&VU1.ACC.UL[3] -static void VU1RecompileBlock(void); - void recVU1Init() { SuperVUInit(1); diff --git a/pcsx2/x86/iVUmicro.c b/pcsx2/x86/iVUmicro.c index f254102856..de396ce97b 100644 --- a/pcsx2/x86/iVUmicro.c +++ b/pcsx2/x86/iVUmicro.c @@ -3808,13 +3808,13 @@ void recVUMI_RSQRT(VURegs *VU, int info) AND32ItoR( EAX, 0x01 ); // Grab "Is Zero" bits from the previous calculation ajmp32 = JZ32(0); // Skip if none are - OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag + OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag - _unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_); - SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]); - SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax - SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP); - bjmp32 = JMP32(0); + _unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_); + SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]); + SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax + SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP); + bjmp32 = JMP32(0); x86SetJ32(ajmp32); } @@ -3844,13 +3844,13 @@ void recVUMI_RSQRT(VURegs *VU, int info) AND32ItoR( EAX, 0x01 ); // Grab "Is Zero" bits from the previous calculation ajmp32 = JZ32(0); // Skip if none are - OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag + OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag - _unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_); - SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]); - SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax - SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP); - bjmp32 = JMP32(0); + _unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_); + SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]); + SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax + SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP); + bjmp32 = JMP32(0); x86SetJ32(ajmp32); } diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 10ef0b7321..e354ff89e1 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -524,7 +524,6 @@ void SuperVUDumpBlock(list& blocks, int vuindex) char filename[ 256 ], str[256]; u32 *mem; u32 i; - static int gid = 0; #ifdef _WIN32 CreateDirectory("dumps", NULL); @@ -973,8 +972,7 @@ static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const V // count inst non-dummy insts itinst = pblock->insts.begin(); - u32 inst = 0; - int cycleoff = 0; + int cycleoff = 0; while(dummyinst > 0) { if( itinst->type & INST_DUMMY ) @@ -2390,7 +2388,7 @@ uptr s_vu1ebp, s_vuebx, s_vuedi, s_vu1esi; static int s_recWriteQ, s_recWriteP; // wait times during recompilation static int s_needFlush; // first bit - Q, second bit - P, third bit - Q has been written, fourth bit - P has been written -static u32 s_ssecsr; +//static u32 s_ssecsr; static int s_JumpX86; static int s_ScheduleXGKICK = 0, s_XGKICKReg = -1; @@ -2605,10 +2603,14 @@ static void SuperVURecompile() } // debug -static u32 s_svulast = 0, s_vufnheader; + +#ifdef _DEBUG extern "C" u32 s_vucount; -u32 g_vu1lastrec = 0, skipparent = -1; + +static u32 g_vu1lastrec = 0, skipparent = -1; +static u32 s_svulast = 0, s_vufnheader; static u32 badaddrs[][2] = {0,0xffff}; +#endif extern "C" { #ifndef __x86_64__ @@ -2623,8 +2625,6 @@ u32 g_curdebugvu; #if defined(_MSC_VER) && !defined(__x86_64__) __declspec(naked) static void svudispfn() { - static u32 i; - __asm { mov g_curdebugvu, eax mov s_saveecx, ecx @@ -2640,7 +2640,6 @@ extern "C" void svudispfn(); extern "C" void svudispfntemp() { - static u32 i; #endif // VU1.VF[7].F[0] = vuDouble(VU1.VF[7].UL[0]); @@ -2649,7 +2648,9 @@ extern "C" void svudispfntemp() // VU1.VF[7].F[3] = vuDouble(VU1.VF[7].UL[3]); #ifdef _DEBUG - if( ((vudump&8) && g_curdebugvu) || ((vudump&0x80) && !g_curdebugvu) ) { //&& g_vu1lastrec != g_vu1last ) { + static u32 i; + + if( ((vudump&8) && g_curdebugvu) || ((vudump&0x80) && !g_curdebugvu) ) { //&& g_vu1lastrec != g_vu1last ) { if( skipparent != g_vu1lastrec ) { for(i = 0; i < ARRAYSIZE(badaddrs); ++i) { @@ -2685,7 +2686,7 @@ extern "C" void svudispfntemp() #endif } -// frees an xmmreg depending on the liveness info of hte current inst +// frees an xmmreg depending on the liveness info of the current inst //void SuperVUFreeXMMreg(int xmmreg, int xmmtype, int reg) //{ // if( !xmmregs[xmmreg].inuse ) return; @@ -3151,18 +3152,18 @@ int VuInstruction::SetCachedRegs(int upper, u32 vuxyz) return info; } -static void checkvucodefn(u32 curpc, u32 vuindex, u32 oldcode) -{ - SysPrintf("vu%c code changed (old:%x, new: %x)! %x %x\n", '0'+vuindex, oldcode, s_vu?*(u32*)&VU1.Micro[curpc]:*(u32*)&VU0.Micro[curpc], curpc, cpuRegs.cycle); -} +//static void checkvucodefn(u32 curpc, u32 vuindex, u32 oldcode) +//{ +// SysPrintf("vu%c code changed (old:%x, new: %x)! %x %x\n", '0'+vuindex, oldcode, s_vu?*(u32*)&VU1.Micro[curpc]:*(u32*)&VU0.Micro[curpc], curpc, cpuRegs.cycle); +//} void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) { static PCSX2_ALIGNED16(VECTOR _VF); - static PCSX2_ALIGNED16(VECTOR _VFc); + static PCSX2_ALIGNED16(VECTOR _VFc); u32 *ptr; u8* pjmp; - int vfregstore=0, viregstore=0; + int vfregstore=0; assert( s_pCurInst == this); s_WriteToReadQ = 0; @@ -3673,7 +3674,7 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) #endif // check if inst before branch and the write is the same as the read in the branch (wipeout) - int oldreg=0; +// int oldreg=0; // if( pc == s_pCurBlock->endpc-16 ) { // itinst2 = itinst; ++itinst2; // if( itinst2->regs[0].pipe == VUPIPE_BRANCH && (itinst->regs[0].VIwrite&itinst2->regs[0].VIread) ) { diff --git a/pcsx2/x86/ix86-32/iR5900-32.c b/pcsx2/x86/ix86-32/iR5900-32.c index 8df50464c2..14786cddb4 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.c +++ b/pcsx2/x86/ix86-32/iR5900-32.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "Common.h" #include "Memory.h" @@ -2768,9 +2769,8 @@ extern u32 psxdump; static void printfn() { static int lastrec = 0; - static int curcount = 0, count2 = 0; + static int curcount = 0; const int skip = 0; - static int i; assert( !g_globalMMXSaved ); assert( !g_globalXMMSaved ); diff --git a/pcsx2/x86/ix86-64/iR5900-64.c b/pcsx2/x86/ix86-64/iR5900-64.c index de555c95a4..f1568d494b 100644 --- a/pcsx2/x86/ix86-64/iR5900-64.c +++ b/pcsx2/x86/ix86-64/iR5900-64.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "Common.h" #include "Memory.h" @@ -79,7 +80,7 @@ u32 g_EEFreezeRegs = 0; // if set, should freeze the regs static BASEBLOCK* s_pCurBlock = NULL; static BASEBLOCKEX* s_pCurBlockEx = NULL; -static BASEBLOCK* s_pDispatchBlock = NULL; +//static BASEBLOCK* s_pDispatchBlock = NULL; static u32 s_nEndBlock = 0; // what pc the current block ends static u32 s_nHasDelay = 0; @@ -1965,7 +1966,7 @@ static void checkcodefn() { int pctemp; - __asm__("movl %%eax, %0" : "=m"(pctemp) ); + __asm__("movl %%eax, %0" : "=m"(pctemp) ); SysPrintf("code changed! %x\n", pctemp); assert(0); @@ -2233,9 +2234,8 @@ extern u32 psxdump; static void printfn() { static int lastrec = 0; - static int curcount = 0, count2 = 0; + static int curcount = 0; const int skip = 0; - static int i; assert( !g_globalXMMSaved ); diff --git a/pcsx2/x86/ix86-64/iR5900AritImm-64.c b/pcsx2/x86/ix86-64/iR5900AritImm-64.c index 90e3c5cae7..4c31f31882 100644 --- a/pcsx2/x86/ix86-64/iR5900AritImm-64.c +++ b/pcsx2/x86/ix86-64/iR5900AritImm-64.c @@ -75,8 +75,6 @@ void recADDIU( void ) //////////////////////////////////////////////////// void recDADDI( void ) { - int rsreg; - int rtreg; if (!_Rt_) return; diff --git a/pcsx2/x86/ix86-64/iR5900LoadStore-64.c b/pcsx2/x86/ix86-64/iR5900LoadStore-64.c index 0fcf55cb29..bddeb4ba43 100644 --- a/pcsx2/x86/ix86-64/iR5900LoadStore-64.c +++ b/pcsx2/x86/ix86-64/iR5900LoadStore-64.c @@ -152,11 +152,6 @@ void tests() { //////////////////////////////////////////////////// void recLW( void ) { - int rsreg; - int rtreg; - int t0reg; - int t1reg; - int t2reg; iFlushCall(FLUSH_EVERYTHING); diff --git a/pcsx2/x86/ix86-64/iR5900Move-64.c b/pcsx2/x86/ix86-64/iR5900Move-64.c index 4d37837e67..90b64aaeb6 100644 --- a/pcsx2/x86/ix86-64/iR5900Move-64.c +++ b/pcsx2/x86/ix86-64/iR5900Move-64.c @@ -73,7 +73,6 @@ REC_FUNC( MTLO1, 0 ); //////////////////////////////////////////////////// void recLUI( void ) { - int rtreg; if (!_Rt_) return; diff --git a/pcsx2/x86/ix86/ix86_cpudetect.c b/pcsx2/x86/ix86/ix86_cpudetect.c index 016e0d5535..df6e1d5833 100644 --- a/pcsx2/x86/ix86/ix86_cpudetect.c +++ b/pcsx2/x86/ix86/ix86_cpudetect.c @@ -23,6 +23,7 @@ #include #include "ix86.h" +#include "Misc.h" #if defined (_MSC_VER) && _MSC_VER >= 1400