15 · Appendices

Reimplementation Guide

What must be replicated exactly, what can be freely redesigned, in what order to build it, and which proofs already exist that the approach works.

15.1Two very different questions

Decompile-and-recompile: NOT feasible Decompiler output is a reading aid: pseudo-typed pointer arithmetic, invented locals, gotos. Recompiling requires recovering real struct layouts for 12,135 functions and 3,273 vtables, plus Itanium exception unwinding. Comparable matching-decompilation projects target ~1 MB of C and take teams years.
Clean-room reimplementation: feasible Write new code against the documented behavior in this report. The difference is stark: you need the formulas, tables, state machines and file formats, all specified here, not the instruction stream.

15.2Per-subsystem confidence

LayerStatusAnchor
Physics integrator (ttTrainGo, resistances, motor/brake tables, limits, ATS/ATC)ReadyChapter 7 — every constant and table closed
Scoring (15 penalties, 42 bonuses, grades)ReadyChapter 8
Progression/unlock + save formatReadyChapter 9 (0x1b44 payload exact)
Menu/selection/inspection state machinesReadyChapter 5
Departure/door-close, win/lose/pauseReadyChapters 6, 10
Platform contract (EGL/GLES2, evdev, OpenAL/ALSA, XPlayer, SW2001)Ready (desktop)Chapter 2 — the port shim is the existence proof
Asset formats (ALLZ/ALAR/ALSN/ALTX/ALIG/TXM/AMS/.dat)MostlyChapter 14 — headers confirmed; .dat internal field naming is the long tail
Engine internals (fibers, packet opcodes, shaders, pass order)PartialChapters 3, 12 — architecture complete; shader source recovered; per-frame pass order mapped
Map-pack internals (.dat geometry fields without consumers)Partialcorpus-bounded opaque fields preserved losslessly
The strongest existence proof An independent autodrive model built only from this report's physics/scoring specifications (the 0.00054042/0.004623 integrator, the tables, the judgment thresholds) completed real routes (Yamanote 01/02/03, Osaka 01/02/03, Tōkaidō 01/03) withh zero penalty accumulators. The game logic is reproducible from the spec alone.

15.3Must replicate

  1. Game-logic behavior to formula level — integration constants, resistance formulas, brake/motor tables, limSpeed[], penalty/bonus tables, stop windows, timetable tiers, unlock graph.
  2. The per-frame pass order (Chapter 4's 34-step loop) — or an equivalent ordering producing the same visible result.
  3. The save payload — exact 0x1b44 layout at 0x0000/0x004c/0x03b8, wrapped as exactly 0x245c Base64 chars in XML.
  4. Asset decoding — enough of Chapter 14 to mount the original Data/ tree. Note: adding a route is not data-only: menu entries, route metadata, station/timetable rules and unlock logic live in fixed executable tables.
  5. Platform contracts — GLES2-class rendering; controller detents that persist between polls; audio completion gates (a stubbed backend deadlocks departure; Chapter 6); video callback state machine.
  6. Rendering output — same visuals, not the same mechanism.

15.4Can skip

15.5Four ranked paths

PathDescriptionVerdict
AFull clean-room C++ clone on a new engine (SDL2/GLFW + GLES2/GL3, OpenAL, ffmpeg), reusing original assetsFeasible. Person-years solo; 6–12 months small team. Risks: shader recovery and .dat layout — both have traced entry points
BLogic reimplementation on an existing engine (Godot/Unity/SDL) with converters or new assetsFeasible. 3–6 months. Lower fidelity, higher productivity
CSelective in-process replacement via the non-PIE fixed addresses (input contract, EGL bridge, video stub, dongle patch)Feasible, already demonstrated — natural precursor to A
DRun the original binary on new hardware (qemu-user + Mesa, or native ARM SBC via the shim)Already done — solves "play it", not "rebuild it"

15.6Suggested build order

  1. Physics core (Chapter 7): tables from the binary + ttTrainGo. Unit-test against live-observed accelerations.
  2. Judgment layer (Chapter 8): subLifePoint + judges with the profile tables.
  3. Departure/arrival machines (Chapter 6) + GameTask loop (Chapter 4) with a stub renderer.
  4. Menu system (Chapter 5) + save I/O (Chapter 9).
  5. Asset pipeline (Chapter 14): ALLZ first (everything depends on it), then ALAR, ALSN, the DAT walker.
  6. Renderer (Chapter 12): sprites/HUD first (most of the game's feel), 3D world second.
  7. Audio (Chapter 13) — engine sound table + announcement gates.
  8. Polish: conductor mode, overtake cinematics, museum, attract loops.
The three traps 1. Audio gates: make every clip complete or departure deadlocks. 2. Frame-order dependence: physics → judgments → rendering, same frame. 3. The power-latch: the original input contract requires KEY_POWER held or the game terminates itself within a frame.
← 14 · Asset File Formats