Nintendo header: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Changed hex offsets to uppercase. PRG Checksum is not clamped. PRG & CHR Checksums are stored as big-endian.)
m (Game names are not zero terminated.)
Line 3: Line 3:
The info in them is frequently incomplete and/or inaccurate. When info on a particular filed is not present, a byte $00 or $FF is used for padding
The info in them is frequently incomplete and/or inaccurate. When info on a particular filed is not present, a byte $00 or $FF is used for padding


* '''$FFE0-$FFEF''' : Name of the game, in ASCII, zero terminated (sometimes the name is abbreviated or replaced by Nintendo's code). ASCII codes 20h-5Ah allowed. Should be right-justified.
* '''$FFE0-$FFEF''' : Name of the game, in ASCII. (sometimes the name is abbreviated or replaced by Nintendo's code). ASCII codes 20h-5Ah allowed. Should be right-justified.
* '''$FFF0-$FFF1''' : PRG checksum (either the last 16k bank, or the whole PRG-ROM). Sum of all bytes, excluding the two checksum bytes. Big-endian.
* '''$FFF0-$FFF1''' : PRG checksum (either the last 16k bank, or the whole PRG-ROM). Sum of all bytes, excluding the two checksum bytes. Big-endian.
* '''$FFF2-$FFF3''' : CHR checksum. 0x00 if RAM. Big-endian.
* '''$FFF2-$FFF3''' : CHR checksum. 0x00 if RAM. Big-endian.

Revision as of 03:45, 7 December 2020

About 33% of licensed Nintendo NES games have an header present at their last bank, at addresses $FFE0-$FFF9, right before the interrupt vectors.

The info in them is frequently incomplete and/or inaccurate. When info on a particular filed is not present, a byte $00 or $FF is used for padding

  • $FFE0-$FFEF : Name of the game, in ASCII. (sometimes the name is abbreviated or replaced by Nintendo's code). ASCII codes 20h-5Ah allowed. Should be right-justified.
  • $FFF0-$FFF1 : PRG checksum (either the last 16k bank, or the whole PRG-ROM). Sum of all bytes, excluding the two checksum bytes. Big-endian.
  • $FFF2-$FFF3 : CHR checksum. 0x00 if RAM. Big-endian.
  • $FFF4 : Data sizes. Values: 0 = 8 KiB or 64 KiB based on board type, 1 = 16 KiB, 2 = 32 KiB, 3 = 128 KiB, 4 = 256 KiB, 5 = 512 KiB
    • D7-D4: PRG size
    • D3: 0 = CHR ROM, 1 = CHR RAM
    • D2-D0: CHR size
  • $FFF5 : Board Type.
  • $FFF6 : Title encoding : 0 = No title entered, 1 = ASCII, 2 = Another encoding
  • $FFF7 : Valid Title Length - 1. 0 if no title entered.
  • $FFF8 : Maker's code, the same used for the FDS, GB, GBC and SNES headers : 1 = Nintendo, 2-254 = everyone else. 255 must be reserved.
  • $FFF9 : Header Validation Byte. 8-bit checksum of $FFF2-$FFF9 should = 0