Open binary1230 opened 3 years ago
other random note for me, ignore this. (about tracelogs)
// my code in BSNES (prob doing something old now)
void Tracer::outputSgbTrace() {
char buf[256]; int len;
if (traceOutputFormatIsText) {
SNES::supergameboy.disassemble_opcode(buf, SNES::cpu.regs.pc);
^^^^^^^^^^^^^^^^^
should be: SNES::supergameboy.opcode_pc
len = strlen(buf) + 1; // byte size = string + null term
} else {
// TODO: implement // SNES::supergameboy.disassemble_opcode_bin(buf, SNES::cpu.regs.pc, len); // binary
return; // TODO: not supported just yet
}
outputTrace(buf, len);
}
my code always said SNES::cpu.regs.pc
their code now uses: SNES::supergameboy.opcode_pc
or *.opcode_pc
// their code:
unsigned addr = SNES::supergameboy.opcode_pc;
if(!traceMask || !(traceMaskSGB[addr >> 3] & (0x80 >> (addr & 7)))) {
char text[256];
SNES::supergameboy.disassemble_opcode(text, addr);
tracefile.print(string() << text << "\n");
So our usage map import works great for main CPU
In the BSNES "-usage.bin" files output though, it contains usage info for all of the various kinds of CPUs.
Right now we're just reading the first part of that file (main CPU) and ignoring the rest (SA1, SFX, SPC, etc) looks like this:
We can totally parse that stuff though :)
BSNES code is doing stuff like this:
so we'd have to replicate that to read these files. one snag is they're calling
SNES::cartridge.has_sa1()
, which means we may need the same detection routines that BSNES has to know what data is next in the file. that's... kinda unfortunate, maybe we should add some kind of tagging into the BSNES file format so we don't have to detect the file format/etc.