Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report - in SNES SA-1 addresses 0x020000 to 0x0200ff are not exposed correctly #747

Open
Blazekickn opened this issue Jul 7, 2021 · 2 comments

Comments

@Blazekickn
Copy link

image

Shown above is a SMW hack that uses SA-1. Player Power-Up address is supposed to be at 0x020019 (SA-1 offsets the ram by 0x020000 from where it would be in the base game) but instead the region is filled with 0x60. 0x02010b is Level ID and that shows correctly and matches with the vanilla SMW, along with the rest of my notes.

@Blazekickn
Copy link
Author

worth noting that i was using RASnes9x, I tested it in RALibretro and it still wasn't correct but showed different junk data (Mostly 00s)

@Jamiras
Copy link
Member

Jamiras commented Jul 8, 2021

RA memory addresses usually do not correspond to actual system addresses. With the exception of systems where the entire memory is mapped (NES/GB), it's usually system memory followed by cartridge memory. That's true for SNES as well. RA addresses $000000-$1FFFFF correspond to the 2MB of system memory normally addressed from $7E0000-$7FFFFF. RA addresses $200000-$3FFFFF are for the cartridge memory normally addressed from $FE0000-$FFFFFF.

It looks like the SA-1 chip largely remaps the memory.

When you activate SA-1, two types of RAM are added and one is deleted. In other words, I-RAM and BW-RAM are added while SRAM is deleted.

As best as I can tell, the I-RAM lives from $003000-$0031FF, and the BW-RAM from $400000-$41FFFF. As the BW-RAM is mostly a direct replacement for the SRAM, it would make sense for the cores to treat it as such, and that's probably what you're seeing from $20000-$3FFFF in the memory inspector. The I-RAM probably needs an additional mapping entry.

The difference between SNES9x and libretro is probably in the mapping. SNES9x is mapping the SRAM directly and probably captures the BW-RAM. libretro exposes a memory map and the SRAM is captured from $FE0000-$FFFFFF. If the core exposes BW-RAM at $400000-$41FFFF, it may not be possible to share the same addresses in the memory inspector. I'm unable to test at this time.

Further investigation is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants