Case study

TH04: rebuilding Lotus Land Story’s four PC-98 programs from source

Reconstructs source for the Japanese PC-98 Touhou 4: Lotus Land Story and rebuilds all four DOS programs, MAIN.EXE, OP.EXE, MAINE.EXE and ZUN.COM, with a pinned Borland toolchain under Wine. Function acceptance against the original binaries is tracked separately from emulator replays that compare inputs, RNG, object pools and video with the original game. Complete-campaign, original-timing and byte-identity goals remain open.

Requirements and limitations

  • Generated PROGRESS.md reports 661 of 663 reviewed authored functions exact across the four artifacts and 99.97% of confirmed MAIN authored bytes, with two MAIN cases deferred. README says the rebuilt products need not reproduce the original executable bytes and that complete-game and original-timing acceptance are unfinished. A 64-bit native port on the port/modern-64 branch, reported with scoped Linux clears, is not reviewed here.
  • Supply your own legal copy containing the Japanese zun.hdi; the importer requires OP.EXE, MAIN.EXE, MAINE.EXE and ZUN.COM matching the sizes and SHA-256 values in README, whose provenance is marked candidate-local-attested pending an independent pristine dump. Image preparation modifies a disposable copy of that image, and original executables and assets are never committed.
  • Builds use Turbo C++ 4.0J, TASM 5.0 and TLINK under Wine; the bootstrapper fetches them from third-party mirrors that TOOLCHAIN.md does not treat as authoritative, and takes MS-DOS Player from a pinned ReC98 checkout. The tested host is Debian 12 x86-64 with Python 3.11. Runtime checks also need DOSBox-X 2024.03.01, Xvfb, xdotool and ImageMagick, and the Windows build entry point uses a WSL toolchain bridge.
  • README reports original-versus-reconstructed DOS replays agreeing on consumed input, score, RNG, nine actor pools, 22 state blocks and configured video regions across the four bundled demos and longer Stage 1–3 routes, while raw GDC timing and some post-reset input samples still differ. A 2026-10-16 audit found frozen native programs and candidate MAIN files missing from local storage, so historical replay first needs recovery. Public CI runs target-independent checks only; this collection ran nothing.
  • MIT covers repository-authored code and documentation, not the game, its assets or third-party work; ReC98, credited as a migration input, has no license file at the pinned revision, and the Borland tools stay proprietary. The repository is organized around coding-agent handoffs but does not itself document REA use; REA’s TH04 helper showcase and Touhou essay cover parts of it. No runtime reproduction is claimed.

About this entry

Type
Case study
Category
Independent reconstruction cases
Relationship
Independent reconstruction project
Targets
Game

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Primary sources

  1. README.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  2. docs/PROGRESS.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  3. docs/DOS_BUILD.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  4. docs/TOOLCHAIN.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  5. docs/ORACLES.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  6. docs/RUNTIME.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  7. docs/REFERENCE_ANALYSIS.md GitHub · N0zoM1z0/th04 · Revision 11577b3
  8. config/toolchain.toml GitHub · N0zoM1z0/th04 · Revision 11577b3
  9. .github/workflows/ci.yml GitHub · N0zoM1z0/th04 · Revision 11577b3
  10. LICENSE GitHub · N0zoM1z0/th04 · Revision 11577b3