Building the ISO
tools/build_mod.py turns an untouched disc image into a patched one. It never writes to the source, and it is
deterministic: the same inputs give the same output, so the build is the only place changes exist. Nothing is ever
hand-patched into an ISO.
python tools/build_mod.py # find the original by CRC, write "<name> [Modded].iso"
python tools/build_mod.py --src my.iso --out out.iso
python tools/build_mod.py --include tools/rig/testops # add extra recipes (test-only ones, say)
python tools/verify_iso.py original.iso modded.iso # check the result
The steps
- Tools. Build
twinsdumpif its source is newer than the binary. - Level edits. Apply every
mod/levels/*.opsrecipe (plus any--includedirectories, plusmod/skip_prompt.opslast) to the original.rm2files, and splice the edited script items back in. - Text. Apply
mod/text.txtto the language files - that is where the "hold △ to skip" string comes from. - Materials. Switch the shadow-receiver flag on for crate materials (
tools/materials.py). - Executable patches. Apply
mod/elf_patches.txt, checking every original word first. - Disc layout. Move
CRASH.BDto the end of the image and pack the files that followed it down into its old place, updating ISO 9660 and UDF. - Rebuild
CRASH.BD/CRASH.BHwith the edited level files, and write the.pnachfor the new CRC.
Each step prints what it changed, including the byte delta for every level file - which is the quickest way to spot a recipe that did nothing.
Why a recipe and not a patched file
Level files are large and mostly opaque. Keeping the edit rather than the result means:
- the repository contains no game data,
- a change can be read and reviewed as four lines of text,
- the same recipes can be applied to a freshly dumped disc, or to a different build, and will fail loudly rather than silently corrupt if the data underneath is not what was expected.
What the ISO ends up with
- Executable patches for the skip, the fixes and the timing changes.
- Level recipes for the scenes whose skip wiring was cut, and for the contact-damage fix.
- The skip prompt in five languages.
- Crate materials marked as shadow receivers.
CRASH.BDat the fast edge of the disc.
Everything else on the disc is byte-identical to the original, and verify_iso.py proves it.