3 ms·
Yeah, C generally assumes a 'linear' memory space, so memory banks don't really fit into it extremely well. That said, with a little work you could likely coax
by DSMan195276 9y ago
Yeah, C generally assumes a 'linear' memory space, so memory banks don't really fit into it extremely well.
That said, with a little work you could likely coax the linker into doing a lot of the work for you. You would have to be a little careful though, as code in different banks could not effectively call each-other directly, even though the compiler would likely not yell at you. But you could just organize your code so that the code for each bank is in it's own section, and then tell the linker to link each of those sections at the address that it will be switched in at (Likely the same address for most of them). It might just barf at you, but a linker specifically for systems that do memory banking should have a way to express this.
- digi_owl 9y agoMy impression is that the banking was more often used for graphics rather than logic.
- Drakim 9y agoIt's used for both. Take for instance Super Mario Bros 3, different banks holds different data for the various enemies, and the same banks also contains the subroutines of logic for those enemies. That's why, even if you hacked so that Goomba's death behavior should point to the same as that of a Drybones, it would fail as the subroutine for that behavior isn't in the same bank as the Goomba.
- DSMan195276 9y agoThis approach can be used for code and resources. For simpler games it is easier to just not bank the code, but for more resource intensive games you can end up banking code and resources.