Hi guys,
I'm seeking your help once more to figure out a couple of things about the MMC1 mapper.
I've gone through the docs in the wiki, as well as the ones in Kevin Horton's site, back and forth. I managed to come up with some crappy implementation in my emulator, enough to run some games flawlessly (for example Mega Man 2, Castlevania II, Goal!, Lolo 3, Metroid), but others fail big time (like Bart vs Space Mutants (runs into a bad opcode, then crashes), Chip n' Dale 2 (crashes at loading), Double Dragon(Freezes at initial scene, before the "mission 1" screen)).
I lock the last PRG bank to 0xC000, making the one at 0x8000 switchable at reset. (Writing 0xC to 0x8000 - 0x9FFF)
On writes to the CHR Switch registers (1 and 2), I immediately switch the 8k / 4K bank into 0x0000 or 0x1000. In 8k Mode, low bit of reg 1 is ignored, and reg 2 is totally ignored.
On Writes to PRG Switch Reg (0xE000-0xFFFF), I immediately switch the 16k switchable bank (depending on the mode), nothing is done to the fixed banks. On 32K mode I use 2 16K Banks, for example, if bank number is 0, I place bank 0 in the upper 16K space and bank 1 in the lower 16K space, same if bank number is 1, making this a 32K block.
I'm pretty sure I've implemented the shift register correctly (only in the fifth write does the address matters, I select the register using bits 13 and 14 of the address, reset the load counter as well as the shift register after the 5th write.), as well as all the register's bits. Also 4k / 8K CHR banks seem to be switched correctly as well. PRG RAM is permanently enabled.
Currently I don't ignore consecutive writes to the mapper registers.
NMI Timing and CPU Instruction tests all pass. Sprite Zero hit tests pass as well. No sprite overflow implemented yet.
My question is, how exactly should I treat writes to the control register 0. Should I update the other registers with the last value written to them whenever PRG / CHR bank switch mode changes. How do I know which PRG banks remain where on a PRG mode change? Am I missing something?
Thank you in advance for your help.
I'm seeking your help once more to figure out a couple of things about the MMC1 mapper.
I've gone through the docs in the wiki, as well as the ones in Kevin Horton's site, back and forth. I managed to come up with some crappy implementation in my emulator, enough to run some games flawlessly (for example Mega Man 2, Castlevania II, Goal!, Lolo 3, Metroid), but others fail big time (like Bart vs Space Mutants (runs into a bad opcode, then crashes), Chip n' Dale 2 (crashes at loading), Double Dragon(Freezes at initial scene, before the "mission 1" screen)).
I lock the last PRG bank to 0xC000, making the one at 0x8000 switchable at reset. (Writing 0xC to 0x8000 - 0x9FFF)
On writes to the CHR Switch registers (1 and 2), I immediately switch the 8k / 4K bank into 0x0000 or 0x1000. In 8k Mode, low bit of reg 1 is ignored, and reg 2 is totally ignored.
On Writes to PRG Switch Reg (0xE000-0xFFFF), I immediately switch the 16k switchable bank (depending on the mode), nothing is done to the fixed banks. On 32K mode I use 2 16K Banks, for example, if bank number is 0, I place bank 0 in the upper 16K space and bank 1 in the lower 16K space, same if bank number is 1, making this a 32K block.
I'm pretty sure I've implemented the shift register correctly (only in the fifth write does the address matters, I select the register using bits 13 and 14 of the address, reset the load counter as well as the shift register after the 5th write.), as well as all the register's bits. Also 4k / 8K CHR banks seem to be switched correctly as well. PRG RAM is permanently enabled.
Currently I don't ignore consecutive writes to the mapper registers.
NMI Timing and CPU Instruction tests all pass. Sprite Zero hit tests pass as well. No sprite overflow implemented yet.
My question is, how exactly should I treat writes to the control register 0. Should I update the other registers with the last value written to them whenever PRG / CHR bank switch mode changes. How do I know which PRG banks remain where on a PRG mode change? Am I missing something?
Thank you in advance for your help.