Skip to content

Notation and conventions

Every reference page writes numbers, field types, offsets, citations and evidence tags by the rules on this page. The glossary defines the terms.

  • Hexadecimal values carry the prefix 0x and use upper-case digits: 0x1F, 0x800E4000. No $ prefix, h suffix or upper-case X. A RAM address has eight digits. An offset or a mask has as many digits as its table column needs, with at least two.
  • Decimal values have no prefix. A number of four or more digits has commas: 6,344.
  • Quantities are decimal. A size, count, stride, length or duration is a plain number: a record of 164 bytes, 8 records, a stride of 36. Hex is for values that name a place or a bit pattern: addresses, offsets, masks, flag and byte values, ids and alignment boundaries. When the code states a size in hex, the page gives it in decimal, so 0x10B0 bytes is 4,272 bytes.
  • Sizes are in bytes unless the text says otherwise. KiB is 1,024 bytes and MiB is 1,048,576 bytes. A CD-ROM sector holds 2,048 bytes; its alignment boundary is written 0x800.
  • Ranges. A-B includes both ends: 0x10-0x1F is 16 values. A..B stops before B, so B is the first byte after the range: 0x80000000..0x80200000 is the 2 MiB of RAM. In prose, “0 to 6” is inclusive.
  • Counts. Slots, entries, rows and indexes start at 0. “Entry 3” is the fourth entry of an archive. “N of N” says a check covered every instance on the disc.

Bit 0 is the least significant bit, so bit n has the value 1 << n. A single bit is written “bit 3”. A range goes from the low bit to the high bit: “bits 4 to 6”. A mask names the same bits by value: bits 4 to 6 are mask 0x70. A nibble is four bits. The low nibble is bits 0 to 3 and the high nibble is bits 4 to 7.

A table that splits a value into fields has a Bits column in the same form, for example 24 to 31.

All multi-byte values are little-endian: the low byte comes first. The CPU is a MIPS R3000A in All multi-byte values are little-endian: a u32 stored as the bytes 00 08 00 00 is 0x800. The same holds on the disc: FIRST.EMI starts 0E 00 00 00, an entry count of 14.

A few fields are big-endian because they come from other file formats, such as the MIDI-like A few fields are big-endian because they come from other formats, such as the MIDI-like SEP packages; a page marks each big-endian. A signature shown “in file order” lists its bytes as stored, such as 70 42 41 56 for the VAB tag pBAV.

Type Meaning
u8 unsigned 8-bit integer (one byte)
u16 unsigned 16-bit integer
u32 unsigned 32-bit integer
s8 signed 8-bit integer, two’s complement
s16 signed 16-bit integer
s32 signed 32-bit integer
T[n] an array of n values of type T, for example u8[8]
char[n] n bytes of text; the game’s own byte encoding (text) unless the page says ASCII
s32 (16.16) fixed point: the high 16 bits are the integer part and the low 16 bits the fraction, so 0x00018000 is 1.5

A field that holds a RAM address is written T*, where T is the type it points to: u16*, void* or a record name such as Enemy*. A run of bytes with no known structure is u8[n]. A field type that no reader proves carries the tag [inferred].

The MIPS terms halfword (16 bits) and word (32 bits) appear in prose about code. In prose about VRAM and palettes, a word is one 16-bit VRAM cell, as in “a 16-bit CLUT word”. Layout tables use u16 and u32 for fields, so one field type has one name on every page.

Four kinds of position appear. Each page says which one a number is.

Kind Counted from Written as
RAM address the start of the console’s address space 0x80195800 (eight digits)
file offset byte 0 of a file, such as an executable or a save file 0x270
archive offset byte 0 of an .EMI file, which starts with its table of contents 0x33964
payload offset the first byte of one entry’s payload 0x33164
record offset the first byte of one record in a table 0x1C in a table, +0x1C in running text

The archive offset of a payload byte is the payload offset plus the offset at which the payload starts in the file. For the first entry of an archive, that start is 0x800. A code entry loads at the RAM address in its table-of-contents row, so a RAM address in that entry is the load address plus the payload offset (EMI container).

An entry is named ARCHIVE.EMI#n, for example GAME.EMI#0, or by its path BIN/ETC/GAME.EMI, entry 0. A fixed-address RAM table is named by its address, for example 0x801448D8.

An image is one program that the game loads. Its id is a path, written in lower case.

Image id What it is
exe/slus_004_22 the main executable, SLUS_004.22, resident from boot to power-off
exe/logo the logo program, LOGO/LOGO.EXE
emi/<folder>/<archive>/NN the code in entry NN of an EMI archive, for example emi/world02/area078/13 is entry 13 of BIN/WORLD02/AREA078.EMI

A claim about the game’s code names the function and its image in one code span: Name (image@0xADDR). For example, SYS_Main (exe/slus_004_22@0x8014AAC8) is the function SYS_Main at address 0x8014AAC8 in the image exe/slus_004_22. Read the address together with its image, because overlays reuse addresses. A paragraph that has already named the image may give the address alone: Name (@0xADDR).

The name is a label from this research, not a name that the game stores.

  • func_801A0048 is an address name: the function is located but has no role name yet.
  • D_801448D8 is the same for data.
  • A g_ prefix marks a named global and an s_ prefix a named static table, such as g_SpadWork and s_ScriptOpcodeLengths.

A claim with no tag was read in the retail code or data. Two tags mark the exceptions.

Tag Meaning
[inferred] deduced from several reads or from a community source; treat it as a lead
[unknown] not established; the page says what would settle it, and open questions collects them

A record is a fixed-size row of a table. A layout table lists its fields in the order they sit in memory or in the file, with the columns Offset, Size, Type, Name, Meaning and Evidence in that order. A page leaves out Size, Name or Evidence when the column adds nothing. Type stays.

Offset Size Type Name Meaning
0x00 2 u16 item_id the item this row gives
0x02 1 u8 count how many; 0 means one
0x03 1 u8 unused always zero

Columns:

  • Offset: counted from the first byte of the record. Gaps are bytes the page does not describe. A table of RAM structures may use an Address column instead.
  • Size: the field length in bytes; left out when Type fixes it.
  • Type: a type from the table above, or a record name; u8[n] for a run of bytes, u8 for flags.
  • Name: the name this wiki uses for the field.
  • Meaning: what the game does with the value, with its units and legal values.
  • Evidence (some pages): the functions that read or write the field, cited as above.

A record that has a C struct in the decompilation also shows it as a c block after the table.

In the example the record is 4 bytes; the bytes 0A 00 02 00 give item_id = 0x000A and count = 2.

  • Confidence: high. The rules describe how the pages are written; they carry no claim about the game.
  • Evidence: none; the rules carry no game claim.