The Starship asset pipeline transforms a raw Star Fox 64 ROM into the twoDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HarbourMasters/Starship/llms.txt
Use this file to discover all available pages before exploring further.
.o2r archives the engine loads at runtime. Understanding this pipeline is essential for contributors who need to add new asset definitions, and for modders who want to know how asset paths are structured inside the archives.
Supported ROMs
Starship only accepts US 1.0 and US 1.1 ROMs for base asset extraction. Both versions are compressed with MIO0 and must first be decompressed before extraction begins.| Version | Compressed SHA-1 | Decompressed SHA-1 |
|---|---|---|
| US 1.0 | d8b1088520f7c5f81433292a9258c1184afa1457 | 63b69f0ef36306257481afc250f9bc304c7162b2 |
| US 1.1 | 09f0d105f476b00efa5303a3ebc42e60a7753b7a | f7475fb11e7e6830f82883412638e8390791ab87 |
JP and EU ROMs are supported only for voice audio replacement (producing
sf64jp.o2r / sf64eu.o2r in mods/). They cannot be used as the base ROM for general asset extraction.Pipeline steps
Provide a US ROM (.z64)
Place your verified US 1.0 or US 1.1 ROM in the project root (the same directory as
CMakeLists.txt), naming it baserom.z64. The file must be in big-endian .z64 format; convert from .n64 with a byte-swapper if needed.Run the ExtractAssets CMake target
The Internally, CMake executes:Torch reads
ExtractAssets target builds the Torch extractor tool and then runs it against the ROM:config.yml to locate the asset YAML definitions, decompresses the ROM with the MIO0 method, validates the SHA-1 checksum, and then walks each YAML definition to parse and serialize every asset.Asset YAML definitions are read from yamls/
YAML files under
yamls/us/rev0/ (US 1.0) or yamls/us/rev1/ (US 1.1) describe every asset segment: its name, type, and byte offset inside the ROM. The top-level files (assets.yaml, main.yaml, overlays.yaml, header.yaml) compose the full asset map.Example entry pattern:Torch produces sf64.o2r in the project root
After processing all YAML definitions, Torch writes
sf64.o2r to the project root. The archive contains every serialized asset keyed by its internal path (e.g. sf64/assets/ast_andross). CMake then copies the file into the build directory.Run the GeneratePortO2R CMake target
Port-specific assets (UI widgets, enhancement textures, etc.) live under CMake runs:This produces
port/ in the source tree. The GeneratePortO2R target packs them:starship.o2r in the project root and copies it to the build directory.config.yml structure
config.yml maps ROM SHA-1 hashes to extraction configuration. The extractor reads this file to know which YAML path to use, which microcode variant (F3DEX) to target, and where to write output files.
preprocess block that decompresses the ROM and restarts the hash lookup against the decompressed target. The decompressed entry carries the real extraction config.
| Field | Description |
|---|---|
path | Directory containing YAML asset definitions |
gbi | Graphics Binary Interface variant (F3DEX) |
sort | Asset sort strategy (OFFSET = ROM byte order) |
output.binary | Output archive filename (sf64.o2r) |
output.code | Directory for generated C source stubs |
output.headers | Directory for generated C header files |
Runtime asset loading macros
The engine exposes two C macros for fetching asset data by path:GameEngine_OTRSigCheck inspects the first seven bytes of the string for the sentinel __OTR__. Archive paths injected by the resource system carry this prefix; raw file-system paths do not. This allows the same game code to work with both archived and non-archived asset sources.