IIRC, the bug has to do with how Stella handles the BRK opcode when the stack pointer is...$FF? Or something. So, technically, it doesn't have anything to do with how I'm bankswitching - the routine that bankswitches is called with a BRK opcode, which Stella doesn't like. If you start it in the debugger and step through the code you can see where it goes goofy; I can't remember exactly what happens, but it has to do with the stack pointer.
...
Just got it working in Stella like you said. That's...weird.
I believe the problem is with the default bank. Stella starts 32K F4 and F4SC games in bank 7 not bank 0. I think the code assumes it starts in bank 0, however, I could be wrong. I modified Stella to start in bank 0 and the game begins as expected. Since it looks like that's the default for CC and Z26 I'll check those changes in to CVS so they'll be in the next release. Do 32K bankswitching carts always start in bank 0 or is it random?
Metroid Flashback
in Bob's Blog
A blog by vdub_bobby
Posted
I believe the problem is with the default bank. Stella starts 32K F4 and F4SC games in bank 7 not bank 0. I think the code assumes it starts in bank 0, however, I could be wrong. I modified Stella to start in bank 0 and the game begins as expected. Since it looks like that's the default for CC and Z26 I'll check those changes in to CVS so they'll be in the next release. Do 32K bankswitching carts always start in bank 0 or is it random?