Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/n64decomp/sm64/llms.txt

Use this file to discover all available pages before exploring further.

The SM64 decompilation is a fully matching recreation of the Super Mario 64 source code in C, produced by reverse-engineering the original N64 ROM. Every function, struct, and data table has been reconstructed so the compiled output is bit-identical to the shipped cartridge. The codebase covers all five regional versions: US, JP, EU, Shindou, and iQue Player. Whether you’re here to understand how a classic 3D game works, build a ROM hack, or port the game to a new platform, this documentation covers everything from setting up your build environment to diving deep into the game’s physics, object behavior, and audio systems.

Quick Start

Get prerequisites installed and build your first ROM in minutes

Project Structure

Understand how the source tree is organized before diving in

Game Systems

Explore Mario’s physics, object behaviors, rendering, and audio

Modding Guide

Apply enhancement patches and create your own modifications

Build your ROM in four steps

1

Install prerequisites

Install the MIPS cross-compiler toolchain and Python 3.6+. On Ubuntu/Debian:
sudo apt install -y binutils-mips-linux-gnu build-essential git pkgconf python3
2

Clone the repository

git clone https://github.com/n64decomp/sm64.git
cd sm64
3

Place your baserom

Copy a legally obtained Super Mario 64 ROM into the project root. The file must be named according to the region you want to build:
baserom.us.z64   # North America
baserom.jp.z64   # Japan
baserom.eu.z64   # Europe
4

Build

make             # defaults to VERSION=us
make VERSION=jp -j4   # build Japan version with 4 parallel jobs
The compiled ROM appears in the build/ directory.

Explore the codebase

Mario & Physics

MarioState struct, action system, and movement physics

Object Behaviors

Generic object model and behavior scripting language

Collision

Surface detection, floor/wall/ceiling raycasting

Geo Layout

Scene graph and rendering hierarchy description

Level Scripts

Level loading, area initialization, and warp system

Audio Engine

Sequence player, sound synthesis, and bank loading
This repository does not include game assets. You must own a copy of Super Mario 64 to extract the assets needed for compilation.

Build docs developers (and LLMs) love