bsnes-plus icon indicating copy to clipboard operation
bsnes-plus copied to clipboard

Super GameBoy Debugger requests

Open qwertymodo opened this issue 4 years ago • 13 comments

Since we've just been throwing requests at you on Discord, here's a tracker issue to... well, keep track of them.

  • ~~Better GB Bank support. This affects things like the usage log, the disassembly window, etc.~~
  • SGB Cart ROM/RAM as sources for breakpoints and in the VRAM viewer
  • ~~Stack tracking for step in/over/out when tracing the GB CPU~~
  • ~~Symbol loading~~

If I forgot any, I'll try to post them here.

qwertymodo avatar Feb 07 '20 04:02 qwertymodo

Already remembered a couple more:

  • Show the current ROM/RAM bank, maybe similarly to the SNES D/DB registers
  • A properties viewer tab to see GB/IDC2 register values

qwertymodo avatar Feb 07 '20 04:02 qwertymodo

Step over/out and run-to-IRQ are in the branch now. I might merge the current branch into master before working on some of the other stuff.

devinacker avatar Feb 08 '20 16:02 devinacker

This was brought up in Discord today, so I'll add it on here:

  • Allow detection of MSU-1 files (.msu/.pcm) that match the GB ROM file name, in addition to the SGB BIOS ROM file name

qwertymodo avatar Feb 09 '20 07:02 qwertymodo

  • List current GB ROM/RAM bank numbers in trace logs

qwertymodo avatar Feb 10 '20 17:02 qwertymodo

Symbol loading and the other associated disassembly prettiness is in sgbdebug now.

Everything else prior to that has been merged into master.

devinacker avatar Feb 12 '20 02:02 devinacker

Not debugging related, but it would be nice to have cheat support for the SGB. Rather than coming up with some kind of weird new syntax to specify that a cheat address is for the GB address space, you could just assume that nobody is every going to apply cheats to the SGB BIOS and just apply the cheats to the GB address space by default. Also, the cheat file that gets loaded should match the GB ROM filename, not the BIOS ROM.

qwertymodo avatar Feb 21 '20 19:02 qwertymodo

I was thinking about the banking support a bit, and I think for things like trace logs and usage logs, it would work to expand the address to 24 bits in order to eliminate the address overlapping due to bank swapping. It would probably require some way of abstracting the ROM bank vs RAM bank into a single GetBank(addr) where the MBC class would then decode the address to determine whether the address is ROM or RAM and return the corresponding bank number. Then, the tracelog would display the full 24-bit address instead of the current ".." prefix where the bank would go, and the usage log would avoid overlapped addresses.

qwertymodo avatar Feb 24 '20 22:02 qwertymodo

Yeah, 24-bit addressing is what I'm leaning towards (or perhaps 23-bit, if we want to assume MBC3 limitations for the sake of shrinking the usage/trace masks...)

Hopefully fetching bank numbers won't add too much overhead to the existing debugging hooks, since it'd pretty much have to do that for every GB-side memory access. It might be okay to just have libgambatte pass "pre-cooked" 24-bit addresses to the debug callbacks whenever possible, just to sidestep some of the indirection between the SGB plugin and the rest of the emulator.

devinacker avatar Feb 26 '20 03:02 devinacker

The breakpoint editor doesn't seem to support SGB symbols. For SNES addresses, the address field in the breakpoint editor has a drop-down menu that lists all of the defined symbols that you can choose from. It would be nice to be able to do the same for SGB symbols.

qwertymodo avatar Mar 10 '20 05:03 qwertymodo

It should already, provided you've selected the SGB itself as the breakpoint source.

devinacker avatar Mar 10 '20 13:03 devinacker

I have, and it doesn't seem to work. With the S-CPU bus selected as the breakpoint source, when I double-click on the Start or End address box, I get a combo text/dropdown where I can either type the address directly or select a symbol from the menu. With Super GB bus as the source, double-clicking on Start or End just gives a normal text box with no dropdown. I've tried both 5.55-master and 5.57-sgbdebug, and both have the same behavior.

qwertymodo avatar Mar 10 '20 20:03 qwertymodo

Weird, I guess I just forgot to ever add that behavior for SGB symbols somehow. Should be good in the sgbdebug branch now.

devinacker avatar Mar 10 '20 22:03 devinacker

As of ad4111a, the "slot" file name for SGB/BS-X/Sufami Turbo is now used as the base file name for MSU-1 audio tracks.

devinacker avatar Aug 22 '21 02:08 devinacker