microVU: fixed microProgram log dump code, and minor cleanups...

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2675 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-03-05 23:52:48 +00:00
parent 123545eeb1
commit 73fb883840
7 changed files with 16 additions and 34 deletions

View File

@ -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.

View File

@ -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 <deque>
#include "x86emitter/x86emitter.h"
using namespace x86Emitter;
using namespace std;
#include "microVU_IR.h"
#include "microVU_Misc.h"
using namespace std;
#include <deque>
struct microBlockLink {
microBlock* block;

View File

@ -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);
}

View File

@ -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)

View File

@ -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<vuIndex>(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<vuIndex>(startPC, (uptr)&mVU->prog.lpState); // Find and set correct program
}

View File

@ -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("<html>\n");
mVUlog("<title>microVU%d MicroProgram Log</title>\n", vuIndex);
@ -57,16 +57,16 @@ _mVUt void __mVUdumpProgram(int progIndex) {
mVUlog("<font face=\"Courier New\" color=\"#ffffff\">\n");
mVUlog("<font size=\"5\" color=\"#7099ff\">");
mVUlog("*********************\n<br>", progIndex);
mVUlog("* Micro-Program #%02d *\n<br>", progIndex);
mVUlog("*********************\n\n<br><br>", progIndex);
mVUlog("*********************\n<br>", prog.idx);
mVUlog("* Micro-Program #%02d *\n<br>", prog.idx);
mVUlog("*********************\n\n<br><br>", prog.idx);
mVUlog("</font>");
for (u32 i = 0; i < mVU->progSize; i+=2) {
if (delay) { delay--; mVUlog("</font>"); if (!delay) mVUlog("<hr/>"); }
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("<br>\n<font color=\"#FF7000\">");

View File

@ -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<vuIndex>
#else
#define mVUlog 0&&
#define mVUdumpProg 0&&
#define mVUlog(...) if (0) {}
#define mVUdumpProg(...) if (0) {}
#endif
// Reg Alloc