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. libultra masks the value with $FFFFFFF0, multiplies by 0.75 (the processor clock’s 1.5 multiplier, and the Count register counting every second cycle), and if the masked value is zero uses $03B9ACA0 (62,500,000) before multiplying; so $0000000F means the default. Example: $03A07F5F is masked to $03A07F50 (60,850,000), times 0.75 is $02B85F7C (45,637,500). Which ROMs differ is in the table below. |
$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. No game is known to read this byte; flashcarts, menus and emulators use it to pick the TV type, and zero is the usual way for homebrew to say “any TV type”.
Clock rate: the ROMs that are not $0000000F
Every known ROM holds $0000000F except these (N64brew; the libultra version is the one the ROM’s own header names).
| Clock rate | libultra | Game codes | Titles |
|---|---|---|---|
$03B9ACAF | 2.0D | NCUP, NCUE | Cruis’n USA (Europe; USA, three versions) |
$03B9ACAF | 2.0G | NXGP, NXGE | NBA Hangtime (Europe, USA) |
$03A07F5F | 2.0G, 2.0H | NDMP, NDME, NDMJ | Doom 64 (Europe 2.0G; USA two versions 2.0G; Japan 2.0H) |
$03A07F5F | 2.0I | NRIP, NRIE | The New Tetris (Europe, USA) |
$03A07F5F | 2.0H | NQKP, NQKE | Quake 64 (Europe, USA) |
$03A07F5F | 2.0F, 2.0H | NFXJ, NFXE | Star Fox 64 (Japan 2.0F; USA two versions 2.0H) |
$03A07F5F | 2.0D | NSWP, NSWE, NSWJ | Star Wars: Shadows of the Empire (Europe; USA, four versions; Japan, Teikoku no Kage) |
$03A07F5F | 2.0I | NEPP, NEPJ, NEPE | Star Wars Episode I: Racer (Europe, Japan, USA) |
Experiments on real hardware by an N64brew contributor found that raising this value lengthens the delay before the copyright screen (Doom 64) or the Nintendo logo (Star Fox 64) appears.
The advanced homebrew header
A convention of the homebrew community, introduced by the EverDrive 64 and extended since, that uses the reserved bytes at $34–$3F so emulators and flashcarts can set up save type and controllers without a game database. It is recognised by the letters ED at $3C–$3D; in that case the game code is not a game code.
| Offset | Size | Field | Meaning |
|---|---|---|---|
$34 | 1 | Controller 1 | The suggested controller on port 1: see the values below. |
$35–$37 | 1 each | Controllers 2, 3, 4 | The same values for ports 2 to 4. |
$38 | 1 | Flags | Bit 0: the ROM holds an embedded metadata ZIP (author, dates, descriptions, pictures). Bits 1–7: unused, should be 0. |
$3C | 2 | Game ID | The ASCII letters ED. |
$3F | 1 | Save type | A bit field, below. |
| Controller value | Meaning | Controller value | Meaning |
|---|---|---|---|
$00 | No information: use the emulator’s usual setting | $80 | N64 mouse |
$01 | N64 controller with Rumble Pak | $81 | VRU |
$02 | N64 controller with Controller Pak | $82 | GameCube controller |
$03 | N64 controller with Transfer Pak | $83 | Randnet keyboard |
$FF | Nothing attached | $84 | GameCube keyboard |
Values $01–$7F mean a standard N64 controller, possibly with a Pak; $80–$FE another kind of controller. Only the values above are listed by the source.
Save type byte ($3F) | Meaning |
|---|---|
| bit 0 | The game uses the serial real-time clock (through Joybus) |
| bit 1 | Region free: the game works on any TV type although its game code names a region; menus should boot it with the console’s own TV type |
| bits 2–3 | Expansion Pak use: 0 unspecified (older ROMs), 1 unused, 2 recommended (runs without it, better with it), 3 required (the game must stop at start with an “Expansion Pak required” screen) |
| bits 4–7 | Save type: 0 none, 1 4K EEPROM, 2 16K EEPROM, 3 256K SRAM, 4 768K SRAM (banked), 5 Flash RAM, 6 1M SRAM |
Without the header the byte at $3F is the ROM version. The explorer does not decode this header.
Not described
Known, not yet covered
- Reference: the meaning of every libultra version value beyond the layout above (the source gives only the layout and an example); the Conker’s Bad Fur Day and Perfect Dark debug ROMs hold
6F 23 01 3A 2F C9 CB 36and54 E4 D8 38 2F BD 95 36in the reserved bytes at$18(the source guesses a check code for the Rareware security dongle); the metadata ZIP format (its own N64brew page, not read). - Viewer: the advanced homebrew header (
ED, controllers, save type) is described above but not decoded in the tree. - 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