A Rust port of SDLPoP (open-source Prince of Persia), verified bug-for-bug identical to the original C build by an automated test harness. Also runs in the browser via WebAssembly.
Gameplay, controls, mods, and replays are unchanged from upstream. See README.upstream.md for all of that. This file is just the Rust/wasm side: how to build it and where to look for more.
These three builds are independent; pick whichever one you want.
cargo run # builds and launches the gamecargo xtask wasm-serve # builds the wasm bundle if needed, then serves itThen open the URL it prints (http://localhost:8642/ by default).
Kept as the test harness's reference oracle, not for everyday use.
cd src/build && cmake -G Ninja .. && ninja # builds ../princeSDL2andSDL2_imagedevelopment libraries: needed by the native Rust build and the original C build. The wasm build does not need them — it never links against real SDL2, and a minimal stand-in header (src/sdl_stub.h) covers what the build needs to generate Rust bindings, so a machine that only ever builds/serves the browser version needs nothing here. See README.upstream.md's COMPILING section for per-OS install instructions.wasm-bindgen-cli, pinned version: needed to build the wasm bundle.cargo xtask wasm-buildprints the install command if the installed version doesn't match.- Node.js and
npm install: only needed to run the wasm regression tests, not to build or serve the wasm bundle.
cargo xtask verify # build, unit tests, and the full differential harnessThe harness replays real recorded gameplay through both the Rust and C builds and diffs every
tick: game state and rendered pixels, not just "it compiles." Expected output is committed as
"golden" traces and pixel hashes under traces/, generated from the C build; run this before
considering any change done. cargo xtask --help lists everything else (individual harness
pieces, smoke tests, wasm tooling).
src/original C source, kept as the harness's reference oraclerust/the Rust portweb/the wasm/browser buildtraces/,doc/replays-testcases/golden test datadocs/plans/design docs for larger pieces of workxtask/thecargo xtaskdev tooling
CLAUDE.md: porting rules, architecture, wasm platform design, harness internalsdocs/plans/: design docsREADME.upstream.md: gameplay, mods, replays, the original project's compiling docs
GPLv3, see COPYING. src/opl3.c/.h and src/stb_vorbis.c are third-party code under their
own licenses. Full author/contributor list in
README.upstream.md.
Rust/wasm port: krepl, AI-assisted with Claude Code.