expendable_rust

expendable_rust is a native PC port of Expendable that recompiles the game's program and supports high resolutions, widescreen, and gamepads.

README

expendable_rust

A native port of Expendable (Rage Software, 1999) in Rust. The game's own program is recompiled: the player's go.exe is decoded with iced-x86, every function is lifted to Cranelift IR and compiled to native code when the game starts, and the Windows/DirectX functions it calls are implemented in Rust (DirectDraw and Direct3D 6 on OpenGL, Miles sound, input, gamepads). The game's own Smacker and Bink players are recompiled along with it for the videos. No game code or data is part of this repository or its releases: you need your own copy of the game.

Built with recomp_kit.

The demo level in widescreen at 2560x1440

Fighting in the streets of Capital CityBefore a levelThe main menu
Fighting in widescreenBefore a levelThe main menu

Work in progress: the menus, the videos and the demo run, and level 1 plays. The whole game has not been played through yet (see PLAN.md).

Playing

  1. Download from the releases: expendable_rust-...zip for Windows or expendable_rust-...tar.gz for Linux (x86-64), and unpack it.
  2. Put an image of your CD (.iso or .bin) next to expendable_rust.exe (Linux: expendable_rust), or copy your game into the game_files folder: the contents of the CD, an image of it, or your installed game folder.
  3. Start expendable_rust.exe (Linux: ./expendable_rust in its folder). It finds the game, checks the version and sets it up in game_files/Expendable. The first start compiles the game, later starts are quick.

The US OEM CD (eight languages, go.exe with SHA-256 da28c9ab...3e62) is supported; with any other version, or without one, expendable_rust says so. Its messages go to expendable_rust.log next to it on Windows, to the terminal on Linux. Settings go to registry.txt in game_files/Expendable.

What is new compared to the original:

  • High resolution and widescreen (Hor+): the 3D view fills the wide screen, HUD and menus stay in their 4:3 middle
  • Fullscreen, anti-aliasing (MSAA), texture filtering (bilinear, trilinear, anisotropic), vsync and a frame rate limit; all in the port's settings menu (F10)
  • Frame rates far beyond the original's, with the game's logic unchanged: the pictures in between are interpolated (camera, players, enemies and models move smoothly)
  • Gamepads (up to two): pad 1 plays player 1, pad 2 player 2, the keyboard keeps working. The F10 page "Gamepad" chooses the steering and the buttons of the six actions:
    • Original: tank controls, left stick forward/back and sidestep, right stick turns
    • Modern: run where the left stick points, seen from the camera
    • Twin stick: left stick moves, right stick aims
    • Twin stick turning: left stick moves, right stick turns, faster the further it is pushed
  • Menus by gamepad: D-pad moves, A selects, B goes back

Building

cargo build --release
cargo run --release

Without a path it sets up and uses game_files (next to the EXE, else in the current folder) as above. cargo test --release needs no game files. How it works and what is open: CLAUDE.md and PLAN.md.

License

MIT (the code here). The game and its files belong to their owners and are not part of this project.