Decompiling a Nintendo 64 Game in 84 Days
Decompiling a Nintendo 64 Game in 84 Days
I am thrilled to announce that the original Snowboard Kids has been 100% decompiled!
What does "100% decompiled" actually mean? It signifies that every single function in the game now has a corresponding implementation in C. When this C code is compiled, it generates machine code that is bit-for-bit identical to the original retail game.
Acknowledgments
This achievement was a team effort. I owe a huge debt of gratitude to the following individuals:
- Primary Contributors:
inspectredc,Bl00D4NGEL, andqueueRAM. - Token Benefactors: iFuzzle, JamesBLewis, and douglasjv.
Why This Matters
The goal of this project is to provide the Snowboard Kids community with a comprehensive resource. Specifically:
- Speedrunning: By analyzing the source, runners can understand the mechanics behind and the specific variables that dictate player velocity.
- Modding: A full source allows for more sophisticated modifications.
- Preservation: It enables static recompilation for modern platforms.
Project Comparison
The speed of this project was remarkable. While Snowboard Kids 2 took 596 days, this project was finished in just 84.
| Game | Days to Decompile | Function Count | Compiler Used |
|---|---|---|---|
| Snowboard Kids | 84 | 2,145 | IDO 5.3 |
| Snowboard Kids 2 | 596 | 2,995 | GCC 2.7.2 |
| Pilotwings 64 | 74 | Various |
It would be a mistake to say this was solely due to LLMs. While AI helped, several other factors played a role.
The Technical Challenge: IDO vs. GCC
I wasn't starting from zero; I had nearly two years of experience from previous projects. However, I faced a significant hurdle: the compiler.
- GCC 2.7.2: An open-source compiler that is well-documented and actively studied.
- IDO 5.3: A proprietary SGI compiler.
Because IDO was closed-source and tied to ancient SGI hardware, the community had to reverse-engineer the toolchain itself to make it run on modern machines. IDO is notoriously "aggressive" with its optimization passes.
The IDO Struggle: Small changes in C code can cause a "ripple effect" through the optimization passes, completely altering the register allocation. This makes matching the original binary more of an art than a science.
The Workflow
The general process for both me and my AI agents followed this logic:
The Role of AI Agents
For this project, I utilized frontier models and a sophisticated agent harness.
1. Low-Hanging Fruit: Library Code
Agents were exceptionally good at identifying standard library functions. Snowboard Kids utilizes:
libultra(Nintendo's standard library)libmus(Audio library)
The Strategy: Instead of letting the AI guess the logic from scratch, I instructed the agents to:
- Identify the function via
N64Sym. - Reference existing SDK source code.
- Test various SDK versions and compiler flags.
- Only attempt a custom implementation if the SDK source failed.
2. Automated Matching
I had an agent develop a script to run m2c (a matching tool) against every unmatched function.
// Conceptual logic of the automation script
for (function in unmatched_functions) {
if (m2c_check(function) == EXACT_MATCH) {
integrate_match(function);
}
}
The success rate was mathematically low:
Despite the low percentage, this was far more cost-effective than spending expensive agent tokens on every single function.
The journey of decompiling IDO-compiled games continues to be a challenge, but the tools are getting better.