--- id: source-completeness title: "Source Completeness — the gating blocker + the decompilation route" status: established source_sections: "PROGRESS_LOG.md §5a; docs/BT_SOURCE_STATUS.md" related_topics: [wintesla-port, reconstruction-method, decomp-reference, open-questions] key_terms: [BTL4OPT, decomp, oracle, WinTesla, BT] open_questions: - "Get the missing BT .cpp from Nick (gating for Route A)" --- # Source Completeness — the gating blocker The archive has the **engine and all headers, but NOT the BT game's implementation `.cpp`.** This is THE gating fact that shapes the whole project. Full map: `docs/BT_SOURCE_STATUS.md`. ## What's present vs missing (verified across all 3 zips + the WinTesla archive) - **MUNGA engine** (shared): ~183 `.cpp` — largely complete (renderer, MOVER/JMOVER, math, scene). [T1] - **All BT game `.hpp` headers** present — every class/interface defined (the reconstruction's "answer key"). [T1] - **BT game logic `.cpp`: MISSING** — `mech`, `mech2/3/4`, `mechsub`, `mechmppr`, `mechtech`, `heat`, `sensor`, `gyro`, `torso`, `myomers`, `hud`, `mechweap`, `powersub`, `btplayer`, and the main app `btl4` are all absent. Only ~10 BT `.cpp` survive (BTCNSL/BTMSSN/BTREG/BTSCNRL/BTTEAM/BTTOOL + GAUSS/PPC + BTL4ARND/BTL4MODE). [T1] - **RP can't backfill BT** — RP's game source is gutted the same way. The per-game source for BOTH titles is missing; only shared *engine* game-logic survives. A complete repo likely exists elsewhere (Nick). [T1] ## Consequence — routes forward Route A (recompile original source) is **impossible as-is** — the code that IS the game isn't here. Paths: (1) **get the missing `.cpp` from Nick** [gating, top priority]; (2) run `btrel410.exe` under DOSBox by emulating the VPX/IG board (blocked — needs board emulation); (3) **decompile `BTL4OPT.EXE` + reconstruct from headers** — the chosen route (in progress). [T2] ## The binary is a near-ideal decompile target `btrel410.exe` is a PKZIP self-extractor; inside is **`BTL4OPT.EXE`** (1.24 MB, clean uncompressed PE32, Phar Lap TNT). It retains **class names, `Class::Method` strings, and source-file paths in asserts** (`d:\tesla_bt\bt\mech.cpp`) — confirming the missing modules ARE in the binary. No COFF symbol table (naming comes from those strings). Extracted to `reference/decomp/`. [T1] ## Why reconstruction is viable (THREE anchors) 1. **All BT headers** = exact class layouts, vtable order, signatures (the answer key). 2. **The working WinTesla engine** to compile against ([[wintesla-port]]). 3. **Red Planet's parallel implementations** as a live reference (`VTV`≈mech, `VTVMPPR`≈mechmppr, `WEAPSYS`≈mech weapons, `RP_L4` app≈BT app). Plus `BTL4OPT.EXE` as a behavioral **oracle** (run under cdb / read the decomp). Result = behavior-equivalent **reconstruction**, NOT original source. [T2] ## Key Relationships - Feeds: [[reconstruction-method]] (the loop that fills the gap), [[decomp-reference]]. - Gated on: [[open-questions]] (get the source from Nick). - Built atop: [[wintesla-port]].