mirror of
https://github.com/libretro/pcsx2.git
synced 2024-12-13 21:28:38 +00:00
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:
parent
8a899c4c7b
commit
9c92a30dbb
@ -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];
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user