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.)
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
!Bytes
!Name
!Description
|-
|0x00
|40x4
|PI BSD DOM1 configuraConfiguration flagsFlags
|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
|40x4
|Clock override(?)Rate
|This field is masked by 0xFFFFFFF0 to obtain the proper clock rate value.
|Usually 0
 
 
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
|40x4
|Boot Address
|Initial PC
|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
|20x4
|?
|?
|-
|0x0E
|2
|Libultra Version
|These two4 bytes are meant to indicate the version of the libultra SDK the ROM was compiled with.
{| class="wikitable"
|+
!Offset
!0x0E
!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
!0x0F
|0x1
|Revision version of libultra, as ASCII letter.
|}
For instance, libultra version "2.0L" is reported as 0x14 0x4C.
Line 62 ⟶ 70:
|-
|0x10
|80x8
|Check Code
|Checksum
|64-bit checksumcheck code calculated on 1 Mbyte of ROM contents starting from offset 0x1000 (after IPL3). This checksumcheck code is computed with a custom algorithm implemented by IPL3 that verifies the integrity of the ROM before booting it. If the checksumcheck code doesn't failsmatch, IPL3 refuses to boot the ROM and hangs the console.
 
 
Sometimes, these 8 bytes are referred to as "CRC HI" / "CRC LO" or "CRC1/2", but the checksumcheck code algorithm is not a CRC, and splitting into two 4-byte words seem confusing when it is really a 64-bit value.
 
 
Line 73 ⟶ 81:
|-
|0x18
|80x8
|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
|20
|Game nameTitle
|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
|70x7
|Reserved
|Unused
|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
|10x4
|Game IDCode
|Media format
|The game code is 4 ASCII characters that are split up into 3 parts - the category code, the unique code and the destination code.
|An ASCII character identifying the physical support that this ROM was extracted from.
{| class="wikitable"
|2+
!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
|Standard gamepad (cartridge)
|-
!D
|64DD diskDisk
|-
!C
|Expandable gameGame: cartridgeGame partPak Part
|-
!E
|Expandable gameGame: 64DD diskDisk partPart
|-
!Z
|Aleck64 cartGame Pak
|}
|-
|0x1
|0x3C
|20x2
|Unique Code
|Game ID
|Two letteralphanumeric codecharacters tothat identify the game. Normally, these are ASCII uppercase letters.
|-
|0x3
|0x3E
|10x1
|Destination Code
|Country code
|An ASCIIalphanumeric character that specifies the countrydestination thisthe ROMgame is intended for.
{| class="wikitable"
|+
Line 179 ⟶ 204:
!N
|Canadian
|
!
|
|}
|?}
 
 
|-
|0x3F
|10x1
|ROM revisionVersion
|This byte is used to identify the revisionversion of the game. Normally the value is 0x010 for the first revisionversion, 0x021 for the second and so on.
|-
|0x40
|0xFC0
|4032
|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.
3

edits