How Bank Switching Let NES Cartridges Outgrow the Console

Abstract illustration of a graphite chip board with overlapping bank blocks and address-line traces, representing NES cartridge mappers, no logos.

NES bank switching let cartridges grow past the console 32 KB program window by swapping ROM banks through mapper registers the CPU writes to at run time.

Super Mario Bros. from 1985 fits in about 40 kilobytes, and the console that runs it can only see 64 kilobytes of address space at once. Every larger game that followed got around that ceiling with extra hardware on the cartridge, not with a faster processor. That hardware is the mapper, and bank switching is the trick it uses. Once you understand the memory map, a lot of otherwise confusing behaviour, from garbled tiles to a status bar that stays still while the world scrolls, becomes straightforward.

The 64-kilobyte ceiling

The 2A03 has a 16-bit address bus, so it can name addresses from $0000 to $FFFF and no further. Nintendo carved that range up. The bottom $0000 to $07FF is the console 2 KB of internal RAM, $2000 to $3FFF talks to the picture processor, $4000 to $4017 covers the APU and input, and $6000 to $7FFF is the window often used for cartridge work RAM. That leaves $8000 to $FFFF, a 32 KB block, mapped to program ROM on the cartridge. The picture processor has its own separate address space, with $0000 to $1FFF holding 8 KB of pattern tables for tiles, which is why a cartridge carries both program ROM and character ROM.

What a mapper actually does

A mapper is a handful of latches and address decoding logic on the cartridge, exposed to the CPU as a register somewhere in the $8000 to $FFFF range. The game writes a bank number to that register. On the next read, the mapper drives the high address lines of the ROM chip so a different physical chunk of ROM appears inside the same 32 KB window. The CPU keeps reading $8000 to $FFFF and never learns that the cartridge holds far more data than that, because the swap happens underneath it in hardware.

Program ROM is usually divided into 16 KB or 32 KB banks, and character ROM into 1 KB, 2 KB or 4 KB banks for tile animation. Swapping a character bank lets a game change a whole set of tiles without copying a single byte through the CPU, which is how water, coins and flickering torches animate while the processor is busy with everything else. The mechanism is cheap and elegant: instead of moving data, you move the window. A register, a latch and a few address lines turn a fixed console into one that can run cartridges many times its nominal size.

Named mappers and the games that used them

By the late 1980s Nintendo and third parties had a small family of mapper chips, each with a different mix of bank sizes and extras. The iNES header inside a .nes file stores a mapper number so the emulator knows which one to model, which is why a wrong header produces garbled graphics rather than a clean crash. The table is a short field guide.

iNES mapper Chip Notable feature Example game
0 NROM No banking, 32 KB program plus 8 KB character Super Mario Bros., 1985
1 MMC1 Serial register loaded one bit at a time, battery RAM The Legend of Zelda, 1986
4 MMC3 Fine program and character banks plus a scanline IRQ Super Mario Bros. 3, 1988
9 MMC2 Character banks switched by PPU tile reads Punch-Out, 1987
5 MMC5 Large program space, extra sound, extended attributes Castlevania III, 1989

The MMC1 is a good illustration of the trade-offs. Its bank register is loaded serially, one bit per write over five writes, which saves pins and silicon but costs CPU time on every switch. It also brought battery-backed work RAM at $6000 to $7FFF, so The Legend of Zelda from 1986 could keep a save across power cycles; emulators store that RAM as a .sav or .srm file beside the .nes image. The MMC3 is the more famous one because its scanline counter fires an interrupt by watching picture-processor address line toggles, letting a game change banks and scroll mid-frame. That is the mechanism behind the status bar in Super Mario Bros. 3 from 1988 staying fixed while the level scrolls beneath it. The MMC2 goes the other way, switching character banks when the PPU reads particular tiles, which is how Punch-Out from 1987 keeps two halves of the screen showing different graphics.

How the header tells the emulator what to build

A .nes file opens with a short header, the ASCII letters NES followed by a control byte, then counts of program and character ROM banks, a byte carrying the low mapper bits, mirroring and battery flags, and a second byte with more mapper bits. The NES 2.0 extension stretches this so very large cartridges and subtler hardware details fit. An emulator reads those bytes, builds the matching mapper, and then every write to the register range and every bank switch is simulated in software. If the number is wrong, the game writes a bank value that the emulator applies to the wrong-sized chip, and the result is usually a title screen full of scrambled tiles or a hard hang on the first level.

Why cartridges kept growing

Later cartridges pushed program ROM well past half a megabyte, swapped character ROM for character RAM so tiles could be generated at run time, added work RAM with a coin cell for saves, and in some cases put extra sound channels on the mapper itself. The MMC5 and chips like the Konami VRC6 are the extreme end, but the principle never changes: the console stays fixed and the cartridge becomes a small co-processor. Two games on the same machine can therefore place very different demands on an emulator, which is the specific reason a blanket claim that one core plays every NES title perfectly never survives contact with a large library. The hardware was not one machine so much as a base unit plus whatever logic each publisher soldered in.

Keep the .sav beside the .nes when you move a personal backup, since battery saves live in that separate file and a missing one looks exactly like a corrupted save. On my shelf a Zelda cartridge still holds a decades-old save thanks to a coin cell and a few kilobytes of work RAM, which is a fair reminder that those mapper registers were doing real, persistent work and not just shuffling pretty pictures.

Related reading

If you want to keep digging into this corner of the library, these two posts on Roms Get go a little further:

Similar Posts