So I'm in the midst of refactoring my emulator to not be so naive about copying memory while doing a bank switch, and I'm running into some trouble with a limited number of mappers (haven't reworked MMC2/3/5 yet) in certain cases. For MMC1, any game that does 4k CHR swaps runs totally fine but if the game uses 8k CHR swaps you get the effects seen below in Zelda and Bionic Commando. Duck Tales (and other UNROM games) also show the behavior.
Digging in it looks like Zelda doesn't even trigger a bank switch for a while when it starts up (or at least not that I can see), so that says to me that the startup bank is wrong but I'm pointing the lower CHR bank (where it has sprites stored) to 0 which worked fine before I refactored. What I'm thinking is that I broke something in how the the sprite pattern tables are filled, but I'm lost at what these games do differently from others that might make those patterns fill incorrectly.
A little abstract, but any thoughts? I can provide relevant code if necessary.
Digging in it looks like Zelda doesn't even trigger a bank switch for a while when it starts up (or at least not that I can see), so that says to me that the startup bank is wrong but I'm pointing the lower CHR bank (where it has sprites stored) to 0 which worked fine before I refactored. What I'm thinking is that I broke something in how the the sprite pattern tables are filled, but I'm lost at what these games do differently from others that might make those patterns fill incorrectly.
A little abstract, but any thoughts? I can provide relevant code if necessary.