The idea in one box
The disc is never resized. Almost every edit overwrites bytes in place and re-encodes the sector's error-correction fields, so no file offset or table of contents ever moves. Where an edit's meaning forces a length change (a door name), the scene's script is rebuilt and recompressed into the same footprint - or the scene is skipped. New behaviour is hand-written MIPS parked in bytes the game never reads, reached by a two-instruction detour.

At a glance

Tool
legaia-patcher (CLI) and the browser ROM patcher - same code, nothing uploaded
Input / output
Your own USA disc image → a shareable PPF patch (no Sony bytes) and an optional patched copy
Three foundations
LZS encoder psx_lzs::compress · sector write-back psx_iso::write · PROT-entry bridge disc::DiscPatcher
Edit classes
in-place (same-size) for tiers A, B, C, E, F; relocate (footprint-bounded) for tier D
Confidence
Shipped - every mod has a disc-gated oracle test that re-decodes the patched image
Full reference
Randomizer / disc patcher (every flag, every hook)

The technique ladder

Seven techniques in ascending order of what they let you change - and of how much reverse engineering each demands before the first byte can move.

The disc-patching technique ladder, tier A (simplest) up to tier G (most advanced) More advanced - more reversing G Carrying a RAM patch on disc Super Arts Pack (by ZetaPhoenix) - a community RAM patch streamed from annex sectors by an injected loader foreign payloads F Overlay dead-region injection Seru-trading vendor · roadmap: battle assist, Seru racing, dome betting, Blood Moon new systems E Code injection via the rodata gap Bonus equipment drops · run-away EXP · enemy ally · shiny Seru new behaviour D Variable-length relocation Doors (scene transitions) · high-capacity starting bag resize + fix-ups C Rewriting field-VM bytecode Treasure chests · town shops · random encounters · house doors operand rewrite B Editing inside LZS Monster drops · monster combat stats · weapon specialty decompress / repack A Static-table overwrites Steal items · spell costs · element affinity · prices · casino same-size data Foundational - same-size data edits
Each rung is a page in this series. Variants (the GIVE_ITEM splice, the new-game seed stamp, the string injection, the engine-facing config blob) are specialisations of a parent tier, tagged on their catalog rows rather than given their own rung.

Read in order

Later rungs assume the earlier ones' machinery. If you read only one, read tier B - it is where "we can only overwrite bytes in place" stops being a limitation.

TierPageWhat it is aboutWhy a player might care
AStatic-table overwritesFixed-width stat tables in the executable - steal items, spell costs, element affinities, prices, casino prizes.The simplest way anything on the disc changes, and where every randomizer starts.
BEditing inside LZSMonster records live compressed inside fixed slots; an encoder the retail decoder accepts is what makes them editable.Why "edit the monster" needed a compressor before it needed an editor.
CRewriting field-VM bytecodeChests, shops, encounters and house doors are operands in each scene's script.How a chest in Rim Elm can hold something it never held.
DVariable-length relocationA door carries its destination's name inline, so re-pointing it resizes the record.The door randomizer and the high-capacity starting bag.
ECode injection via the rodata gapHand-assembled MIPS detoured into reclaimed space in the executable.New behaviour, not just new data - and the traps that bite the first time.
FOverlay dead-region injectionA whole new screen hosted in a menu overlay's dead space: the Seru-trading vendor.Where genuinely new features come from.
GCarrying a RAM patch on discA community GameShark mod - the Super Arts Pack by ZetaPhoenix - parked in annex sectors and streamed into free RAM by an injected loader, installed byte-for-byte.How someone else's cheat-device mod becomes a cold-boot disc patch, credit intact.

Three capabilities the preservation track never needed

The asset-preservation half of the project only reads the disc. Writing one back needs three pieces, and every mod stands on them.

CapabilityModuleWhy
LZS encoderpsx_lzs::compressRetail ships only a decoder. Greedy LZSS, slightly looser than Sony's packer, always accepted - Legaia LZS.
Sector write-backpsx_iso::writeA CD sector carries error-correction fields over its payload; overwrite the payload and they must be recomputed or the sector reads as damaged - disc geometry.
Disc bridgedisc::DiscPatcherMaps a "PROT entry N, offset K" edit to the sector it lives in through the PROT.DAT table of contents.

The editing model: same-size, except when it can't be

Mod catalog

Every current mod grouped by technique, plus the roadmap. The table is generated from site/_content/writeups/disc-patching/mods.toml at build time. Gap flags mods that share the executable's reclaimed rodata region - a finite resource, and the contention that tier F exists to escape. Edit is in-place (same-size) or relocate (footprint-bounded).

Planned rows concentrate at the top of the ladder, where system-level changes live.

See also

Reference Randomizer / disc patcher ROM patcher (in browser) Static overlay pipeline Legaia LZS MAN relocation