I've been trying to use my homemade cart dumper to copy the SRAM off of my Secret of Mana cart, but apparently I'm making a really stupid mistake somewhere. According to the higan manifest, the SRAM is mapped to 20-3f,a0-bf:6000-7fff, which matches up to HiROM mapping. It's also only 8KB, or 0x2000 bytes long. So, shouldn't that mean that the save file should be located within a contiguous block at 206000-2067fff? I tried dumping that block and loading it into an emulator, but it's not being recognized. I've tested it against some of my LoROM games, and they all work fine using this address translation function that byuu gave me:
So I know my dumper is still working, I'm just apparently failing at understanding the HiROM mapping scheme. So... any ideas what I'm doing wrong? Bonus points for an answer in the form of that function re-written for HiROM ^^
Code:
uint32_t SRAMAddress(uint32_t address)
{
return 0x700000 + ((address & ~0x7FFF) << 1) + (address & 0x7FFF);
}
{
return 0x700000 + ((address & ~0x7FFF) << 1) + (address & 0x7FFF);
}
So I know my dumper is still working, I'm just apparently failing at understanding the HiROM mapping scheme. So... any ideas what I'm doing wrong? Bonus points for an answer in the form of that function re-written for HiROM ^^