Skip to content

Repository files navigation

東方永夜抄 ~ Imperishable Night

Original Japanese TH08 1.00d title screen

TH08 exact-source and playable-platform progress

Repository status

This repository reconstructs the source code of the original Japanese 東方永夜抄 ~ Imperishable Night version 1.00d executable. The authored-source recovery milestone is complete: all 1,107 authored functions are present in source. Strict comparison currently accepts 1,105 of those functions, covering 459,115 of 459,757 authored bytes.

Area Status Current position
Authored source Complete 1,107 / 1,107 functions are present in source
Strict authored comparison 99.86% by bytes 1,105 / 1,107 functions are accepted as exact
Whole executable In progress PE layout, linked runtime/library code, and two authored near matches remain
Web Playable Public WebAssembly/WebGL 2 build
Linux Playable Native i386 ELF and portable CI package
Windows In progress Native startup and redistributable packaging are incomplete
macOS In progress Native backend and packaging have not been implemented

The exact-reconstruction lane and the playable-port lanes are independent. Running on a modern platform is not an exactness claim, and source presence is not counted as a byte-exact result. The progress bar above visualizes accepted authored bytes only; its platform cards report delivery status separately.

Current reconstruction work focuses on the two remaining authored near matches, whole-image layout, and target-linked compiler/runtime and D3DX code. Live authored and library figures come from the repository ledgers rather than this README.

Contributing

Contributions are welcome. Useful areas include:

  • evidence-backed exact reconstruction and whole-image layout work;
  • reliable native Windows startup and replacement of the non-redistributable D3DX debug dependency;
  • a native macOS window, input, audio, renderer, and packaging backend;
  • Linux renderer fixes, MIDI support, and testing on additional hardware;
  • browser correctness, performance, and compatibility work in N0zoM1z0/th08-web.

Before changing reconstruction state, read AGENTS.md, the reverse-engineering workflow, and the current handoff. Exact-match contributions must be supported by reproducible comparison against the specified target. Never commit the original executable, DAT archives, extracted retail assets, private analysis databases, or credentials.

Platform guides

Playable ports compile the reconstructed authored game code for modern hosts. They do not bundle the original executable or game archives; players must provide data from a legally obtained copy of TH08.

Web

Status: Playable

TH08 Web source-built browser port and Imperishable Night title screen

Play in the browser · source and documentation · latest release · engineering the Web port

TH08 Web compiles the reconstructed C++ game code with Emscripten and runs it as WebAssembly on a browser worker. WebGL 2, Web Audio, browser-local files, and IndexedDB-backed saves form the platform boundary. It is not a TypeScript reimplementation and does not emulate the original executable.

Select th08.dat and thbgm.dat from a legal TH08 installation in the launcher. th08.dat remains in volatile session memory; thbgm.dat is range-read from its browser File object. Neither file is uploaded, bundled, cached by the site, or placed in persistent browser storage. Chrome is recommended for the best observed frame pacing; Firefox is supported but is usually slower.

Linux

Status: Playable

On Debian or Ubuntu, build and run against the original game-data directory:

scripts/setup-modern-linux.sh "/path/to/the/original/TH08 directory"

After first-time setup, use the incremental launcher:

scripts/play-modern-linux.sh "/path/to/the/original/TH08 directory"

The CI workflow publishes th08-modern-linux-i386.tar.gz as a portable Actions artifact. Extract it and pass the original data directory:

./run-th08.sh "/path/to/the/original/TH08 directory"

The native i386 ELF has been exercised under WSLg and in a Kali Linux x86-64 virtual machine. It requires only th08.dat and thbgm.dat; it does not open or execute the original th08.exe. Settings, scores, replays, and backups stay in the selected data directory.

TH08 native Linux reconstruction starting and running on Kali Linux

The portable window uses the project-owned resources/modern-icon.png, not an icon extracted from the original executable. On software-rendered systems, a fresh configuration's fullscreen FPS/vsync calibration can be slow; reusing an existing th08.cfg is optional.

Known Linux issue

During the Stage 4-to-5 transition, a dynamic text texture can tile across the outer frame and HUD, most visibly as repeated Yakumo Yukari text. This is a renderer/texture-state bug rather than a damaged DAT archive; gameplay can continue past it.

Known Linux Stage 5 dynamic text texture tiling bug

Windows

Status: In progress

See the native Windows guide for the current build and release requirements. The source can produce a 32-bit MinGW bring-up executable, but native startup is not yet reliable and the build still depends on a non-redistributable DirectX SDK debug DLL. There is no supported Windows release asset yet.

The intended product will run natively, accept an arbitrary legal TH08 data directory, and ship without Wine or non-redistributable SDK components.

macOS

Status: In progress

See the native macOS guide for the planned platform boundary. No native executable or package exists yet. The port needs macOS window, input, audio, rendering, and packaging implementations followed by validation on real hardware.

Exact reconstruction

The exact target is one binary: the original Japanese TH08 version 1.00d. A localized, patched, trial, or earlier executable is a different target.

This repository is a history-preserving continuation of GensokyoClub/th08. Its complete Git history was imported rather than squashed, preserving the original authorship and contribution record.

Target executable

Supply your own original executable as resources/th08.exe:

Property Required value
Version Original Japanese 1.00d
Size 840,704 bytes
SHA-256 330fbdbf58a710829d65277b4f312cfbb38d5448b3df523e79350b879213d924
PE image base 0x00400000
Entry point 0x004A619E

The executable and game data are copyrighted assets and are not included. Verify the private target before analysis or comparison:

python3 scripts/verify-target.py

Build and compare

Initialize the third-party submodules, then create the Visual Studio .NET 2002/DirectX 8 environment. On Linux or macOS:

git submodule update --init --recursive
./scripts/create_th08_prefix
python3 ./scripts/build.py

The prefix helper uses Wine by default. Set WINE before invoking it when a different compatible runner is required. On Windows, use the setup script directly:

python scripts/create_devenv.py scripts/dls scripts/prefix
python scripts/build.py

See Build and exact matching for dependencies, build modes, reccmp, objdiff, and acceptance rules.

Analysis and live progress

IDA MCP follows whichever database is active in the GUI and has no reliable program selector. Use it for TH08 only after the active database passes the documented attestation. Otherwise use target-safe headless tools and the repository's target-pinned analysis scripts.

Read current figures directly from the ledgers:

python3 scripts/analysis/report-reconstruction-status.py --summary

Source mappings, generated progress artwork, a successful build, or inclusion in config/implemented.csv do not establish exactness. Only an accepted, reproducible comparison against the verified target supports an exact-match claim. Generated source-presence and strict-match figures are recorded in docs/PROGRESS.md.

Project map

Credits and provenance

This continuation exists because of the reconstruction and tooling work by the contributors to GensokyoClub/th08. Their commits retain their original author/committer metadata. The upstream project also credits @EstexNT for porting its var_order pragma to MSVC7.

The N0zoM1z0/th07 reconstruction supplies this repository's workflow, structure, target gates, matching, and documentation model. GensokyoClub/th06 is adjacent-engine corroboration only; neither reference overrides TH08 target evidence.

License

Repository code and documentation are provided under the included MIT License. This does not grant rights to the original game, executable, or game data.

About

Source reconstruction of 東方永夜抄 ~ Imperishable Night 1.00d

Topics

Resources

Stars

92 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages