fn64
The N64 platform runtime, in Rust

Run your recompiled ROM as a native app.

fn64 turns an N64 game into a native app. It recompiles the game to Rust, it is the libultra runtime that code calls into, and it does the graphics and audio work the console's RSP and RDP used to do. MIT OR Apache-2.0. There is no emulator in the loop and your ROM stays on your disk.

Pre-alpha MIT OR Apache-2.0
The call path static diagram
YOURS FN64 Recompiled code N64Recomp C, or typed Rust fn64-abi extern "C" surface fn64-runtime answers the call scheduler, message queues, timers, DMA, save, input and audio
Workspace
17 crates
Discovery wrong
0
GPL in tree
0
fn64 is fn64 is Future, Faithful, Friendly, and Fast.

What it is

What fn64 is

A statically recompiled game is real native code: its functions were translated from MIPS once, ahead of time, and compiled into your binary. fn64 does that translation. On the console those functions called into libultra for nearly everything, and the RSP and RDP handled graphics and audio. fn64 is those parts too, in Rust: the runtime the recompiled code calls, and the renderer and audio mixer that do the console's work. All that is left underneath is your OS.

ROM recompiled by fn64 the game native code, built once osCreateMesgQueue_recomp(rdram, ctx) a function call, like all the others fn64 runtime libultra, in Rust 116/116 calls, gated in CI render the RDP's job software, RT64 or wgpu audio the RSP's job mixed in Rust your OS macOS, Linux
// fn64 is everything between the recompiled game and your OS.

Every call the game makes into libultra lands on a Rust function with the same name and a _recomp suffix. That is the whole interface: 116 functions, all implemented, checked by a gate that runs in CI. What you do with the game's code above that line, and which renderer you pick below it, is up to you.

You supply
A ROM you own. N64Recomp output if you have it; if not, fn64 recompiles the ROM itself.
fn64 supplies
The recompiler, the runtime those calls land in, the renderers and audio, and the tests that check the result.

Crates

Seventeen crates in one workspace

Every crate publishes on its own, so you can take just the part you need. If you only want the ABI surface, depend on fn64-abi and nothing else. Each stage below writes its output to disk, so you can re-run one stage without touching the others. Reading left to right: your ROM goes in and a native app comes out.

ROM in your cartridge local — never shipped
  1. Discover recover boundaries from the ROM
  2. Recompile turn MIPS functions into native code
    • fn64-cpu-runtime-codegenwhole-ROM Rust emitter
    • fn64-recompN64Recomp adapter, kept for comparison
  3. Execute the core the other crates link against
    • fn64-audioRSP audio
    • fn64-boot-harnessbrings a title up
  4. Present draw frames through the render seam
    • fn64-render-irrender IR, standalone
    • fn64-render-referencesoftware rasteriser
    • fn64-render-rt64RT64 backend bridge
    • fn64-render-wgpuwgpu backend, early fixture
    • fn64-render-conformancereplay fixtures for comparing backends
  5. Prove check the output
    • fn64-difffinds the first register that disagrees
App out native app macOS, Linux today

Two routes

Two routes to the same runtime

Both routes start from a ROM on your disk. Which one you take depends on what you already have. Either way you end up on the same runtime, and everything in it is MIT OR Apache-2.0, down to the RSP audio crate. There is no GPL code in the tree.

Route AC lane — N64Recomp

Already on N64Recomp

fn64 is a drop-in replacement for ultramodern, the GPL-3.0 runtime N64Recomp normally uses, under MIT OR Apache-2.0. Point your recompiled output at it.

how it works →

Route BRust lane — fn64-discover

No decomp yet

fn64-discover recovers function and section boundaries from the ROM itself and lists what it could not prove. fn64-cpu-runtime-codegen then emits a typed Rust runner for each function.

how it works →


Discovery

Discovery, scored against answer keys

fn64-discover reads a ROM and recovers function and section metadata. It does not need a finished decompilation. Below is its recall on six titles, scored against publicly available answer keys:

Status Title Recall % Functions Wrong
Boots in a window Ocarina of Time 86.9% 119 / 137 0
Recompile and discovery coverage Super Mario 64 92.9% 2816 / 3030 0
Recompile and discovery coverage No Mercy 84.8% 835 / 985 0
Recompile and discovery coverage Majora's Mask 82.7% 402 / 486 0
Recompile and discovery coverage WM2000 82.4% 698 / 847 0
Recompile and discovery coverage Kirby 64 75.7% 402 / 531 0
Boots in a window Recompile & discovery coverage Not yet reached 0Wrong on every title

The wrong column is zero on every title, and that is the number we care about most. A function discovery misses costs you some manual work. A boundary it invents costs you a debugging session chasing something that is not there. So the tool only claims what it can prove, and wrong stays at 0.


Rigor

How the code is checked

The runtime uses strong types, has a test suite that runs the recompiled output, and sets an explicit bar for what counts as a passing fix. It was written from our own debugging notes, public documentation and MIT-licensed source, never from GPL code. Most of the code volume comes from AI agents working in batches. People direct that work and review every change, and agents have to pass the same checks people do. The contract is in AGENTS.md.

Strong types TRAPS ON UNKNOWNS

Generated runners are typed Rust. When the game reaches behavior fn64 has not implemented yet, the runtime traps and says what is missing. It does not return a zero and hope for the best.

Behavioral test suite RUNS THE OUTPUT

Matching the original ROM byte for byte proves the build reproduced it. fn64 also has tests that run the recompiled output and check what it does: c_smoke links the ABI from a real C caller, and the recompiler has per-instruction oracle suites.

Validation bar WHAT COUNTS AS PASSING

A fix for a deterministic bug needs 1 fresh regression run plus the suite it belongs to. Re-running identical work adds nothing. A fix for a concurrency or timing bug has to state its failure model first, and falls back to repeated runs, 20 by default, only when nothing stronger closes the interleaving.

Where the checks live IN THE REPO

Everything above is in the repo, along with the list of what is still open:

Point your recompiled ROM at fn64 and run it as a native app.