Introduction
NES 2.0 is a backwards-compatible extension of the iNES header, made by the NES emulation community. The original header cannot describe many cartridges exactly: it has only 256 mapper numbers, no way to tell apart boards that share a mapper number, and no reliable field for RAM sizes or the console region. NES 2.0 uses the header’s spare bytes to record all of these, so an emulator does not have to guess them from a database.
Structure
Bytes 0 to 7 are laid out as in iNES: the magic 4E 45 53 1A, the ROM
sizes, and the flags with the low eight bits of the mapper number. Bits 0 and 1 of
byte 7 give the console type, such as a plain NES or a Vs. System arcade board, and
bits 2 and 3 are 10 in binary to mark the header as NES 2.0. The other
eight bytes become:
0magicNES\x1A, ROM sizes, flags 6 and 7, as in iNES8 bytes8mapper bits 8 to 11 and a submapper number1 byte9upper bits of the PRG ROM and CHR ROM sizes1 byte10work RAM and battery-backed RAM sizes, as shift counts1 byte11CHR RAM and battery-backed CHR RAM sizes, as shift counts1 byte12timing: NTSC, PAL, multiple regions or Dendy1 byte13Vs. System type, or extended console type1 byte14number of miscellaneous ROMs1 byte15default expansion device, such as the controller1 byte16trainer if flagged, then PRG ROM, CHR ROM and any miscellaneous ROMsvaries
A RAM size given as a shift count n means 64 bytes shifted left by n; 0 means none.
Telling it apart
The file starts with 4E 45 53 1A and bits 2 and 3 of byte 7 are
10 in binary (byte 7 AND 0C is 08).
Links
Software
Reference
- NES 2.0, NESdev Wiki