gitmyhub

sm64

C ★ 8.6k updated 2y ago

A Super Mario 64 decompilation, brought to you by a bunch of clever folks.

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.

CMakeLinuxDockerWSLsetup: hardcomplexity 4/5

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.

Where it fits