reCart
Documentation Menu
On This Page

Platform & SDK Design Document: reCartOne

  • Design Profile: PLATFORM_SDK_ENGINE (ENGINE)
  • Current Shipped Baseline: v0.1.4 (Implemented)
  • Active Target Horizon: v0.2.0 (Locked for v0.2.0)
  • Charter & Roadmap Anchors: CHARTER.md · ROADMAP.md · ARCHITECTURE.md

1. Product Vision & Core Capabilities

Clean-room .NET 8.0 ahead-of-time static recompilation engine, 6502 -> C# lifter, and hardware-timed RP2A03 / RP2C02 (platformId: "nes") runtime for reEngine.

Shipped & Scoped Capability Pillars

  • AOT-Primary Execution (staticAotOnly Default): Clean-room 2-member recipe ([module.recomp.json, aot-recipe.json] including inline jump-table pointer lifting) and 3-member lifted .recomp cartridges compile locally out-of-process on the player's machine into <dataDir>\cache\<moduleId>\<key>\<moduleId>.Generated.dll from user-supplied data\rom\ media (.nes, .prg, .zip, and .7z) verified by SHA-256 while the interactive SDL3 window opens immediately with live compilation progress, failing closed cleanly if an unlifted code address is encountered.
  • Unified 6502 -> Shared IR & Raw-Media Bring-Up (v0.2.0 -> v0.7.0): Tier 3 Collectible RyuJIT and Zero-RWX Threaded-IR (--jit-bringup, arriving in v0.2.0 and hardened through v0.7.0) share a single bank+RAM-epoch-keyed IR frontend that enables emergency fallback, bringup.profile.json profiling, best-effort standalone .nes/.fds JIT boot, and automated 100% static AOT promotion — while InterpreterOracle remains strictly quarantined behind --execution-tier interpreterOracle.
  • Two-Phase Aspect-Locked Video & Band-Limited Audio: Today reCart drives all 5 reEngine.Host v0.6.2 backends (OpenGL 3.3 Core, Vulkan 1.3, DirectX 12, ParallelCpu, Software) defaulting to nativePar (8:7 NTSC PAR pillarboxed — never stretched to 16:9) alongside fourByThree, squareInteger, nativeFit, and opt-in horPlus16By9. The v0.3.0–v0.4.0 backend upgrades add CPU-cycle Blip-buffer synthesis, PAL/Dendy timings, two-phase scanline-band ParallelCpu (1x bit-exact to Software), and native GPU sprite/tile/shader composition (>8 sprites, 24-bit overrides, 120–240 Hz SubTick, CRT/colorblind filters).
  • Proving Ground #1: Designed alongside reSlate and verified with clean-room fixture IronFrame-OuterFortress-Cart-01-Recomp (IronFrame OuterFortress (Cart) 01 / ironframe-outerfortress-cart-01) at deterministic 60.0988 Hz timing.
  • Hardware-Timed Core (NTSC + Mappers 0/1/2/3): Cycle-stepped 6502 (RP2A03 CPU: 56 official opcodes, zero BCD, JMP ($xxFF) page-wrap, $4016/$4017 0x40 open-bus, 513/514-cycle OAM DMA + DMC stalls), cycle-paced static AOT block dispatch, dot-stepped 262-scanline RP2C02 PPU (256x240, odd-frame dot skip, Loopy v/t/x/w scroll, sprite-0 hit & NMI suppression), 5-channel RP2A03 APU (Pulse 1/2, Triangle, Noise, DMC), and Mappers 0–3 (NROM, MMC1, UxRom, CNROM). Dedicated backend minors expand through Shared IR/JIT (v0.2.0), Blip-buffer DSP + PAL/Dendy (v0.3.0), two-phase ParallelCpu/GPU compositing (v0.4.0), commercial iNES/NES 2.0 mappers + peripherals + Dual-Installer (v0.5.0), clean-room disk-system HLE + 6 expansion audio chips + .re* packs (v0.6.0), and raw-media hardening + static AOT promoter + Research rail (v0.7.0) -> v1.0.0 Going Gold.
  • Static 6502 -> C# Lifter, Jump Tables, Cold AOT Cache & reCart.Decomp: Emits and compiles clean-room 2-member recipe (module.recomp.json, aot-recipe.json with inline jump-table scanning across fixed/switchable banks) and 3-member lifted (.cs, dispatch.meta.json) .recomp ZIP archives (zero *.Generated.dll or retail ROMs bundled), builds .Generated.dll locally out-of-process asynchronously behind the host compile overlay, and enforces clean-source verification with zero-warning builds.

2. Consumer Mental Model, Public Seams & Compatibility

  • Thin Host + Composable Contracts: Exposes cohesive, strongly typed interfaces and shared runtime primitives so downstream applications avoid duplicating logging, persistence, UI shell, or installer plumbing.
  • Backward-Compatible Evolution: Additive non-breaking minor/patch releases publish immutable versioned drops under _SharedLibs/ while keeping consumer tests deterministic.
  • Containment by Construction: Enforces explicit --data-dir, --config, --log-dir, and sandbox environment overrides across every consumer boundary.

3. Data, Configuration & Failure-Mode Contracts

  • Configuration Precedence: Explicit CLI flags (--data-dir, --config, --log-dir, --port) override environment variables, which override local workspace defaults—ensuring automated tests never touch live production state.
  • Graceful Degradation: Missing optional inputs, offline endpoints, or corrupted local cache files surface clear recovery guidance rather than silent data loss or unhandled crashes.

4. Design Change Log

  • 2026-11-30 (v0.1.4 -> v0.2.0): Synthesized baseline living design specification from shipped architecture, feature registry, and roadmap horizons.