Addresses

From CloudModding MM Wiki
(Redirected from VRom)
Jump to: navigation, search

ROM

ROM is an acronym for Read-Only Memory, or memory that cannot be modified. ROM addresses do not start with a special prefix, since they are able to address more than 16 MiB of space.

N64 games typically take up either 16 or 32 MiB of ROM, and rarely 64 MiB of ROM. Dev flash carts (which are re-writable) are 256 MiB in size.

Commercial releases of Majora's Mask have a maximum capacity of 32 MiB, while the Debug Rom is 64 MiB.

VROM

VROM stands for virtual rom. In commercial releases, the majority of the game files are compressed so that the game is able to fit on the limited space of the 32 MiB rom. VROM addresses are thus used to represent the space that the file would be located if none of the files were compressed.

RAM

RAM is an acronym for Random Access Memory. It's the space where variables are stored. RAM addresses typically begin with the 80 prefix.

N64 games can address either 4 or 8 MiB of ram (addresses 80000000 to 803FFFFF or 807FFFFF).

Majora's Mask is designed to address the full 8 MiB of ram.

VRAM

VRAM stands for virtual ram. It is the addressable space beyond the range of physical ram. The purpose of VRAM is that it allows the compiler to allocate more space than is available, so that the sub programs (stored in overlay files) for actors and similar are able to have their own addressable space without needing to take up physical ram space.

Overlays cannot be used without being loaded into RAM. When the overlay is in ram, any virtual addresses must be re-calculated to a ram address.

N64 games can address 8 MiB of virtual ram (addresses 80800000 to 80FFFFFF).

Segment Addresses

Note: Referred to as "Bank Offsets" in older documentation

The N64's Reality Signal Processor (RSP) utilizes a segment address system to locate matrix, vector, and texture data required to render a frame. The RSP maintains an array of 16 addresses used to reference pure data files. Unlike addresses, segment addresses share the same addressable space across a set of files, rather than allocate a unique space for every file used in the game. Since the CPU is used to generate display lists during runtime, it maintains it's own separate segment address table.

Segment addresses take the form ssoooooo:

  • s is the segment id, which is used as an index to the segment address table.
  • o is an offset, relative to the start of the pointer referenced by the segment index.

Almost always, a segment address of ss00 0000 will reference the start of some file.

Segment Address Table

The segment address table is an array of 16 pointers, which define the start address for offset 0 of all 16 segment ids. Ocarina of Time typically assigns segment addresses in a consistent way:

00 Direct Reference
01 nintendo_rogo_static/title_static
02 Current Scene
03 Current Room
04 gameplay_keep
05 gameplay_field_keep (outside of dungeons), or gameplay_dangeon_keep (dungeons)
06 Current Object
07 unknown/link_animetion
08+ determined by current game circumstances Not tracked by CPU
14 Z-Buffer RSP Only
15 Frame Buffer RSP Only