Not really specific to Everdrives, but I've always wondered how the mapping switch takes place when a backup unit goes from the OS to the game ROM and back.
For those not certain what I'm talking about, what I mean is the part of the flash that the OS is on comes up in the "start" address space of the SNES on power on. This is how we see the Super Everdrive, Double Pro Fighter, etc menu right away. At some point, the currently executing OS is magically and instantaneously "replaced" when the ROM is remapped with the user selected game. If this hand over were not carefully controlled and timed, we would be executing the OS one second loading our game and programming the CPLD to remap the address space with the flashed game ROM, then suddenly executing random game cart code or data mid execution when the selected game is mapped to the bus in the same address where the OS ROM used to be.
Two methods I see:
1) OS places and then jumps to some code in the host device's RAM which does the final CPLD programming to map the ROM into current address space, then jumps to the reset vector of the newly mapped ROM. This works, but once the switch occurs, RAM is wiped out and you have no way to return to your OS. The CPLD somehow has to know on reset to change the mapping back again before the SNES takes the reset vector.
2) The CPLD itself monitors the bus and decides what to map in whenever it detects software reset. So you could remap and program everything you needed without fear of your OS disappearing, and on the next reset vector the CPLD automatically does the address space swap. OS just "resets itself" when it's done, knowing that it's going to be a game there instead of itself.
Above, 1) doesn't seem to be the case on the Everdrive, because you can hit reset and return to the Everdrive OS when it can't possibly be in RAM anymore after game code execution has wiped it. 2) makes the most logical sense?
Care to share any info? What are the methods for detecting resets and controlling the address space changeover back and forth? My primary assumption is that the OS and a game ROM cannot be mapped at the same time, or the largest 32-48 mbit ROMs would not be possible.
TLDR: wondering how the dynamic remapping of the physical address space occurs mid execution (of the OS), as when loading a game ROM into the same start location that the OS started in.
Actually looking at getting back into SNES dev, though I am spoiled by GBA's flat linear no nonsense address space. No hirom, lorom, strange mirrors, or diff bus speeds or split bank complexities. But alas no SPC700
For those not certain what I'm talking about, what I mean is the part of the flash that the OS is on comes up in the "start" address space of the SNES on power on. This is how we see the Super Everdrive, Double Pro Fighter, etc menu right away. At some point, the currently executing OS is magically and instantaneously "replaced" when the ROM is remapped with the user selected game. If this hand over were not carefully controlled and timed, we would be executing the OS one second loading our game and programming the CPLD to remap the address space with the flashed game ROM, then suddenly executing random game cart code or data mid execution when the selected game is mapped to the bus in the same address where the OS ROM used to be.
Two methods I see:
1) OS places and then jumps to some code in the host device's RAM which does the final CPLD programming to map the ROM into current address space, then jumps to the reset vector of the newly mapped ROM. This works, but once the switch occurs, RAM is wiped out and you have no way to return to your OS. The CPLD somehow has to know on reset to change the mapping back again before the SNES takes the reset vector.
2) The CPLD itself monitors the bus and decides what to map in whenever it detects software reset. So you could remap and program everything you needed without fear of your OS disappearing, and on the next reset vector the CPLD automatically does the address space swap. OS just "resets itself" when it's done, knowing that it's going to be a game there instead of itself.
Above, 1) doesn't seem to be the case on the Everdrive, because you can hit reset and return to the Everdrive OS when it can't possibly be in RAM anymore after game code execution has wiped it. 2) makes the most logical sense?
Care to share any info? What are the methods for detecting resets and controlling the address space changeover back and forth? My primary assumption is that the OS and a game ROM cannot be mapped at the same time, or the largest 32-48 mbit ROMs would not be possible.
TLDR: wondering how the dynamic remapping of the physical address space occurs mid execution (of the OS), as when loading a game ROM into the same start location that the OS started in.
Actually looking at getting back into SNES dev, though I am spoiled by GBA's flat linear no nonsense address space. No hirom, lorom, strange mirrors, or diff bus speeds or split bank complexities. But alas no SPC700
