ROM Header: Difference between revisions
no edit summary
m (Moved suggested controller devices to 0x34, since the idea of having a separate magic number to indicate controller hints was discarded.) |
NUS-LIAM-UKV (talk | contribs) No edit summary |
||
Line 1:
== Standard header ==
The following table shows the standard contents of the ROM header. Most of the structure of the header is defined by the [[IPL3]] routines commonly used in commercial games (which are actually contained in the ROM itself); only a few fields are accessed by IPL2 (which is burned in [[PIF-NUS|PIF ROM]]) and are thus hard-coded for all possible valid N64 ROMs.
Line 6 ⟶ 5:
|+
!Offset
!Size
!Name
!Description
|-
|0x00
|
|PI BSD DOM1
|These flags are used by IPL2 to configure access to the ROM (which is mapped in the PI DOM1 space, see [[memory map]]). IPL2 first configure the PI to its slowest speed to be able to read these 4 bytes, and then use them to configure the correct speed to access the ROM.
Line 22 ⟶ 21:
|-
|0x04
|
|Clock
|This field is masked by 0xFFFFFFF0 to obtain the proper clock rate value.
A value of 0 appears to use the default clock rate of 62.5MHz.
Cruis'n USA sets this field to 0x3B9ACAF, which results in a value of 6085000 (60.85MHz). Other titles, such as Star Fox 64, set this field to 0x3A07F5F, which results in a value of 6250000 (62.5MHz).
|-
|0x08
|
|Boot Address
|Initial PC in RDRAM. IPL3 will jump to this address when it has finished initializing the hardware, to boot the ROM.
Line 40 ⟶ 43:
|-
|0x0C
|
|?▼
|?▼
|-▼
|2▼
|Libultra Version
|These
{| class="wikitable"
|+
!Offset
!Size
!Description
|0x0
|0x2
|Reserved, or possibly used to store the patch version.
|0x2
|0x1
|Major and minor version of libultra as decimal value. For instance, version "2.0" is encoded as decimal 20 (hex 0x14).
|-
|0x3
|0x1
|Revision version of libultra, as ASCII letter.
|}
For instance, libultra version "2.0L" is reported as 0x14 0x4C.
Line 62 ⟶ 70:
|-
|0x10
|
|Check Code
|64-bit
Sometimes, these 8 bytes are referred to as "CRC HI" / "CRC LO" or "CRC1/2", but the
Line 73 ⟶ 81:
|-
|0x18
|
|Reserved
|?▼
|This field is unused by Nintendo, but has seen usage by other developers.
For the Conker's Bad Fur Day debug ROM, this field is set to 6F 23 01 3A 2F C9 CB 36. For the Perfect Dark debug ROM, this field is set to 54 E4 D8 38 2F BD 95 36. Since both of these games were made by RAREWARE, this field could be a check code for their Security Dongle hardware, which was required to be able to boot these games on the N64.
Another ROM, the StarCraft 64 beta, also has data in this field. However, it seems to just be random, as the remaining header fields are also set to random values.
|-
|0x20
|0x14
|Game
|String that contains the name of the game. The encoding is usually either ASCII or JIS X 0201 (a subset of Shift-JIS). Padding Is usually performed with 0x20 (ASCII space).
|-
|0x34
|
|Reserved
|This field is unused by Nintendo, but saw accidental usage in the Tommy Thunder prototype ROM, where the first 4 bytes are set to 0x20. This is possibly due to the developers thinking that the game title field was 0x18 bytes rather than 0x14.
|-
|0x3B
|
|The game code is 4 ASCII characters that are split up into 3 parts - the category code, the unique code and the destination code.
{| class="wikitable"
!Offset
!Size
!Name
!Description
▲|-
|0x0
|0x1
|Category Code
|An alphanumeric character that specifies the kind of media the game is stored on.
{| class="wikitable"
|+
!N
|Game Pak
|-
!D
|64DD
|-
!C
|Expandable
|-
!E
|Expandable
|-
!Z
|Aleck64
|}
|-
|0x1
|
|Unique Code
▲|Game ID
|Two
|-
|0x3
|
|Destination Code
|An
{| class="wikitable"
|+
Line 179 ⟶ 204:
!N
|Canadian
|}
|-
|0x3F
|
|ROM
|This byte is used to identify the
|-
|0x40
|0xFC0
|IPL3
|This area contains the [[IPL3|IPL3 boot code]]. Each ROM ships its own IPL3 that is meant to work together with the [[CIC]] installed in the ROM. Before running IPL3, IPL2 checks its checksum also using a seed coming from the CIC, which binds each IPL3 code to a specific version of CIC.
|