This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

MMC3 bank switching?

MMC3 bank switching?
by on (#40095)
Have any of you guys been able to do 1k chr bank switching for both the characters and sprites (PPU $0000 - $1fff) using the MMC3 $8000, and $8001?

From my experiments it seems that commands 2-5 seem to treat the address select bit (XOR w/ $1000) as always enabled so that I can only change the banks at $0000, $0400, $0800, $0c00.

However, commands 0, and 1 (2k bank switching) seems to respect the address select bit (XOR w/ $1000).

I'm seeing the same behavior in nestopia and nintendulator.

Any clues as to why this is? Are my docs wrong? Does CHR bank switching need to be done in vblank?


Code:
 +-------+   +------------------------------------------------------+
 ¦ $8000 +---¦ CPxxxNNN                                             ¦
 +-------+   ¦ ¦¦   +-+                                             ¦
             ¦ ¦¦    +--- Command Number                            ¦
             ¦ ¦¦          0 - Select 2 1K VROM pages at PPU $0000  ¦
             ¦ ¦¦          1 - Select 2 1K VROM pages at PPU $0800  ¦
             ¦ ¦¦          2 - Select 1K VROM page at PPU $1000     ¦
             ¦ ¦¦          3 - Select 1K VROM page at PPU $1400     ¦
             ¦ ¦¦          4 - Select 1K VROM page at PPU $1800     ¦
             ¦ ¦¦          5 - Select 1K VROM page at PPU $1C00     ¦
             ¦ ¦¦          6 - Select first switchable ROM page     ¦
             ¦ ¦¦          7 - Select second switchable ROM page    ¦
             ¦ ¦¦                                                   ¦
             ¦ ¦+-------- PRG Address Select                        ¦
             ¦ ¦           0 - Enable swapping for $8000 and $A000  ¦
             ¦ ¦           1 - Enable swapping for $A000 and $C000  ¦
             ¦ ¦                                                    ¦
             ¦ +--------- CHR Address Select                        ¦
             ¦             0 - Use normal address for commands 0-5  ¦
             ¦             1 - XOR command 0-5 address with $1000   ¦
             +------------------------------------------------------+

 +-------+   +----------------------------------------------+
 ¦ $8001 +---¦ PPPPPPPP                                     ¦
 +-------+   ¦ +------+                                     ¦
             ¦    ¦                                         ¦
             ¦    ¦                                         ¦
             ¦    +------- Page Number for Command          ¦
             ¦              Activates the command number    ¦
             ¦              written to bits 0-2 of $8000    ¦
             +----------------------------------------------+

by on (#40096)
Quote:

Any clues as to why this is? Are my docs wrong? Does CHR bank switching need to be done in vblank?

No, but the MMC3 is hardwired to the 2k, 2k, 1k, 1k, 1k, 1k sheme and can't do anything else.
If you want all 1k sections you'll have to use another mapper.

by on (#40098)
I see, makes sense now. The chr select bit seems to be a 'state' and not part of the 'command'. Thanks!

Now I just have to think about tradeoffs between background animation and character animation. I think I'll be doing 1k banks for sprites since my characters are 48 pixels high, and I'll need to change banks on the fly to animate the main character.