CPU memory map: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
m (vectors starts at $fffa, not at $c000, it does not have to be the last bank, just any known)
m (folding iNES mappers into first clause, replacing nor with or (atypical in this context))
Line 21: Line 21:
See [[Sample RAM map]] for an example allocation strategy for the 2KB of internal RAM at $0000-$0800.
See [[Sample RAM map]] for an example allocation strategy for the 2KB of internal RAM at $0000-$0800.


Note: Most common boards address ROM and Save/Work RAM in this format, especially in common iNES mappers:
Note: Most common boards and iNES mappers address ROM and Save/Work RAM in this format:


*$6000-$7FFF = Battery Backed Save or Work RAM
*$6000-$7FFF = Battery Backed Save or Work RAM
Line 32: Line 32:
*$FFFE-$FFFF = IRQ/BRK vector
*$FFFE-$FFFF = IRQ/BRK vector


If a mapper doesn't fix $FFFA-$FFFF to some known bank nor use some sort of reset detection, the vectors need to be stored in all banks.
If a mapper doesn't fix $FFFA-$FFFF to some known bank or use some sort of reset detection, the vectors need to be stored in all banks.

Revision as of 18:33, 28 May 2015

Address range Size Device
$0000-$07FF $0800 2KB internal RAM
$0800-$0FFF $0800 Mirrors of $0000-$07FF
$1000-$17FF $0800
$1800-$1FFF $0800
$2000-$2007 $0008 NES PPU registers
$2008-$3FFF $1FF8 Mirrors of $2000-2007 (repeats every 8 bytes)
$4000-$401F $0020 NES APU and I/O registers
$4020-$FFFF $BFE0 Cartridge space: PRG ROM, PRG RAM, and mapper registers (See Note)

See Sample RAM map for an example allocation strategy for the 2KB of internal RAM at $0000-$0800.

Note: Most common boards and iNES mappers address ROM and Save/Work RAM in this format:

  • $6000-$7FFF = Battery Backed Save or Work RAM
  • $8000-$FFFF = Usual ROM, commonly with Mapper Registers (see MMC1 and UxROM for example)

The CPU expects interrupt vectors in a fixed place at the end of the cartridge space:

  • $FFFA-$FFFB = NMI vector
  • $FFFC-$FFFD = Reset vector
  • $FFFE-$FFFF = IRQ/BRK vector

If a mapper doesn't fix $FFFA-$FFFF to some known bank or use some sort of reset detection, the vectors need to be stored in all banks.