explaingit

n64decomp/sm64

8,582CAudience · developerComplexity · 4/5Setup · hard

TLDR

A reverse-engineered version of Super Mario 64 in readable C code that recompiles into a byte-perfect copy of the game, requires your own legal ROM to build.

Mindmap

mindmap
  root((sm64))
    What it does
      Full decompilation
      Recompilable C code
      Byte-perfect output
    Tech Stack
      C
      Make
      Linux
    Versions
      Japanese
      North American
      European
    Requirements
      Legal ROM copy
      Linux or Docker
      Build tools
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study the structure of a classic Nintendo 64 game to learn how levels, actors, and audio are organized in C code

USE CASE 2

Build a modified version of Super Mario 64 by editing the decompiled code and recompiling

USE CASE 3

Compile a byte-perfect reproduction of Super Mario 64 from source to verify the decompilation is correct

Tech stack

CMakeLinuxDockerWSL

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a legally owned Super Mario 64 ROM and a Linux environment (or Docker or Windows WSL) to build.

In plain English

This repository is a full decompilation of Super Mario 64, meaning a team of volunteers reverse-engineered the original Nintendo 64 game and translated it back into readable C code. The original game was compiled from source code into machine instructions that ran on the N64 hardware. Decompilation takes those machine instructions and works backwards to produce human-readable code that, when compiled again, produces a byte-for-byte identical copy of the original game. This is considered a significant technical accomplishment because the N64 had a custom processor and no original source code was ever released publicly. The repository covers five regional releases of the game: the original Japanese version, the North American version, the European version, the Shindou edition, and the iQue Player version released in China. Each can be compiled from this code to produce a ROM file that matches the original cartridge exactly. You cannot build the game from this repository alone. The game's graphics, sounds, and other media files are still owned by Nintendo and are not included here. To build the ROM, you must provide your own legally obtained copy of the original game as a starting point. The build process then extracts the media from that copy and combines it with the decompiled code to produce a working ROM. Building requires a Linux environment (or Windows with WSL, or Docker). The README walks through installing the required tools, placing your ROM file in the project folder, and running a single make command. The result appears in the build folder. The codebase is organized into folders for game logic, levels, audio, actors (objects and enemies), textures, and more. Naming and documenting the code is described as an ongoing effort. The project has an active community on Discord and accepts contributions through pull requests.

Copy-paste prompts

Prompt 1
I have a legal Super Mario 64 ROM and want to build the decompilation on Linux. Walk me through installing the required tools and running make to produce the output ROM.
Prompt 2
Help me understand how the actor system works in the Super Mario 64 decompilation, how are enemies defined in C and how do they interact with Mario?
Prompt 3
I want to modify a specific level in the sm64 decompilation to change platform positions and recompile to see the result in an emulator. Show me which files to edit and how to rebuild.
Open on GitHub → Explain another repo

← n64decomp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.