pcsx2: interpreter: add a typical example to disassemble R5900

Previous examples don't work anymore

v2: merge the cpu dump example
This commit is contained in:
Gregory Hainaut 2014-11-14 22:52:27 +01:00
parent 8a899c4c7b
commit 9c92a30dbb
2 changed files with 23 additions and 15 deletions

View File

@ -28,7 +28,7 @@ extern char* disVU1MicroLF(u32 code, u32 pc);
namespace R5900
{
void disR5900Fasm( std::string& output, u32 code, u32 pc, bool simplify);
void disR5900Fasm( std::string& output, u32 code, u32 pc, bool simplify = false);
extern const char * const GPR_REG[32];
extern const char * const COP0_REG[32];

View File

@ -45,7 +45,6 @@ static void debugI()
if( cpuRegs.GPR.n.r0.UD[0] || cpuRegs.GPR.n.r0.UD[1] ) Console.Error("R0 is not zero!!!!");
}
//long int runs=0;
void intBreakpoint(bool memcheck)
{
@ -144,23 +143,32 @@ static void execI()
debugI();
const OPCODE& opcode = GetCurrentInstruction();
#if 0
static long int runs = 0;
//use this to find out what opcodes your game uses. very slow! (rama)
//runs++;
//if (runs > 1599999999){ //leave some time to startup the testgame
// if (opcode.Name[0] == 'L') { //find all opcodes beginning with "L"
// Console.WriteLn ("Load %s", opcode.Name);
// }
//}
runs++;
if (runs > 1599999999){ //leave some time to startup the testgame
if (opcode.Name[0] == 'L') { //find all opcodes beginning with "L"
Console.WriteLn ("Load %s", opcode.Name);
}
}
#endif
// Another method of instruction dumping:
/*if( cpuRegs.cycle > 0x4f24d714 )
{
//CPU_LOG( "%s", disR5900Current.getCString());
#if 0
static long int print_me = 0;
// Based on cycle
// if( cpuRegs.cycle > 0x4f24d714 )
// Or dump from a particular PC (useful to debug handler/syscall)
if (cpuRegs.pc == 0x80000000) {
print_me = 2000;
}
if (print_me) {
print_me--;
disOut.clear();
opcode.disasm( disOut );
disOut += '\n';
disR5900Fasm(disOut, cpuRegs.code, pc);
CPU_LOG( disOut.c_str() );
}*/
}
#endif
cpuBlockCycles += opcode.cycles;