Files
TeslaRel410/restoration/source410/README.md
T
CydandClaude Fable 5 63312e07f9 source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
  is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
  Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
  (extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
  BT game source (never mixed into CODE/). Round 1-3 state:
  * 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
    (BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
    since 1996.
  * BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
    its binary-recorded line 400 exactly.
  * BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
    (Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
    TeamScore=12 flagged [T4]).
  * MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
    (VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
    the period compiler is the drift detector).
  * Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
    (per-TU verification sweep under authentic OPT.MAK flags).
  * README: corrected roadmap - MECH.HPP is the capstone grown with the mech
    TU reconstructions; BTREG.CPP green = the header-family milestone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 07:33:26 -05:00

74 lines
5.3 KiB
Markdown

# source410 — literal reconstruction of the missing BT 4.10 game source
**Everything in this directory is RECONSTRUCTED, not recovered.** The authentic surviving
source lives in `CODE/` and is never mixed with this tree. The goal here is an
archival-grade recreation of the `d:\tesla_bt\` translation units that exist only inside
`BTL4OPT.EXE` (the shipped 4.10 binary), written in the 1995 VWE house style against the
1995 MUNGA/MUNGA_L4 engine headers that DID survive.
## Ground rules
1. **Never copy a reconstructed file into `CODE/`** — the assembled buildable tree
(originals + reconstructions) is produced by a script into a build directory, so
provenance stays unambiguous file-by-file.
2. **Every `.CPP` here has a `.NOTES.md` sidecar** carrying the evidence: the binary
address map, decomp references, which sibling sources supplied each idiom, and every
judgment call with its tier ([T1] decomp-proven … [T4] style guess). The `.CPP` itself
stays clean 1995 style — no modern annotations inside.
3. **Assert line numbers are constraints.** The binary's `Fail()` sites record the original
file+line (`BTL4APP.CPP:400` etc.); reconstructed files are shaped so those calls land on
their recorded lines. A file that can't meet its line constraints yet says so in the
sidecar.
4. **Layout mirrors the original tree**: `BT/` (bt.lib, 36 TUs) and `BT_L4/` (btl4.lib,
13 TUs + BTL4.CPP), matching the surviving `BT.MAK`/`BTL4.MAK`.
## What drives the work
- The per-TU manifest: `C:\VWE\BT411\reference\BT410_SOURCE_MANIFEST.md`
(tool `tools/manifest410.py`; method log `phases/phase-03-bt410-source-manifest.md`).
- The decomp: `C:\VWE\BT411\reference\decomp\all\part_*.c` (+ `section_dump.txt` strings).
- The port's semantic reconstructions: `C:\VWE\BT411\game\reconstructed\` (WinTesla-hosted;
each literal file here re-hosts one back onto the 1995 engine APIs).
- Style/idiom exemplars: surviving `CODE/BT/*.CPP`, `CODE/RP/RP_L4/*.CPP`,
`CODE/RP/MUNGA*/**` (the 1995 engine source itself).
## Status (2026-07-19)
**Compile verification is LIVE: `./compile410.sh --sweep`** (BC4.52 + the authentic OPT.MAK
flags; the period compiler is the reviewer). `backdate.py` mechanizes WinTesla→1995 header
back-dating (donors: `C:\VWE\BT412\engine\MUNGA\*.h`).
| item | state |
|---|---|
| ORIGINAL **BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND** | ✅ **COMPILE CLEAN — 6 of 10 surviving originals** (first builds since 1996) |
| BT/BTCNSL.HPP + BT/BTSCNRL.HPP | ✅ reconstructed round 2 — **console wire IDs recovered from the binary** (Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1]; TeamScore=12 [T4 GUESS — verify]); see BTCNSL.NOTES.md |
| BT_L4/BTL4APP.CPP (pilot reconstruction) | 12/12 functions, Fail() at recorded line 400; compile gated on the mech-family header package |
| MUNGA backfills (VDATA, ROTATION, VECTOR2D, AUDREND, APP, LAMP, GAUGREND, GAUGE) | ✅ 6 compile-proven, 2 parse-proven (BACKFILLS.NOTES.md) |
| ORIGINALS still blocked | BTREG (`btplayer.hpp`), GAUSS+PPC (`emitter.hpp`), BTTOOL (`mech.hpp`) — all gated on the mech-family package |
**Next work package — the mech-family, REVISED (round-3 finding, 2026-07-19):** the plan to
"reconstruct mech.hpp first" was the wrong order. A full read of the port's mech.hpp shows
it is a hybrid (1995 skeleton + Recon proxies + port-only members + relocated fields), and
substantial regions of the binary's 0x854-byte Mech object remain UNMAPPED — the port
declares "the remaining members up to sizeof==0x854" in its mech2-4 slices. A literal
MECH.HPP that precedes those TU reconstructions would be fiction. Corrected order:
1. **MECH.HPP is the CAPSTONE, grown incrementally** with each mech-family TU
reconstruction (mech.cpp → mech2-4 → subsystem TUs), starting as an interface +
known-ordered members with explicit `reserved[]` filler for unmapped regions
(sidecar-tracked), tightened as each TU pins its slice.
2. The dependent headers (`mechsub`, `mechmppr`, `btl4mppr`, `emitter`+`mechweap`,
`btplayer`, `projtile`, `missile`) ship WITH their TUs against the staged MECH.HPP.
3. The blocked originals (BTTOOL, GAUSS, PPC, BTREG) and the BTL4APP pilot compile
green as those land — BTREG last (it includes the whole game-header world).
Offset oracles for every stage: BT411 CLASSMAP.md, decomp-reference.md §3, and the port
headers' static_assert-locked members.
## Toolchain — IN HAND (2026-07-19)
**Borland C++ 4.52**, archived at `../../BORLAND/BC45/`, chosen by byte-match: the fleet's own
`CODE/RP/CW32.LIB` is identical to 4.52's (and not 4.5's). BCC32/TLINK32/TLIB/MAKE run natively
on Win11. The shipped `BTL4OPT.EXE` recipe is `CODE/BT/OPT.MAK` (plain `bcc32`,
`-DLBE4;DEBUG_LEVEL=0;DEBUG_STREAM=cout`, `-5 -a4 -ff -k- -V -Jg -x- -RT-` + the full `-O` set,
PCH `btopt.csm`; link `-Tpe -ax` with `c0x32.obj + dpmi32.lib + cw32.lib` = Borland PowerPack
DPMI32, not Phar Lap TNT). Compile verification of reconstructed TUs is therefore possible
file-by-file; the current blocker for full closure is the 1995 engine header gap (`vdata.hpp`
first — only the drifted WinTesla `VDATA.h` survives, in BT412/engine). Include order for
builds: `CODE/BT/*` over `CODE/RP/*`, `-DNO_PRECOMPILED_HEADERS` until the mech-family headers
are reconstructed. Remaining gap: TASM32 (JOYSTICK.ASM only).