Stunt Race FX Remastered

Stunt Race FX Remastered is a native port of Stunt Race FX for Windows, macOS, and Linux with 60 FPS, higher resolutions, and new terrain.

README

Stunt Race FX: bit-exact decompilation

Bring your classic game to a new generation

Jeffrey Wilbur, Strut B, LLC · retro@strutb.com

If you hold the rights to a classic game, I would love to help it live again. This repository shows what I do: I take a shipped cartridge back to readable, commented source that rebuilds the original ROM byte for byte, prove every routine behaves exactly as the original did, and then run that source natively on today's hardware, with no emulation of any processor. From there the game can grow: 60 frames a second, widescreen, 3D drawn at full resolution on the GPU, new terrain, new camera views, and builds for macOS, Windows, Linux, iPhone, iPad and Android, all without losing the game your players remember.

  • Preserve it: source you own and can read, maintain and build on, recovered from the code that shipped, checked against the original at every step.
  • Remaster it: modern frame rates, screens and controls, on the platforms your audience plays on today, with the feel of the original intact.
  • Reach new players, and give your longtime fans the version they always pictured.

If you have a game you would like to see again, write to me at retro@strutb.com.

Stunt Race FX

Stunt Race FX as the cartridge drew it: the coupe chasing two rivals through the trees, in the original's 4:3 screen with its bezel and panels Stunt Race FX Remastered at 16:9: the car under the red bridge on Easy Ride, polygon mountains behind, solid 3D tyres, the HUD across the window Stunt Race FX in the view from above: the player's car leading two rivals past the gantry on Easy Ride, the course seen at an angle from above

Left: the race as the cartridge drew it, 256 x 224 on a 4:3 screen. Middle: Stunt Race FX Remastered on the same course at 16:9, the 3D, its new mountains and solid tyres drawn at the window's resolution on the GPU. Right: the view from above on Easy Ride. All three are frames of the headless renderer; the middle and right ones from November 14, 2026.

This repository holds two things:

  1. The decompilation, complete. 100% of the game's code is decompiled, behaviour exact and byte exact: readable C for every routine, proven against the running original, and commented assembly that rebuilds the ROM byte for byte (src/stuntracefx, asm/stuntracefx). Started October 11, 2026; behaviour and byte exact October 18, 2026. It is the record the native game was converted from, and the conversion leaves it untouched.
  2. Stunt Race FX Remastered, the native game (native/stuntracefx). The decomp's C rewritten as an ordinary native game on nativeshvc, a native engine for SNES games: typed C that calls the engine from its update and draw, with no emulation of any processor and no imitated hardware between them. The game's own logic (its physics, cars, menus, rules and sound) is the original's; how it is shown is a modern game's: any window shape, 3D at full resolution on the GPU, 60 updates a second, new land and water on every course and a new view from above. The native game says what it does and what is not done.

Behaviour exact, not cycle exact. The decomp's C states no instruction timing: instruction counts are an emulator's bookkeeping and were never part of the original source. See Timing.

Behaviour exact (M1)Byte exact (M2)
All code100% (215,373 of 215,373 B)100% (215,373 of 215,373 B)
S-CPU (65816)100% (150,947 B)100%
Super FX (GSU-1)100% (51,491 B)100%
SPC700 (sound)100% (12,935 B)100%
  • Every routine is decompiled. All 2,417 routines the routine census names, including code the game never runs, have C and commented, symbolic assembly in the tree, filed by area. The census finds no routine left unnamed and no orphaned code.
  • Every routine is proven behaviour exact. Each C routine was checked against the running original at every call the scripts make (no call of any routine differs), and all of them were swapped in at once and run in lockstep with the original over 324 scripts, frame for frame (every script identical). Routines that never return (they restart or stop the game) are judged by that lockstep run.
  • The whole ROM rebuilds byte for byte from the companion assembly.

The numbers are from the last full gate on the decomp (python3 tools/stuntracefx/gate.py --full, October 18, 2026, 5b5068ef); the generated blocks under Current Status carry the same figures. The assembly has not changed since. The C has: through November 5, 2026 its instruction timing was taken out (the behaviour-exact standard) and it was edited for the October front end (its Enhanced code is src/stuntracefx/remaster), and the gates have not been run on it since October 18.

License, and no claim to the game

I claim no ownership whatsoever of the decompiled source code. Stunt Race FX, its code and its assets belong to its rights holders. The C and assembly in this repository are a reconstruction of their work, recovered so that they rebuild the original bytes. It is not mine to own, license or give away, and nothing here says otherwise. No game data ships in this repository: every build starts from your own copy of the cartridge.

This project exists for preservation and for love of this game, so that the Super FX racer Nintendo and Argonaut made in 1994 can still be read, studied, built and played long after the cartridges and hardware it shipped on are gone.

The work that is my own (the tools, the test harness, the builder and the native game's platform code) is dedicated to the public domain under CC0 1.0 Universal. Anyone may use it for any purpose, with no permission or credit needed.

Why CC0. A preservation project should claim as little as possible. CC0 asserts nothing over the reconstructed game, and it gives everything that is mine to the public domain, with a fallback licence for countries where copyright cannot be waived outright. That fallback is why CC0 was chosen over the Unlicense, which has the same intent but no fallback.

Playing it

Players don't need this tree. Stunt Race FX Builder (builder/, 0.99 at this commit; players download it from the repository's Releases page) builds the native game from the player's own No-Intro ROM of Stunt Race FX (USA) (Rev 1), checked by MD5, and ships none of the ROM's data:

Builder runs onBuildsThe game needs
macOS 12+ (Apple silicon and Intel)the Mac app (universal), or the iPhone and iPad app (.ipa, signed with the player's own Xcode signing when there is one)macOS 12+, Metal; iOS 15+
Windows 10+ (64-bit)a folder with the gamea Vulkan driver
Linux, glibc 2.35+ (x86_64, arm64)a folder with the gameX11 or XWayland, a Vulkan driver

The game also builds for Android (the engine's Android host), which the builder does not make. The PSP is tabled (Jeff, 2026-11-05): the tag psp-tabled holds its port as last run.

The native game: Stunt Race FX Remastered

native/stuntracefx is the game on nativeshvc. Each update is one 60 Hz frame of the original's work; draw describes the picture from the game's state. The game's C reaches the engine only through its calls (nshvc_*): no register-shaped state, no translation layer and no imitated PPU, DMA, sound chip, Super FX or bus. The engine runs no processor instructions. The plan, its decisions and its progress are in docs/stuntracefx/native/PLAN.md.

There is no original mode (Jeff, 2026-11-09: "Enhanced IS the native game"). The game's logic is the original's, so a crash, a wrong value or a misplaced object is a bug; matching the original's pictures or pace is not the aim. Recordings of the original are kept only to find such bugs.

Not done
  • The conversion's final audit (the plan's section 8 and stage 11). The engine's hardware finder reports nothing, but interim forms remain, named in the plan: the Super FX record links are still places in the chip's RAM, read and written by place (rec_get/rec_put, 193 calls), and some of the chip's other words are still read by their address.
  • Platforms: Windows and Linux are built by the builder; the plan records Windows run headless only (matching the Mac) and no run on Linux. On iOS and Android it records only runs judged from logs; the iPhone build has since been played by hand.
  • The view from above is one player only: two players and the course screen keep the game's own camera, sprites' facing frames are still the chase camera's, and the rival arrows are placed for the chase camera.
  • Displays faster than 60 Hz: the 2D drawn between updates has not been run on one.
What it adds
  • Any window, any shape. 4:3, 16:9, ultrawide, or narrower down to a phone held upright: the race, the course screen and the menus fill the window, the view's width follows its aspect, and the HUD sits inside the screen's safe area (a notch, rounded corners). Two players are side by side or above and below, by the window's shape.
  • 3D at the display's resolution, on the GPU. The CPU runs the game and builds draw lists; the GPU draws every picture (Metal on Apple devices, Vulkan on Windows and Linux), edges antialiased. View distance is unlimited: what the original culled at its 45-degree view and its draw distance is kept.
  • A true 60 Hz tick and an unlocked frame rate. The race runs the original's whole step every 6 updates, its physics and handling step for step the original's, with no slowdown; the 3D is drawn between steps from the cameras and objects eased between them, and on a display faster than 60 Hz the engine draws between updates too.
  • New land and water on every course, in each course's own style and colours, out to the horizon: polygon mountains, mesas and canyon rock, an ocean on Aqua Tunnel, Sea Breeze, Lake Side and Harbor City, King's Forest's forest of the course's own 3D trees (instanced), Night Owl's flat ground under its skyline, Night Cruise's pavement and city of buildings, White Land's snowfields, Sky Ramp's sea of clouds; the battle and bonus courses too (the stunt arenas keep their floors).
  • Depth-tested 3D (DEPTH.md): exact corners from the model data, closed models one-sided and open ones two-sided, so what is in front is decided pixel by pixel for any camera. Cars stand on the track the game drives them on.
  • Solid 3D tyres, wheels, eyes and trees in place of the original's sprites, for every car, near and far.
  • Rain and snow drawn at the window's pixels across the whole view.
  • The view from above. The race seen from high up at 25 degrees down, its heading fixed for the course; what hides the player's car turns see-through about it in quarter steps (the ground wholly at the middle). A view button beside the pause button switches between the two views over 2 seconds, the game held; the choice is saved.
  • The game's own pause screen. Escape, Select with Start, or the corner button (a pointer or a touch) opens it over the blurred picture: rebinding keys and a controller's buttons, defaults, and Auto-Accelerate. On the iPhone and iPad it is a menu: resume, Auto-Accelerate, quit the race.
  • Touch controls on the iPhone and iPad, in landscape and portrait: the wheel under the finger, brake and boost pedals, the gas held by Auto-Accelerate, swipes and taps in the menus.
  • The keyboard and controllers as themselves: the initials typed on a keyboard; the keys and a controller's buttons rebound on the pause screen and saved.
Building it from source

The build expects nativeshvc's checkout beside this one (../nativeshvc) and the cartridge's data, which is never committed:

python3 native/stuntracefx/tools/extract_assets.py "reference/stuntracefx/Stunt Race FX (USA) (Rev 1).sfc" native/stuntracefx/assets
cmake -S native/stuntracefx -B native/stuntracefx/build/macos -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DNSHVC_ROOT=../nativeshvc -DNSHVC_HOST=macos -DNSHVC_RENDER=metal
cmake --build native/stuntracefx/build/macos

extract_assets.py checks the ROM's SHA-1 and writes cart.dat: an image of the cartridge with the data the game reads (tools/assets.csv) at its place and nothing where the code was. Other hosts take NSHVC_HOST and NSHVC_RENDER as builder/build.sh sets them (iOS with Metal, Windows with Vulkan through mingw-w64); plain cmake with no host builds the headless, null-rendered game.

Switches for looking at the game while it is worked on, in the environment:

SRFX_COURSE=<n>start that course's race at once ($00-$16; the logo, title and menus left out, their choices made as data)
SRFX_CAMERA=overheadstart in the view from above
SRFX_FPS=0hide the pictures-a-second counter at the top left (shown otherwise)
SRFX_PROFILE=1print where a picture's time goes, once a second

The engine's own flags run it headless: --headless --updates N --shots DIR --input FILE.

Checks

native/checks holds the tools the conversion was checked with: record.sh (a play of the original recorded in bsnes), replay and compare.py (a recording's pictures through the engine, compared exactly), music_check (the sound driver's voice events against a recording), fx_check and fx_view (the Super FX logic against recorded jobs and pictures) and pause_check. The recordings of the original are kept outside git.

The Decompilation Standard

The purpose of a decompilation, as opposed to a recompilation, is preservation: recovering the game itself, as written, in a form that outlives the original hardware and media. Playability and portability are welcome side effects, not the direct goal. With a bit-exact decompilation, every function, built with the original compiler, must reproduce the original machine code byte for byte. A bit-exact match is 100% reliability that the source is accurate to the original, ensuring preservation for future generations.

Project Purpose

A decompilation of Stunt Race FX (SNES, 1994): every routine rewritten as readable C, documented with what it does and how, filed by what it is for, and proven to behave exactly like the original; and the whole ROM rebuilt byte for byte. Progress is measured only by those two proofs; playability is a consequence, never a reason to reorder the work.

Game background

Nintendo released Stunt Race FX in 1994 (Wild Trax in Japan), a 3D racer on a cartridge that carries the Super FX coprocessor (GSU-1) and 64 KB of RAM for it. The game is split across three processors: the SNES CPU (a 65816) runs the game logic, the Super FX transforms and rasterises the polygons, and the SPC700 sound CPU plays the music and effects from a program the main CPU uploads at boot. The retail ROM has no compiler footprint at all; all three programs were written by hand in assembly. Star Fox (1993) runs on the same chip and its Super FX code is laid out the same way, starting from the same kind of jump table, so its disassembly is a second witness for the engine.

Two lanes, one game

When a game was compiled from C, the right C fed to the original compiler gives back the original bytes, so one source carries both proofs. No compiler produced these bytes, so no C can rebuild them. Each routine therefore has two sources:

  • C, the decompilation. Readable C per routine, certified behaviour exact against the running original (T3). It is the source the native game was converted from.
  • Assembly, the byte-exact companion. Symbolic, commented assembly that rebuilds the ROM byte for byte (T4). It is the reading the C is written from, and the byte-exact rebuild proves that reading is right.

Timing: behaviour exact

The decomp's standard is behaviour exact, not cycle exact (decided October 28, 2026). Its C states no instruction time on any processor. Statements of how long the original's instructions took (cyc() on the S-CPU, code-fetch statements on the Super FX, spc_cyc() on the SPC700) are an emulator's bookkeeping: they were never in the original source, so a preservation decompilation does not carry them.

Why timing mattered. Stunt Race FX ties its speed to its chips: a race frame moves the cars a fixed amount however long it took to compute, and the race loop never waits. On the SNES its pace, and its slowdown under load, came from how long the S-CPU and the Super FX took to do each frame's work.

How the native game paces it. A race step every 6 updates, always: the original's physics, step for step, at a steady pace with no slowdown, the pictures between steps drawn from the eased cameras and objects. The earlier front end (October 2026, ports/stuntracefx/front, no longer built) played the decomp's C at the original's pace from a measured cost profile; that work and its tools are in the history.

History. The C was first made cycle exact against the original under the lockstep harness (all 325 scripts 0 master clocks off on all three processors, October 20, 2026). That work, its tools and its cycle statements are kept on branch shelf/cycle-exact.

Current Status

Both milestones are met: M1 and M2 are at 100%. M1 counts routines whose C is certified to behave exactly like the original (T3) plus those also byte-exact (T4); M2 counts byte-exact routines only. The blocks below are snapshots; regenerate the bars and the treemap in one step with python3 tools/stuntracefx/progress.py: do not hand-edit them.

Snapshot 2026-10-18.

M1  Behaviour exact (T3 + T4)
    ████████████████████████████████████████  100.0%   215,373 / 215,373 B of the game's code
M2  Byte exact (T4)
    ████████████████████████████████████████  100.0%   215,373 / 215,373 B of the game's code

The bars measure the whole game's S-CPU, Super FX and SPC700 code, 215,373 B: 215,311 B the scripts have run and 62 B the routine census finds that no script has run yet. Certified so far: 2401 routines behaviour exact, 2401 of them byte exact.

ProcessorM1: behaviour exactM2: byte exact
S-CPU (65816)████████████████████ 100.0%: 150,947/150,947 B████████████████████ 100.0%: 150,947/150,947 B
Super FX (GSU-1)████████████████████ 100.0%: 51,491/51,491 B████████████████████ 100.0%: 51,491/51,491 B
SPC700 (sound)████████████████████ 100.0%: 12,935/12,935 B████████████████████ 100.0%: 12,935/12,935 B

decomp progress treemap

Every box is one routine, sized by its executed code bytes and grouped by the area it is filed in (or by ROM bank and processor until it is filed): green = byte-exact (T4, M2), blue = behaviour exact but not yet byte-exact (T3), amber = in the tree, not yet certified (T2), gray = not started (T1). Green + blue is the M1 corpus.

More