CPU memory map: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Major revision to include better mapping, and more!)
(Don't give the idea that the vectors are some separate area of memory, just data at the end of cart space)
Line 1: Line 1:
{| border=1
{| class="tabular"
! Addr || Size || Device
! Addr || Size || Device
|-
|-
Line 12: Line 12:
| $2000 || $0008 || [[PPU_registers|NES PPU]] registers
| $2000 || $0008 || [[PPU_registers|NES PPU]] registers
|-
|-
| $2008 || $1FF8 || [[Mirroring|Mirrors]] of $2000 every 8 bytes
| $2008 || $1FF8 || Mirrors of $2000 every 8 bytes
|-
|-
| $4000 || $0018 || [[APU|NES APU]] and [[2A03|I/O registers]]
| $4000 || $0018 || [[APU|NES APU]] and [[2A03|I/O registers]]
|-
|-
| $4018 || $BFE2 || Cartridge Space: PRG-ROM, PRG-RAM, and [[MMC|Mapper Registers]] (See Note)
| $4018 || $BFE8 || Cartridge Space: PRG-ROM, PRG-RAM, and [[MMC|Mapper Registers]] (See Note)
|-
| $FFFA || $0006 || 6502 Vectors: NMI, Reset, and IRQ/BRK, After this is the end of space for the CPU
|}
|}


Note: Most Common Boards address ROM and Save/Work RAM in this format, Especially in Common INES mappers:
Note: Most Common Boards address ROM and Save/Work RAM in this format, Especially in Common INES mappers:


$6000-$7FFF = Battery Backed Save or Work RAM
*$6000-$7FFF = Battery Backed Save or Work RAM
 
*$8000-$FFF9 = Usual ROM, commonly with Mapper Registers (see MMC1 and UxROM for example)
$8000-$FFF9 = Usual ROM, commonly with Mapper Registers (see MMC1 and UxROM for example)
 
Vectors are at the end of the rom, like so:


$FFFA-$FFFB = NMI vector
The CPU expects three addresses called "vectors" in fixed places at the end of the cartridge space, like so:


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


$FFFE-$FFFF = IRQ/BRK vector
Any mapper that switches $E000-$FFF9 will switch $FFFA-$FFFF along with it.
If a mapper doesn't fix $C000-$FFFF to the last bank or use some sort of reset detection, the vectors need to be stored in all banks.

Revision as of 22:15, 20 July 2012

Addr Size Device
$0000 $0800 2KB internal RAM
$0800 $0800 Mirrors of $0000-$07FF
$1000 $0800
$1800 $0800
$2000 $0008 NES PPU registers
$2008 $1FF8 Mirrors of $2000 every 8 bytes
$4000 $0018 NES APU and I/O registers
$4018 $BFE8 Cartridge Space: PRG-ROM, PRG-RAM, and Mapper Registers (See Note)

Note: Most Common Boards address ROM and Save/Work RAM in this format, Especially in Common INES mappers:

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

The CPU expects three addresses called "vectors" in fixed places at the end of the cartridge space, like so:

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

Any mapper that switches $E000-$FFF9 will switch $FFFA-$FFFF along with it. If a mapper doesn't fix $C000-$FFFF to the last bank or use some sort of reset detection, the vectors need to be stored in all banks.