Introduction
The header is the first 64 bytes of the ROM. The console’s boot ROM reads its first word to set the speed
of the cartridge bus; the boot code reads the boot address and the check code; libultra, the library games
link, reads the clock rate and leaves the rest alone. All numbers are big-endian; this page gives offsets
in the big-endian (.z64) order.
Byte order
The first four bytes are 80 37 12 40 in a .z64. Swapped in pairs, as a
.v64, they read 37 80 40 12; with every word reversed, as an .n64,
40 12 37 80. To read a file of the other orders, swap back first: exchange each pair of bytes
(.v64) or reverse each group of four (.n64), which is what the mupen64plus emulator does
when it loads one. The four bytes are also the bus timing word, so a ROM whose timing differs from
the common value starts otherwise: a file that starts with none of the three is not recognised by the explorer.
Fields
| Offset | Size | Field | Meaning |
|---|---|---|---|
$00 | 1 | Reserved | Not part of the configuration. Commercial games hold $80. |
$01 | 3 | PI BSD domain 1 configuration | Bus timing flags, read by the boot ROM: byte $03 latency (LAT), $02 pulse width (PWD), bits 0–3 of $01 page size (PGS), bits 4–5 of $01 release (RLS). Usual values: LAT $40, PWD $12, PGS $7, RLS $3; with the first byte they make the signature $80371240. |
$04 | 4 | Clock rate | Used by libultra 2.0I and earlier to turn the processor’s Count register into time. Most ROMs hold $0000000F; a few hold values such as $03B9ACAF or $03A07F5F. The N64brew page says a value that is zero after masking is replaced by $03B9ACA0; it does not give the mask, and clearing the low four bits is the usual reading. |
$08 | 4 | Boot address | The program counter the program starts at, in RAM. The boot code copies 1 MiB from ROM $1000 to it and jumps there; the usual value is $80000400 (homebrew ROMs on this site’s emulator hold $80001000). The 6103 and 6106 boot chips subtract a constant first: see the boot process. |
$0C | 4 | Libultra version | Informational and often wrong. Bytes 0–1 are reserved or a patch version, byte 2 is the version in tens ($14 is 20, version 2.0), byte 3 the revision letter in ASCII. |
$10 | 8 | Check code (CRC1 and CRC2) | Two 32-bit values computed over the 1 MiB from ROM $1000. The boot code halts the console when they do not match. The name “CRC” is the tools’ name for them; the N64brew page notes it is not a CRC in the strict sense. How they are computed is on boot code and check code. |
$18 | 8 | Reserved | Unused by Nintendo; some development ROMs keep data here. |
$20 | 20 | Game title | ASCII or JIS X 0201, padded with spaces ($20). |
$34 | 7 | Reserved | Unused by Nintendo. The advanced homebrew header reuses $34–$3F: controller bytes at $34–$37, flags at $38, the letters “ED” at $3C and a save type bit field at $3F. |
$3B | 4 | Game code | Category ($3B), two-character unique ID ($3C–$3D), destination ($3E); see the tables below. |
$3F | 1 | ROM version | 0 for the first release, 1 for the second, and so on. |
Category ($3B)
| Letter | Media |
|---|---|
N | Game Pak. |
D | 64DD disk. |
C | Expandable game, Game Pak part. |
E | Expandable game, 64DD disk part. |
Z | Aleck 64 Game Pak. |
Destination ($3E)
| Letter | Region | Letter | Region |
|---|---|---|---|
A | All regions | K | Korea |
B | Brazil | L | Gateway 64 (PAL) |
C | China | N | Canada |
D | Germany | P | Europe |
E | North America | S | Spain |
F | France | U | Australia |
G | Gateway 64 (NTSC) | W | Scandinavia |
H | Netherlands | X, Y, Z | Europe |
I | Italy | J | Japan |
Homebrew often leaves the byte zero. The N64brew page lists no video standard per letter.
Not described
Known, not yet covered
- Reference: which libultra versions use which clock rates, the meaning of every libultra version value, and the advanced homebrew header’s fields beyond the list above.
- Viewer: in a
.v64or.n64file a header field can lie across the file’s bytes out of order (the three-byte bus timing word is file bytes 0, 2 and 3 in a.v64), so the tree shows each 32-bit word of the header as one node and names the fields in it; a.z64shows one node per field.
Links
Reference
- ROM Header – N64brew wiki: the fields, the destination and category codes and the bus timing word