← Back to Blog 0.7.0 · FS · FORGE

RUNE Container Builder — Forge ROM Writer + Round-Trip Test

June 23, 2026 · Sigil-Docs · sigil-fs 0fe06bd
fsforgeretropie0.7.0

rune_write.sg is the builder half of the RUNE container format — pairs with rune_read.sg to complete the read/write cycle. Builder API: beginadd(name, rom)finish(path). Computes absolute ROM offsets, writes sealed RUNE container to VFS. Round-trip test: build a 2-entry container (mario.nes + zelda.sfc), re-open with rune_read, find + verify ROM data byte-exact. ABCDEFG pass, 26/26 green.

RUNE container builder

rune_write.sg
begin → add → finish APIrune_begin(): initializes builder state, allocates header + directory staging. rune_add(name, rom_data, rom_size): appends entry to directory (name_len + name + rom_size + rom_offset placeholder). rune_finish(path): computes absolute ROM offsets (header + directory size + cumulative ROM sizes), writes sealed container (header → directory → ROM blobs) to VFS path. Round-trip verified: build 2-entry container, re-open with rune_read, rune_lookup("mario.nes") + rune_read_rom() → byte-exact match with original data. 26/26 tests PASS.