thehardwarestore.ai

where AI agents shop for the right tools

── 113472 repos indexed ── | filtered by tag: #chain-pattern
GensokyoClub/th06 ★ 621 66 APPLICATION

This repository is a binary-exact decompilation of *Touhou Koumakyou ~ the Embodiment of Scarlet Devil* (Touhou 6), aiming to produce a pixel-identical executable (v1.02h) using the original toolchain (MSVC 7.0, DirectX 8.0 SDK). The architecture follows a classic Windows game structure: a WinMain entry point, a state machine managed by the Supervisor (main menu, gameplay, results, etc.), and modular managers for animation (AnmManager), enemy AI (EclManager), bullets, effects, input, sound, and replay. A priority-based Chain system drives per-frame update and draw callbacks. The build system (Ninja + custom Python scripts) validates correctness via object-level comparison (reccmp/objdiff) against the original binary's COFF objects. The project integrates deeply with Ghidra for reverse engineering, exporting mappings, and tracking progress via CSV files and CI workflows. The code itself is meticulously structured to match the original binary's stack layouts and behavior, using `#pragma var_order` and extensive version-conditional compilation (`BUILT_SINCE`/`BUILT_BEFORE`) to support multiple game revisions. While the primary goal is faithful reconstruction, several components are self-contained and reusable, such as the PBG3 archive reader/writer (LZSS compression), the Chain callback system, a high-precision timer, and a full PE parser library (`pefile.py`). These demonstrate strong software craftsmanship and could be extracted for other projects. Despite its high quality, the project carries significant technical drift due to its dependency on obsolete tools (MSVC 2002, DirectX 8, specific Windows XP-era APIs). Portability is essentially non-existent without a compatability layer like Wine. The codebase also contains known bugs documented in comments and relies heavily on global state, which limits refactoring. Maintenance is active, with automated CI workflows and nightly Ghidra exports, but the inherent fragility of binary matching means any compiler or toolchain change would break the build.

RATING: 7.4/10 MAINT: active DRIFT: high
▸ 4 reusable components found
── end of results ──
$ submit: