ROM Cartridge

The Famicom of 1983, sold as the NES in the West, has no disk and no tape. The game sits in a cartridge of read only memory that plugs straight onto the CPU's bus. Nothing is loaded. The CPU reads its program from the cartridge one byte at a time, as fast as it reads RAM. This page shows what that buys and what it costs.

What you are looking at

A Famicom with its lid off. The cartridge stands in the slot at the back. On the board are the CPU, the PPU that draws the picture, 2 KB of RAM and 2 KB of video RAM. The controller is wired in at the right.

The row under the drawing is the CPU's address space, 64 KB in 16 slots of 4 KB. Press a slot and the CPU reads a byte there: the hollow point is the address going out along the bus, the filled point is the byte coming back, and the chip that answers turns green. Run plays one loop of a game. Press the cartridge to take it out.

The memory map

The CPU has 16 address lines, so it can name 65 536 bytes. Every chip is wired to answer for a range of those addresses. The chip does not know it is memory, ROM or a controller; it only sees its addresses.

AddressesWhat answers
$0000 to $07FF2 KB of RAM. The same bytes appear again up to $1FFF.
$2000 to $2007Eight PPU registers. Writing here puts tiles on screen.
$4000 to $4017Sound registers, and the two controllers at $4016 and $4017.
$4018 to $7FFFNothing on a plain cartridge. Some cartridges put save RAM at $6000.
$8000 to $FFFF32 KB of program ROM in the cartridge.

The PPU has a bus of its own, with the video RAM and the cartridge's 8 KB of graphics ROM on it. That is why the slot has 60 pins: two buses pass through it.

Access time

Every read takes the same time, whatever the address.

access time = 1 cycle = 0.56 µs

The CPU runs at 1.79 MHz. It puts an address on the bus, and by the end of the cycle the chip has put the byte on the data bus. There is no seek and no wind. The first byte of the program costs the same as the ten thousandth.

StoreRandom byteWhat it costs
Tapeabout 1 minwind to the block
Hard diskabout 10 msseek and spin to the sector
Cartridge ROM0.56 µsone cycle, like RAM

So there is no loading. When the power comes on, the CPU reads the address stored at $FFFC in the ROM and starts fetching there. The title screen is up in a frame.

Read only

Written once. A mask ROM is made with its bits built into the silicon at the factory. It cannot be changed, and it keeps its bits with no power. Pull the cartridge out, and the CPU finds nothing at $8000. Press Run with the slot empty to see what happens.

Small. ROM costs far more per byte than tape or disk. A Famicom cartridge holds 40 KB. Super Mario Bros. is exactly that: 32 KB of program and 8 KB of graphics. A tape cartridge today holds 18 TB.

No saving. The game cannot write to its own ROM. To save, a cartridge adds a RAM chip at $6000 and a battery to keep it alive.

Bigger games

The CPU can address 32 KB of ROM, and later games were bigger. A mapper chip in the cartridge holds a larger ROM and swaps which 16 KB of it appears at $8000. The CPU writes to the mapper to pick a bank. Super Mario Bros. 3 is 384 KB this way, in a CPU that still sees 64 KB.

Check your understanding

  1. The CPU reads $0C00. Which chip answers, and what does it find?
  2. A game reads 100 bytes scattered across its ROM. How long do the reads take? How long would the same reads take from tape?
  3. Why does the Famicom need no loading screen, and a tape computer of the same year need a long one?
  4. Press Run with the cartridge out. Why does the CPU fetch from $8000 at all?

Summary

Takeaways