NES 2.0 was created by kevtris for his FPGA console, the Kevtendo, and is maintained by the NESdev community, whose wiki is the specification this page follows. It keeps the 16-byte size and the first seven bytes of the iNES header, so an emulator that only knows iNES can still load a NES 2.0 file when it does not need the new fields.
File layout
| Part | Size | Present |
|---|---|---|
| Header | 16 bytes | always |
| Trainer | 512 bytes, loaded at $7000 | when byte 6 bit 2 is set |
| PRG ROM | from bytes 4 and 9 | always |
| CHR ROM | from bytes 5 and 9 | when its size is not 0 |
| Miscellaneous ROMs | the rest of the file | when byte 14 is not 0 |
For Vs. Dual System games (two consoles in one cabinet) the PRG and CHR ROM of both halves are stored one after the other, following rules on the NESdev page.
Header
| Byte | Bits | Meaning |
|---|---|---|
0–3 | — | 4E 45 53 1A, NES and the MS-DOS end-of-file character. |
4 | 0–7 | PRG ROM size, low byte. See ROM sizes. |
5 | 0–7 | CHR ROM size, low byte. |
6 | 0 | Hard-wired nametable layout: 0 vertical arrangement (horizontal mirroring) or mapper-controlled; 1 horizontal arrangement (vertical mirroring). |
| 1 | Battery or other non-volatile memory is present. | |
| 2 | 512-byte trainer present. | |
| 3 | Hard-wired four-screen (alternative) nametable layout. | |
| 4–7 | Mapper number bits 0–3. | |
7 | 0–1 | Console type; see console types. |
| 2–3 | 10 in binary: this is a NES 2.0 header. | |
| 4–7 | Mapper number bits 4–7. | |
8 | 0–3 | Mapper number bits 8–11. |
| 4–7 | Submapper number, 0–15; see submappers. | |
9 | 0–3 | PRG ROM size, high nibble. |
| 4–7 | CHR ROM size, high nibble. | |
10 | 0–3 | PRG RAM (volatile) shift count. |
| 4–7 | PRG NVRAM or EEPROM (non-volatile) shift count. | |
11 | 0–3 | CHR RAM (volatile) shift count. |
| 4–7 | CHR NVRAM (non-volatile) shift count. | |
12 | 0–1 | CPU/PPU timing; see timing. |
| 2–7 | Unused, zero. | |
13 | 0–3 | Console type 1: Vs. PPU type. Console type 3: extended console type. Otherwise zero. |
| 4–7 | Console type 1: Vs. hardware type. Otherwise zero. | |
14 | 0–1 | Number of miscellaneous ROMs, 0–3. |
| 2–7 | Unused, zero. | |
15 | 0–6 | Default expansion device; see expansion devices. 0 means not specified. |
| 7 | Unused, zero. |
The mapper number is the 12-bit value
(byte 8 AND 0x0F) × 256 + (byte 7 AND 0xF0) + (byte 6 >> 4), 0 to 4095.
Numbers 0 to 255 mean the same boards as in iNES; the NESdev Wiki’s mapper grid lists
the higher numbers assigned so far (up to the 700s).
ROM sizes
Each ROM size is a 12-bit number: the high nibble from byte 9 and the low byte from byte 4 (PRG) or 5 (CHR).
| High nibble | Notation | Size in bytes |
|---|---|---|
0x0–0xE | Simple | PRG: (nibble × 256 + low byte) × 16 384. CHR: (nibble × 256 + low byte) × 8 192. |
0xF | Exponent-multiplier | 2E × (MM × 2 + 1), where E is the upper six bits of the low byte and MM the lower two bits; the multiplier is 1, 3, 5 or 7. |
The exponent form is used only for sizes the simple form cannot express, such as ROMs
that are not a whole number of 16 KiB. For example, high nibble F and low
byte 0x51 (E = 20, MM = 1) give 220 × 3 =
3 MiB.
RAM shift counts
Bytes 10 and 11 give four RAM sizes as shift counts. A count of 0 means that memory is not present; any other count n means 64 << n bytes.
| Count | Size | Count | Size |
|---|---|---|---|
| 0 | none | 8 | 16 KiB |
| 1 | 128 bytes | 9 | 32 KiB |
| 2 | 256 bytes | 10 | 64 KiB |
| 3 | 512 bytes | 11 | 128 KiB |
| 4 | 1 KiB | 12 | 256 KiB |
| 5 | 2 KiB | 13 | 512 KiB |
| 6 | 4 KiB | 14 | 1 MiB |
| 7 | 8 KiB | 15 | 2 MiB |
When the PRG NVRAM count (byte 10, upper nibble) is not zero, the battery bit (byte 6 bit 1) must also be set, so that iNES readers still save the game. Conversely a set battery bit normally goes with a non-zero NVRAM count; NESdev lists the exceptions. Unlike iNES, an empty CHR ROM does not imply CHR RAM: its size is given in byte 11.
Console types (byte 7, bits 0–1)
| Value | Console |
|---|---|
| 0 | Nintendo Entertainment System or Famicom. |
| 1 | Nintendo Vs. System; byte 13 gives the PPU and hardware types. |
| 2 | Nintendo PlayChoice-10 (an 8 KiB INST-ROM and PROM follow as miscellaneous ROMs). |
| 3 | Extended console type, given in byte 13. |
CPU/PPU timing (byte 12)
| Value | Timing |
|---|---|
| 0 | RP2C02 (“NTSC”). |
| 1 | RP2C07 (“licensed PAL”). |
| 2 | Multiple regions: the game runs on either and adjusts itself. |
| 3 | UA6538 (“Dendy”). |
Vs. System types (byte 13, console type 1)
| Low nibble | Vs. PPU type |
|---|---|
0 | Any RP2C03 or RC2C03 variant. |
1 | Reserved. |
2 | RP2C04-0001. |
3 | RP2C04-0002. |
4 | RP2C04-0003. |
5 | RP2C04-0004. |
6, 7 | Reserved. |
8 | RC2C05-01 (signature unknown). |
9 | RC2C05-02 ($2002 AND $3F = $3D). |
A | RC2C05-03 ($2002 AND $1F = $1C). |
B | RC2C05-04 ($2002 AND $1F = $1B). |
C–F | Reserved. |
| High nibble | Vs. hardware type |
|---|---|
0 | Vs. Unisystem (normal). |
1 | Vs. Unisystem (RBI Baseball protection). |
2 | Vs. Unisystem (TKO Boxing protection). |
3 | Vs. Unisystem (Super Xevious protection). |
4 | Vs. Unisystem (Vs. Ice Climber Japan protection). |
5 | Vs. Dual System (normal). |
6 | Vs. Dual System (Raid on Bungeling Bay protection). |
7–F | Not defined. |
Extended console types (byte 13, console type 3)
| Low nibble | Console |
|---|---|
0 | Regular NES, Famicom or Dendy (the same as console type 0). |
1 | Nintendo Vs. System (the same as console type 1). |
2 | PlayChoice-10 (the same as console type 2). |
3 | Regular Famicom clone, but with a CPU that supports decimal mode. |
4 | Regular NES or Famicom with an EPSM sound module or plug-through cartridge. |
5 | V.R. Technology VT01 with red/cyan STN palette. |
6 | V.R. Technology VT02. |
7 | V.R. Technology VT03. |
8 | V.R. Technology VT09. |
9 | V.R. Technology VT32. |
A | V.R. Technology VT369. |
B | UMC UM6578. |
C | Famicom Network System. |
D–F | Reserved. |
Miscellaneous ROMs (byte 14)
Byte 14 counts extra ROM chips stored after CHR ROM. Their total size is whatever is left of the file; how it is divided depends on the mapper or console. Defined uses:
- PlayChoice-10: the INST-ROM, the PROM data and the PROM CounterOut, three ROMs.
- VT369 consoles: the chip’s embedded ROM.
- Mapper 86, submapper 1: speech data.
- Mapper 355: the PIC16C54 microcontroller’s ROM.
- Mappers 561 and 562: non-standard trainers.
Recognising the header
The file starts with 4E 45 53 1A and byte 7 AND 0x0C is
0x08. NESdev’s detection procedure adds a check that the ROM sizes the header
gives, including byte 9, do not exceed the file’s actual size.
Worked example
4E 45 53 1A "NES" + 0x1A
08 PRG ROM low byte: 8
10 CHR ROM low byte: 16
42 byte 6: mapper bits 0–3 = 4, battery
08 byte 7: NES 2.0, console type 0, mapper bits 4–7 = 0
00 byte 8: mapper bits 8–11 = 0, submapper 0 → mapper 4 (MMC3)
00 byte 9: high nibbles 0 → PRG 8 × 16 KiB = 128 KiB, CHR 16 × 8 KiB = 128 KiB
70 byte 10: no volatile PRG RAM, PRG NVRAM 64 << 7 = 8 KiB
00 byte 11: no CHR RAM
00 byte 12: NTSC timing
00 byte 13: not used for console type 0
00 byte 14: no miscellaneous ROMs
01 byte 15: standard controllers