bsnes-plus
bsnes-plus copied to clipboard
Super GameBoy Debugger requests
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.
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
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.
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
- List current GB ROM/RAM bank numbers in trace logs
Symbol loading and the other associated disassembly prettiness is in sgbdebug now.
Everything else prior to that has been merged into master.
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.
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.
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.
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.
It should already, provided you've selected the SGB itself as the breakpoint source.
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.
Weird, I guess I just forgot to ever add that behavior for SGB symbols somehow. Should be good in the sgbdebug branch now.
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.