diff --git a/pcsx2/DebugTools/Debug.h b/pcsx2/DebugTools/Debug.h index e5b1950287..9e9e4b0fdb 100644 --- a/pcsx2/DebugTools/Debug.h +++ b/pcsx2/DebugTools/Debug.h @@ -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]; diff --git a/pcsx2/Interpreter.cpp b/pcsx2/Interpreter.cpp index 2706f3f7b0..1beddd1dba 100644 --- a/pcsx2/Interpreter.cpp +++ b/pcsx2/Interpreter.cpp @@ -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;