feat: rebuild TDK Pinball Machine in Rust

Replace the empty Rust scaffold with a playable native reconstruction of the
1995 Win16 game. Embed the complete decoded asset set, retain the original
640x460 presentation and localized help, and implement a resizable letterboxed
Macroquad frontend for Linux, macOS, and Windows.

Recreate the multiplayer ball flow, flippers, nudging, target banks, wheel,
robot, lock, magnets, bumper progression, TDK diamond multiplier, media extra
balls, sound dispatch, settings, and high-score entry. The physics engine uses
a fixed time step and 101 static collision segments transcribed from the
original 175-object table. Portable JSON persistence imports and decodes the
original XOR-obfuscated high-score file on first run.

Document the evidence boundary explicitly: artwork and PCM samples are exact,
static geometry is recovered, and several numeric scoring/impulse values remain
best-evidence behavioral tuning rather than bit-identical Win16 arithmetic.
Add a native three-OS CI matrix and retain every decoded resource for future
fidelity work.

Test Plan:
- `diff -qr original/assets/decoded tdkpin-rs/assets/original` with the two
  intentionally added legacy root files excluded -- passed
- `cargo fmt --all -- --check` -- passed
- `cargo check --all-targets` -- passed
- `cargo test --all-targets` -- passed, 8 tests
- `cargo clippy --all-targets -- -D warnings` -- passed
- `cargo build --profile production` -- passed
- `cargo check --all-targets --target x86_64-pc-windows-gnu` -- passed
- `cargo check --all-targets --target x86_64-apple-darwin` -- passed
- `cargo run` graphical start, launch, collision, and score smoke test -- passed;
  audible output was unavailable because the host has no ALSA device
This commit is contained in:
2026-08-22 16:12:11 +02:00
parent 54061f1eb7
commit f817b63683
81 changed files with 3653 additions and 2 deletions
+61
View File
@@ -0,0 +1,61 @@
# TDK Pinball Machine for modern PCs
This is a native Rust reconstruction of the 1995 Windows game **TDK Pinball
Machine**. It uses the extracted original artwork and sound, recreates the
playfield as a fixed-step simulation, and runs from the same source on Linux,
macOS, and Windows.
The original program is not required at runtime. All required game assets are
embedded in the executable at build time.
## Run
Install a current stable Rust toolchain, then run:
```sh
cargo run
```
For a distributable optimized binary:
```sh
cargo build --profile production
```
The binary is written below `target/production/`. On Linux, Macroquad's native
development packages are also required (X11, OpenGL, and ALSA). Windows needs
no extra runtime installation; macOS builds with the normal Apple developer
command-line tools.
## Original and modern controls
| Action | Original key | Additional modern key |
| --- | --- | --- |
| Choose 1-4 players | `+` | `=` |
| Start or launch ball | Down arrow | Enter starts a game |
| Left flipper | Left Ctrl | `A` or Left arrow |
| Right flipper | Keypad Enter | Right Ctrl, `D`, or Right arrow |
| Nudge | Space, either Shift, keypad `3` | - |
| Help | F1 | Enter/Escape returns |
| Settings | F2 | - |
| High scores | F3 | - |
| Sound | F12 | - |
The five original speed choices are retained as simulation-detail settings.
They change fixed-step resolution without changing the speed of play.
The help screen is the original artwork in English, German, French, Italian,
or Spanish. As instructed on that screen, double-clicking its upper-left exit
box closes the program.
## Saved data
Settings and the ten-entry high-score table are stored as `save.json` in the
platform's normal per-user application-data directory. On first run, the table
is imported from the original `HISCORES.DAT` included with this reconstruction.
## Reconstruction status
This repository distinguishes exact recovered material from behavioral
reimplementation. See [RECONSTRUCTION.md](RECONSTRUCTION.md) for the evidence
ledger, known inference boundaries, and validation performed.