From 73fb88384067145bd02a8ce41ddb9aebdf24531a Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Fri, 5 Mar 2010 23:52:48 +0000 Subject: [PATCH] microVU: fixed microProgram log dump code, and minor cleanups... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2675 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU.cpp | 7 +------ pcsx2/x86/microVU.h | 8 ++++---- pcsx2/x86/microVU_Analyze.inl | 3 --- pcsx2/x86/microVU_Branch.inl | 1 - pcsx2/x86/microVU_Execute.inl | 4 +--- pcsx2/x86/microVU_Log.inl | 16 ++++++++-------- pcsx2/x86/microVU_Misc.h | 11 ++--------- 7 files changed, 16 insertions(+), 34 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index c36d4fbc57..d88fdd75b2 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -93,7 +93,6 @@ _f void mVUinit(VURegs* vuRegsPtr, int vuIndex) { mVU->cache = NULL; mVU->cacheSize = mVUcacheSize; mVU->regAlloc = new microRegAlloc(mVU->regs); - mVUprint((vuIndex) ? "microVU1: init" : "microVU0: init"); // Give SysMmapEx a NULL and let the OS pick the memory for us: mVU can work with any // address the operating system gives us, and unlike the EE/IOP there's not much convenience @@ -119,8 +118,6 @@ _f void mVUinit(VURegs* vuRegsPtr, int vuIndex) { // Resets Rec Data _f void mVUreset(mV) { - mVUprint((mVU->index) ? "microVU1: reset" : "microVU0: reset"); - // Clear All Program Data //memset(&mVU->prog, 0, sizeof(mVU->prog)); memset(&mVU->prog.lpState, 0, sizeof(mVU->prog.lpState)); @@ -148,8 +145,6 @@ _f void mVUreset(mV) { // Free Allocated Resources _f void mVUclose(mV) { - mVUprint((mVU->index) ? "microVU1: close" : "microVU0: close"); - if (mVU->cache) { HostSys::Munmap(mVU->cache, mVU->cacheSize); mVU->cache = NULL; } // Delete Programs and Block Managers @@ -221,7 +216,7 @@ _mVUt _f void mVUcacheProg(microProgram& prog) { microVU* mVU = mVUx; if (!vuIndex) memcpy_const(prog.data, mVU->regs->Micro, 0x1000); else memcpy_const(prog.data, mVU->regs->Micro, 0x4000); - mVUdumpProg(prog.idx); + mVUdumpProg(prog); } // Finds and Ages/Kills Programs if they haven't been used in a while. diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index 3f7bf0cde4..bb4d8eeb7d 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -14,16 +14,16 @@ */ #pragma once -//#define mVUdebug // Prints Extra Info to Console -//#define mVUlogProg // Dumps MicroPrograms to \logs\*.html +//#define mVUlogProg // Dumps MicroPrograms to \logs\*.html class AsciiFile; + +#include #include "x86emitter/x86emitter.h" using namespace x86Emitter; +using namespace std; #include "microVU_IR.h" #include "microVU_Misc.h" -using namespace std; -#include struct microBlockLink { microBlock* block; diff --git a/pcsx2/x86/microVU_Analyze.inl b/pcsx2/x86/microVU_Analyze.inl index 9794d7d89f..61e9c0a72d 100644 --- a/pcsx2/x86/microVU_Analyze.inl +++ b/pcsx2/x86/microVU_Analyze.inl @@ -192,7 +192,6 @@ _f void mVUanalyzeMR32(mV, int Fs, int Ft) { //------------------------------------------------------------------ _f void mVUanalyzeFDIV(mV, int Fs, int Fsf, int Ft, int Ftf, u8 xCycles) { - mVUprint("microVU: DIV Opcode"); analyzeReg5(Fs, Fsf, mVUlow.VF_read[0]); analyzeReg5(Ft, Ftf, mVUlow.VF_read[1]); analyzeQreg(xCycles); @@ -203,13 +202,11 @@ _f void mVUanalyzeFDIV(mV, int Fs, int Fsf, int Ft, int Ftf, u8 xCycles) { //------------------------------------------------------------------ _f void mVUanalyzeEFU1(mV, int Fs, int Fsf, u8 xCycles) { - mVUprint("microVU: EFU Opcode"); analyzeReg5(Fs, Fsf, mVUlow.VF_read[0]); analyzePreg(xCycles); } _f void mVUanalyzeEFU2(mV, int Fs, u8 xCycles) { - mVUprint("microVU: EFU Opcode"); analyzeReg1(Fs, mVUlow.VF_read[0]); analyzePreg(xCycles); } diff --git a/pcsx2/x86/microVU_Branch.inl b/pcsx2/x86/microVU_Branch.inl index 9f10af1272..5dea78a944 100644 --- a/pcsx2/x86/microVU_Branch.inl +++ b/pcsx2/x86/microVU_Branch.inl @@ -36,7 +36,6 @@ _f void mVUendProgram(mV, microFlagCycles* mFC, int isEbit) { mVU->regAlloc->flushAll(); if (isEbit) { - mVUprint("mVUcompile ebit"); memzero(mVUinfo); memzero(mVUregsTemp); mVUincCycles(mVU, 100); // Ensures Valid P/Q instances (And sets all cycle data to 0) diff --git a/pcsx2/x86/microVU_Execute.inl b/pcsx2/x86/microVU_Execute.inl index 4258798b67..8f3b06496d 100644 --- a/pcsx2/x86/microVU_Execute.inl +++ b/pcsx2/x86/microVU_Execute.inl @@ -103,14 +103,12 @@ void mVUdispatcherB(mV) { _mVUt void* __fastcall mVUexecute(u32 startPC, u32 cycles) { microVU* mVU = mVUx; - mVUprint("microVU%x: startPC = 0x%x, cycles = 0x%x", vuIndex, startPC, cycles); + //DevCon.WriteLn("microVU%x: startPC = 0x%x, cycles = 0x%x", vuIndex, startPC, cycles); - //mVUsearchProg(startPC, 0); // Find and set correct program mVU->cycles = cycles; mVU->totalCycles = cycles; xSetPtr(mVU->prog.x86ptr); // Set x86ptr to where last program left off - //return mVUblockFetch(mVU, startPC, (uptr)&mVU->prog.lpState); return mVUsearchProg(startPC, (uptr)&mVU->prog.lpState); // Find and set correct program } diff --git a/pcsx2/x86/microVU_Log.inl b/pcsx2/x86/microVU_Log.inl index 24f1870f27..3ac4849e57 100644 --- a/pcsx2/x86/microVU_Log.inl +++ b/pcsx2/x86/microVU_Log.inl @@ -39,7 +39,7 @@ _mVUt void __mVULog(const char* fmt, ...) { #include "AppConfig.h" -_mVUt void __mVUdumpProgram(int progIndex) { +_mVUt void __mVUdumpProgram(microProgram& prog) { microVU* mVU = mVUx; bool bitX[7]; int delay = 0; @@ -48,8 +48,8 @@ _mVUt void __mVUdumpProgram(int progIndex) { int bPC = iPC; mVUbranch = 0; - const wxString logname( wxsFormat( L"microVU%d prog - %02d.html", vuIndex, progIndex) ); - mVU->logFile = new AsciiFile( Path::Combine( g_Conf->Folders.Logs, logname), L"w" ); + const wxString logname(wxsFormat(L"microVU%d prog - %02d.html", vuIndex, prog.idx)); + mVU->logFile = new AsciiFile(Path::Combine(g_Conf->Folders.Logs, logname), L"w"); mVUlog("\n"); mVUlog("microVU%d MicroProgram Log\n", vuIndex); @@ -57,16 +57,16 @@ _mVUt void __mVUdumpProgram(int progIndex) { mVUlog("\n"); mVUlog(""); - mVUlog("*********************\n
", progIndex); - mVUlog("* Micro-Program #%02d *\n
", progIndex); - mVUlog("*********************\n\n

", progIndex); + mVUlog("*********************\n
", prog.idx); + mVUlog("* Micro-Program #%02d *\n
", prog.idx); + mVUlog("*********************\n\n

", prog.idx); mVUlog("
"); for (u32 i = 0; i < mVU->progSize; i+=2) { if (delay) { delay--; mVUlog("
"); if (!delay) mVUlog("
"); } if (mVUbranch) { delay = 1; mVUbranch = 0; } - mVU->code = mVU->prog.prog[progIndex].data[i+1]; + mVU->code = prog.data[i+1]; bitX[0] = 0; bitX[1] = 0; @@ -101,7 +101,7 @@ _mVUt void __mVUdumpProgram(int progIndex) { } iPC = i; - mVU->code = mVU->prog.prog[progIndex].data[i]; + mVU->code = prog.data[i]; if(bitX[0]) { mVUlog("
\n"); diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 16f9a530d7..a863279424 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -217,20 +217,13 @@ typedef u32 (__fastcall *mVUCall)(void*, void*); #define mVUlogQ() { mVUlog(", Q"); } #define mVUlogCLIP() { mVUlog("w.xyz vf%02d, vf%02dw", _Fs_, _Ft_); } -// Debug Stuff... -#ifdef mVUdebug -#define mVUprint Console.WriteLn -#else -#define mVUprint 0&& -#endif - // Program Logging... #ifdef mVUlogProg #define mVUlog ((isVU1) ? __mVULog<1> : __mVULog<0>) #define mVUdumpProg __mVUdumpProgram #else -#define mVUlog 0&& -#define mVUdumpProg 0&& +#define mVUlog(...) if (0) {} +#define mVUdumpProg(...) if (0) {} #endif // Reg Alloc