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

Breakpoints doesn't take in account mirrored regions on SA-1 bus

Open VitorVilela7 opened this issue 4 years ago • 3 comments

If you add a breakpoint on SA-1 bus on a bank mirrored region ($0000-$7FFF), the breakpoint will only work if it's on bank 00 or if you explicitly add the current databank on the breakpoint.

image

As seen on the above picture, even if I added a range that would breakpoint $2140, the breakpoint is only triggered when I change the breakpoint range to 0D0800~0D21FF to match the current code databank: image

It also applies when you add a breakpoint to BW-RAM ($4X:XXXX) and you attempt reading via mirrors ($XX:6000-$XX:7FFF).

VitorVilela7 avatar Dec 29 '20 21:12 VitorVilela7

$0800 through $21FF isn't even mapped to anything on the SA-1 side, since the SA-1 can't access any of the internal RAM or I/O, so trying to access the SMP from the SA-1 isn't going to work anyway.

I guess the lack of mapped memory at those addresses may be why breakpoint mirroring doesn't work, at least.

I'll see what's going on with BW-RAM mirroring when I get back home later this week and can test.

devinacker avatar Dec 30 '20 01:12 devinacker

It makes sense to unmapped memory end up not being mirrored, but I think it's important to keep them mirrored somehow since most SA-1 programming errors in my opinion involves unintentional writes to the S-CPU bus-only registers... So either mirroring them, letting wildcards on the addresses (like masking address) or add an actual feature to breakpoint unmapped memory would help a lot in the SA-1 debugging process!

VitorVilela7 avatar Dec 30 '20 01:12 VitorVilela7