0.7.0 · FORGE

Forge

Pack once. Verify always. Play anywhere.

Forge is the sigilOS toolchain for ROM containers — it packs ROM + BIOS + save state into a single capability-secured Relic file, verifies it before launch, and gates the emulator core to exactly what it's allowed to see.

★ NATIVE DESKTOP PREVIEW · v0.1

Sigil Forge, running native on your desktop. Written once in Sigil, compiled per platform by cc0 — no VM, no emulator, no interpreter, no Python. This v0.1 preview prints the Forge library — 66 launchable systems and their shared-CPU emulation cores (growing fast — check PARITY.md for the current count) — as a real native binary; the same Sigil source produces all three downloads, differing only in a thin per-platform backend.

macOS · Apple Silicon
arm64 · Mach-O · 33 KB
Download
sha256 03a67576…9caa0574
Linux · x86-64
static ELF, no libc · 4.5 KB
Download
sha256 b90f3b0b…17651d21
Windows · x86-64
PE32+ · no runtime · 6.5 KB
Download
sha256 e0e3ecf7…b696ddba

macOS: ad-hoc signed (not notarized) — right-click → Open, or xattr -d com.apple.quarantine forge-0.1-macos-arm64. Windows: unsigned preview — SmartScreen may warn; “More info → Run anyway”. Verify any download with SHA256SUMS (shasum -a 256 -c SHA256SUMS) — full README. All three are built from one Sigil source by cc0; windowed emulator cores (display/input/audio) are the next milestone.

Sub-components

forgery_pack.sg
PACKER

Reads ROM + optional BIOS + optional save state. Computes CRC32 of the ROM section. Writes the 16-byte Relic header, section table, and all section data into a single .relic file. Accepts key=value metadata at the CLI.

forgery_verify.sg
VERIFIER

Validates magic bytes (FORG), format version, section table coherence, file size, and recomputes CRC32 of the ROM section against the stored value. Returns FORG_OK or a typed error. Called by rp_launch before any capability is issued.

Relic binary format
FORMAT SPEC

16-byte header: magic FORG · version · section count · flags. Section table: offset+length per section. Sections: ROM (required), BIOS (optional), SAVE (optional), META (key-value store). CRC32 + SHA-256 over ROM data. Full spec →

rp_launch cap gate
CAPABILITY GATE

The launcher calls forgery_verify.sg before issuing any emulator capability. On FORG_OK, it grants the emulator core a scoped handle covering only the ROM and BIOS sections — no ambient filesystem access, no loose file paths.

Lifecycle

Step 1
forgery_pack
Read ROM + BIOS + save. Compute CRC32. Write 16-byte header + section table + data into .relic.
Step 2
forgery_verify
Check magic, version, section coherence, file size. Recompute CRC32. Return FORG_OK or error.
Step 3
rp_launch
Verify passes → issue cap-scoped handle to emulator core. Core sees ROM+BIOS only.
Step 4
Emulator core
Runs with scoped capability. No loose files, no ambient authority. Save state written back via --embed-save.

Relic header layout

magic[4]
Always FORG (0x464F5247). Verified first by forgery_verify.sg — wrong magic → immediate reject.
forge_version
Relic format version, auto-filled by forgery_pack.sg. Checked for compatibility on verify.
section_count
Number of sections in the section table. Minimum 1 (ROM). Maximum 4 (ROM + BIOS + SAVE + META).
crc32_rom
CRC32 of the ROM section data only. Recomputed and compared by forgery_verify.sg at launch time.
sha256_rom
SHA-256 of ROM section for additional integrity verification. Covers same bytes as CRC32 but with collision resistance.
section table
Offset + length per section, immediately following the fixed header. Sections: ROM (required), BIOS, SAVE, META (all optional).

Creating a Relic

# NES ROM with metadata
forgery_pack.sg mario.nes title="Super Mario Bros" region="US" year="1985"

# SNES ROM + save state
forgery_pack.sg zelda.sfc --embed-save zelda.sav title="Zelda: A Link to the Past"

# System requiring BIOS
forgery_pack.sg game.bin --bios bios.bin title="My Game" sys="zxspectrum"

Verification and status

FORGE-VERIFY-PASS · 0.7.0

All Relic format operations — pack, verify, CRC32 integrity, section table coherence, BIOS embedding, save-state round-trip — verified on sigilOS RetroPie. forgery_verify.sg gates every launch. Zero tolerance for tampered or truncated containers.

Supported ROM formats

ExtensionSystemBIOS required
.nesNintendo Entertainment SystemNo
.sfc / .smcSuper NintendoNo
.gbaGame Boy AdvanceOptional
.gb / .gbcGame Boy / ColorNo
.md / .binSega Mega Drive / GenesisNo
.binPlayStation 1 (multi-bin)Yes
.zipZX Spectrum (z80/tap)Yes
anyCustom via sys= metadataVaries

Relics are the native game format for sigilOS Forge. The Relic container spec lives at relics.html → Binary format. Forge ships as part of the Forge lane's 0.7.0 milestone.