How kauri-off/th08-rs works
This repository is an unofficial Rust reimplementation of Touhou 8, with desktop, Android, and browser front ends. The main user workflow is to select or import the player’s game files, configure the port, launch and play the game, then use its save, replay, and score features. The architecture separates platform/app orchestration from deterministic game logic, asset formats, rendering, and audio. The graph preserves documented capabilities and central indexed modules; some subsystem links are omitted or dashed because their implementation was not excerpted.
Main entry points: game.rs Game context and flow · launcher.rs Launcher · sources.rs Game data sources · app.rs App loop
Components 30
App and launcher
- Launcher
src/launcher.rs - Android launcher
android/app/src/main/java/org/th08/port/LauncherActivity.kt - App loop
src/app.rs - Settings
src/settings.rs - Settings store
src/settings_store.rs - Pause and settings menu
src/platform/portmenu.rs - Menu state
src/menu_model.rs - Platform input and host
src/platform.rs - Touch controls
src/platform/touch.rs
Game runtime
- Game context and flow
crates/th08-core/src/game.rs - Enemy simulation
crates/th08-core/src/enemy.rs - Bullet simulation
crates/th08-core/src/bullet.rs - ECL scripting
crates/th08-core/src/eclvm.rs - Player simulation
crates/th08-core/src/player.rs - Replay playback
crates/th08-core/src/replay.rs
Game data
- Game file import
src/gameimport.rs - Game data sources
src/sources.rs - Game file formats
crates/th08-formats/src/archive.rs - Translation pack building
crates/th08-repack/src/import.rs
Presentation
- Draw command list
crates/th08-out/src/drawlist.rs - Graphics renderer
crates/th08-render/src/gfx.rs - Audio playback
crates/th08-audio/src/audio.rs
Records and integrations
- Saves and replays
src/replays.rs - Play statistics
src/stats.rs - Translations UI
src/i18n.rs - Update checks
src/update.rs
Other components
- Player
- Player-owned game files
- Save storage
- Touhou Patch Center
Connections 34
- Player → Launcher: chooses files
README.md - Launcher → App loop: starts game
README.md - Player → Android launcher: imports files
README.md - Android launcher → Game file import: imports game data
- Player-owned game files → Game data sources: supplies assets
README.md - Game file import → Game data sources: converts for storage
- App loop → Launcher: uses launcher flow
src/app.rs - App loop → Platform input and host: uses host services
src/app.rs - App loop → Game context and flow: loads and runs
- Settings → Game data sources: selects data source
- Launcher → Settings: configures
src/launcher.rs - Launcher → Settings store: reads and writes
src/launcher.rs - Launcher → Translations UI: shows translations
src/launcher.rs - Launcher → Update checks: checks updates
src/launcher.rs - Player → Game context and flow: plays
README.md - Game context and flow → Enemy simulation: simulates
crates/th08-core/src/enemy.rs - Game context and flow → Player simulation: updates player
- Enemy simulation → Bullet simulation: uses
crates/th08-core/src/enemy.rs - Enemy simulation → ECL scripting: runs scripts
crates/th08-core/src/enemy.rs - Game data sources → Game file formats: reads game data
- Touhou Patch Center → Translation pack building: provides translation
README.md - Translation pack building → Game data sources: builds game pack
- Game context and flow → Draw command list: emits draw commands
- Draw command list → Graphics renderer: renders commands
- Game context and flow → Audio playback: plays BGM
- Game context and flow → Replay playback: plays recorded inputs
- Player → Pause and settings menu: opens pause menu
README.md - Pause and settings menu → Menu state: updates menu state
src/platform/portmenu.rs - Pause and settings menu → Settings: edits settings
src/platform/portmenu.rs - Platform input and host → Touch controls: uses touch input
src/platform.rs - Game context and flow → Saves and replays: stores replays
- Game context and flow → Save storage: saves scores
README.md - Player → Saves and replays: browses replays
README.md - Game context and flow → Play statistics: records play statistics