Rampage Recompiled

Rampage Recompiled is a native port of Rampage: World Tour and Rampage 2: Universal Tour for Windows, Linux, and macOS with higher resolutions and configurable controller support.

README

Rampage Recompiled

A native port of Rampage: World Tour (N64, 1998) and Rampage 2: Universal Tour (N64, 1999) for Windows, Linux and macOS, with Android and Linux arm64 builds, made by statically recompiling the games' own code with N64Recomp. You supply your own ROMs; nothing from the games is in this repo or downloaded by it.

Status

v0.3.0, alpha. Both games boot, take input, play, and have sound.

Rampage: World TourRampage 2: Universal Tour
Boots to title, attract modeyesyes
Menus, character selectyesyes
Gameplay (move, climb, punch, eat)yesyes (first levels tried)
Sound and musicyesyes
Controllers: keyboard and up to 4 pads, configurableyesyes
Graphics (RT64) at any resolutionyesyes
Controller pak savesno: the game says no pak is insertedno
Windows 10/11 x64 (D3D12)yesyes
Linux x64 (Vulkan), macOS on Apple Silicon (Metal)builds; not yet played on real hardwaresame
Android, Linux arm64 (made in Docker)builds; not yet played on real hardwaresame

How the two games are made to work, and what had to be fixed on the way: docs/symbols.md and docs/game-fixes.md.

Screenshots

World Tour attract demoGeorge climbing
World Tour: attract demoWorld Tour: George in Peoria
Rampage 2 titleCurtis and a helicopter
Rampage 2: titleRampage 2: Curtis, and trouble

All captured from the real build (--headless with RAMPAGE_SHOT, see Usage).

Getting Started

You need your own USA ROM of either game as a .z64 file (big-endian, the usual No-Intro dump: World Tour CRC C29FF9E4, Rampage 2 CRC 673D099B), about 8 GB of free disk, and one of:

  • Windows 10/11 x64 with a DirectX 12 GPU;
  • Linux x64 with a Vulkan driver (Debian/Ubuntu, Fedora or Arch: setup uses apt, dnf or pacman);
  • macOS on Apple Silicon, with Xcode installed (for its Metal shader compiler).

The Android and Linux arm64 builds are made on any of those, in Docker.

Installer

Download Rampage-Installer for your system from the latest release, run it, point it at the folder with your ROMs, and tick what to build:

  • This computer: the games for the PC you're on, with a launcher for each.
  • Android: an .apk per game, for arm64 phones and handhelds with Vulkan.
  • Linux arm64: Raspberry Pi 5 and other arm64 Linux with Vulkan.

Android and Linux arm64 are built in Docker (Docker Desktop on Windows and macOS; on Windows the installer offers to install it), and only the toolchains for what you tick are downloaded. docs/other-builds.md says how to put them on the device.

Quick start, without the installer
  1. Download this repo (Code → Download ZIP) and unzip it anywhere.
  2. Put your ROM(s) in that folder. Any file name works.
  3. Run setup. It checks for the build tools and asks before installing any that are missing, then downloads the recompiler, runtime and renderer, recompiles your ROMs and builds the games. The first run takes 20 to 60 minutes; a rerun after a failure picks up where it stopped. If it stops, it says why in one sentence; the full log is logs/setup.log.
    • Windows: double-click Setup.cmd (Git, Python, CMake and Visual Studio's C++ build tools come from winget).
    • Linux and macOS: ./setup.sh (packages from apt, dnf or pacman, or Homebrew).
    • To also make the other builds: powershell -File tools\setup.ps1 -Targets pc,android,linux-arm64 on Windows, ./setup.sh --targets pc,android,linux-arm64 elsewhere.
  4. Start Rampage World Tour (recomp) or Rampage 2 Universal Tour (recomp) (.cmd on Windows, .sh on Linux, .command on macOS).
Step by step (Windows)

Each command runs in the repo folder (setup.sh is these steps for Linux and macOS). Expected output is shown where it tells you something.

  1. Install the prerequisites: Git, Python 3.10+ (the py launcher), CMake 3.20+, and Visual Studio 2022 (or its Build Tools) with the Desktop development with C++ workload. Open a new terminal afterwards so PATH is current.
  2. Get the toolkits. Rampage builds against sp00nznet's forks, each carrying fixes it needs (and has sent upstream as PRs, listed in docs/building.md):
    git clone --recurse-submodules -b fix/fallthrough-tail-call https://github.com/sp00nznet/N64Recomp deps\N64Recomp
    git clone --recurse-submodules -b rampage https://github.com/sp00nznet/N64ModernRuntime deps\N64ModernRuntime
    git clone --recurse-submodules -b rampage https://github.com/sp00nznet/rt64 deps\rt64
    
  3. Build the recompiler:
    cmake -S deps\N64Recomp -B deps\N64Recomp\build -G "Visual Studio 17 2022" -A x64
    cmake --build deps\N64Recomp\build --config Release --target N64RecompCLI RSPRecomp
    
  4. Copy your ROM into the repo folder under the name the game's .toml expects: Rampage - World Tour (U) [!].z64 and/or Rampage 2 - Universal Tour (U) [!].z64.
  5. Recompile it (wt for World Tour, r2 for Rampage 2). This also turns the game's audio microcode into C++ (rsp/aspMain_wt.cpp):
    set N64RECOMP=deps\N64Recomp\build\Release\N64Recomp.exe
    py tools\regen.py wt
    
    wt: 77 files in gen/wt, 451 fallthroughs, 0 warnings (full log: gen/wt.log)
    
    Rampage 2 prints r2: 82 files in gen/r2, 420 fallthroughs, 0 warnings.
  6. Build:
    cmake -S . -B build\wt -G "Visual Studio 17 2022" -A x64 -DRAMPAGE_GAME=wt
    cmake --build build\wt --config Release --parallel
    
    The game is build\wt\Release\RampageWorldTour.exe (build\r2\Release\Rampage2.exe for Rampage 2).
  7. Run it from the repo folder (it finds the ROM there): build\wt\Release\RampageWorldTour.exe.

Usual trip-ups: python opening the Microsoft Store means the Store alias is on; use py, or turn the alias off in Settings → Apps → Advanced app settings → App execution aliases. A tool "not found" right after installing it means the terminal predates the install: open a new one.

Usage

Each game opens on a small launcher (Play, Settings, Quit). In game, Esc or the pad's Back/Guide button opens the menu: controls, graphics, sound volume, fullscreen. Settings are kept in rampage.json (World Tour) and rampage2.json (Rampage 2) in the folder the launcher runs from.

Default controls:

N64KeyboardPad
StickW A S D / arrowsleft stick
A / BEnter or Space / Left ShiftA or right trigger / X
StartP or BackspaceStart
C buttonsnumpad 8 4 6 2right stick, Y / B
D-padI J K LD-pad
Z / L / RZ / Q / Eleft trigger / shoulders

Player 1 gets the keyboard and the first pad; players 2 and 3 get the next pads plugged in. F11 or Alt+Enter toggles fullscreen.

For testing and debugging, the exe takes --play (straight into the game, no launcher), --headless (the same, and on Windows the window sits off-screen, never on your monitors, and is still rendered) and these environment variables (SHOT, STACKDUMP, WATCH and PEEK are Windows-only):

VariableDoes
RAMPAGE_SHOT=10:a.bmp,30:b.bmpsaves the window to those files at those times (seconds)
RAMPAGE_QUIT_AFTER=40quits after that many seconds
RAMPAGE_AUTOPRESS=12:1000,15:8000holds N64 buttons (hex mask: 1000 Start, 8000 A) for 0.25 s at those times
RAMPAGE_STACKDUMP=20prints every thread's stack at that time, for hangs
RAMPAGE_WATCH=0x801732A0@5after 5 s, reports the first write to that RDRAM word and who did it
RAMPAGE_PEEK=0x801732A0,...prints those RDRAM words with a stack dump or crash
RAMPAGE_DISPLAY=1opens on that monitor
RAMPAGE_AUDIODUMP=out.rawalso writes the sound as raw 16-bit stereo, for checks without speakers
set RAMPAGE_SHOT=25:demo.bmp
set RAMPAGE_QUIT_AFTER=26
build\wt\Release\RampageWorldTour.exe --headless

Building from source

The step-by-step route above is the build. docs/building.md covers the toolkit branches, what each step produces, using your own toolkit checkouts, and the generated code (gen/, never committed). docs/architecture.md explains how the pieces fit.

This is a N64Recomp project in sp00nznet's recomp house style: the toolkit ships, the generated code never does, and fixes found here go back to the toolkits as PRs.

Want to help? CONTRIBUTING.md.

License

This repo's own code is MIT, see LICENSE. A built game links N64ModernRuntime, which is GPL-3.0, so the exe as a whole falls under GPL-3.0; N64Recomp and RT64 are MIT, SDL2 zlib. No builds are distributed: you make your own from your own copy. Rampage is © Midway; none of the games' code or data is here.