ROM Addressing

From BindingForce Wiki
Jump to navigation Jump to search

There are several different ways to refer to data in memory in Zelda II. Which one you use depends on your reasoning for doing so. This page will explain where they're useful and how to translate between them.

ROM File

NES ROM files are in a format generally called iNES. Most ROMs (including Zelda 2 ROMs) are in [1.0 format]. The layout of a Zelda II ROM file is as follows (an [[1]] cartridge with 8 PRG ROM banks, 16 CHR-ROM banks, and 4KB of SRAM -- for more details see [Crystal]):

Type Number File Offset Size Contents
iNES Header 0x00000 16bytes (0x10)
PRG Bank 0 0x00010 16KB (0x4000)
1 0x04010 16KB (0x4000) Western Hyrule
2 0x08010 16KB (0x4000) Eastern Hyrule
3 0x0C010 16KB (0x4000) Towns(?)
4 0x10010 16KB (0x4000) Normal Palaces
5 0x14010 16KB (0x4000) Great Palace
6 0x18010 16KB (0x4000) Music(?)
7 0x1C010 16KB (0x4000) Global State (permanently mapped)
CHR Bank 0 0x20000 8KB (0x2000)
1 0x22000 8KB (0x2000)
2 0x24000 8KB (0x2000)
3 0x26000 8KB (0x2000)
4 0x28000 8KB (0x2000)
5 0x2a000 8KB (0x2000)
6 0x2c000 8KB (0x2000)
7 0x2e000 8KB (0x2000)
8 0x30000 8KB (0x2000)
9 0x32000 8KB (0x2000)
10 0x34000 8KB (0x2000)
11 0x36000 8KB (0x2000)
12 0x38000 8KB (0x2000)
13 0x3a000 8KB (0x2000)
14 0x3c000 8KB (0x2000)
15 0x3e000 8KB (0x2000)

Memory

CPU Memory Map

CPU Address

Bank And Offset

Converting