{
  "added_at": "2026-10-19",
  "additional_evidence_urls": [
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/PROGRESS.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/DOS_BUILD.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/TOOLCHAIN.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/ORACLES.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/RUNTIME.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/docs/REFERENCE_ANALYSIS.md",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/config/toolchain.toml",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/.github/workflows/ci.yml",
    "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/LICENSE"
  ],
  "category": "reconstruction-cases",
  "description_en": "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.",
  "description_zh": "为日版 PC-98 Touhou 4：东方幻想乡重建源码，并在 Wine 下用固定版本的 Borland 工具链重新构建全部四个 DOS 程序：MAIN.EXE、OP.EXE、MAINE.EXE 和 ZUN.COM。针对原二进制的函数认定，与在模拟器中对照原游戏比较输入、随机数、对象池和画面的回放分开记录。完整流程、原始时序与字节一致性目标仍未完成。",
  "entry_url": "https://awesomerea.org/resources/th04-reconstruction-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/th04-reconstruction-case/",
  "evidence_url": "https://github.com/N0zoM1z0/th04/blob/11577b35392c706f3bd39ff1ea932c003e1eaa6b/README.md",
  "group": "cases",
  "id": "th04-reconstruction-case",
  "json_url": "https://awesomerea.org/resources/th04-reconstruction-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/th04-reconstruction-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/th04-reconstruction-case/index.md",
  "name": "TH04: rebuilding Lotus Land Story’s four PC-98 programs from source",
  "name_zh": "TH04：从源码重建东方幻想乡的四个 PC-98 程序",
  "reconstruction_method": "matching-decompilation",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirement_facets": [
    "testing",
    "prerequisites",
    "prerequisites",
    "testing",
    "license"
  ],
  "requirements": [
    "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 is reported with scoped Linux clears.",
    "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.",
    "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; REA’s TH04 helper showcase and Touhou essay cover parts of it."
  ],
  "requirements_zh": [
    "自动生成的 PROGRESS.md 报告四个程序共 663 个已审原作函数中 661 个一致，MAIN 已确认原作字节的 99.97% 一致，另有两个 MAIN 情形延后处理。README 说明重建产物不必复现原可执行文件字节，完整游戏与原始时序验收尚未完成。port/modern-64 分支上的 64 位原生移植报告了有限范围的 Linux 通关。",
    "需自备含日版 zun.hdi 的合法副本；导入程序要求 OP.EXE、MAIN.EXE、MAINE.EXE 和 ZUN.COM 与 README 列出的大小和 SHA-256 一致，其来源标注为 candidate-local-attested，尚待独立的原始转储确认。准备镜像时会修改该镜像的一次性副本，原可执行文件和素材从不提交到仓库。",
    "构建在 Wine 下使用 Turbo C++ 4.0J、TASM 5.0 和 TLINK；初始化脚本从 TOOLCHAIN.md 不视为权威来源的第三方镜像获取这些工具，并从固定版本的 ReC98 检出中取得 MS-DOS Player。测试宿主为 Debian 12 x86-64 与 Python 3.11。运行检查另需 DOSBox-X 2024.03.01、Xvfb、xdotool 和 ImageMagick，Windows 构建入口通过 WSL 工具链桥接。",
    "README 报告：在四段内置演示及更长的第 1–3 关路线中，原版与重建版 DOS 回放在实际输入、分数、随机数、九个对象池、22 个状态块及配置的画面区域上一致，但原始 GDC 时序和部分重置后的输入采样仍有差异。2026-10-16 的审计发现本地存储中缺失冻结的原生程序和候选 MAIN 文件，因此重放历史结果须先恢复这些文件。公开 CI 只运行不依赖目标文件的检查。",
    "MIT 许可覆盖仓库原创代码与文档，不涵盖游戏、素材或第三方作品；作为迁移输入并获署名的 ReC98 在固定版本中没有许可证文件，Borland 工具仍为专有软件。仓库围绕编程智能体交接文档组织；REA 的 TH04 辅助函数展示与东方重建文章覆盖其中部分内容。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/N0zoM1z0/th04",
  "verification": "source-reviewed",
  "verified_at": "2026-10-18"
}
