A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Go to file
Sean Maas e2f05bcea5 Implement fog approximately 2022-05-13 16:42:44 -04:00
actors Refresh 15 2021-10-14 15:25:30 -04:00
asm Refresh 14 2021-07-12 23:17:54 -04:00
assets Refresh 13 2020-12-03 14:26:38 -05:00
bin Refresh 15 2021-10-14 15:25:30 -04:00
data Refresh 15 2021-10-14 15:25:30 -04:00
doxygen init2 2019-08-25 00:46:40 -04:00
enhancements Refresh 14 2021-07-12 23:17:54 -04:00
include Refresh 15 2021-10-14 15:25:30 -04:00
levels Refresh 15 2021-10-14 15:25:30 -04:00
lib Refresh 15 2021-10-14 15:25:30 -04:00
rsp Refresh 14 2021-07-12 23:17:54 -04:00
sound Refresh 14 2021-07-12 23:17:54 -04:00
src Implement fog approximately 2022-05-13 16:42:44 -04:00
text Refresh 13 2020-12-03 14:26:38 -05:00
tools Merge latest changes from upstream 2022-04-12 15:12:43 -04:00
.clang-format Refresh 1 2019-09-01 15:50:50 -04:00
.clang-tidy Refresh 1 2019-09-01 15:50:50 -04:00
.gitattributes Refresh 1 2019-09-01 15:50:50 -04:00
.gitignore init2 2019-08-25 00:46:40 -04:00
CHANGES Refresh 15 2021-10-14 15:25:30 -04:00
Dockerfile Experimental audio support 2021-02-23 02:39:56 -05:00
Doxyfile refresh 4 2019-12-01 21:52:53 -05:00
Jenkinsfile Refresh 13 2020-12-03 14:26:38 -05:00
Makefile Merge latest changes from upstream 2022-04-12 15:12:43 -04:00
Makefile.split Merge latest changes from upstream 2022-04-12 15:12:43 -04:00
README.md Refresh 15 2021-10-14 15:25:30 -04:00
assets.json Refresh 14 2021-07-12 23:17:54 -04:00
build_docker.bat Various build instruction/docker fixups (#2) 2021-02-16 13:47:15 -05:00
charmap.txt refresh 5 2020-01-03 10:38:57 -05:00
charmap_menu.txt refresh 5 2020-01-03 10:38:57 -05:00
diff.py Refresh 13 2020-12-03 14:26:38 -05:00
diff_settings.py Refresh 13 2020-12-03 14:26:38 -05:00
extract_assets.py Refresh 14 2021-07-12 23:17:54 -04:00
first-diff.py Refresh 13 2020-12-03 14:26:38 -05:00
format.sh init2 2019-08-25 00:46:40 -04:00
rename_sym.sh Refresh 14 2021-07-12 23:17:54 -04:00
sm64.eu.sha1 init2 2019-08-25 00:46:40 -04:00
sm64.jp.sha1 init2 2019-08-25 00:46:40 -04:00
sm64.ld Refresh 14 2021-07-12 23:17:54 -04:00
sm64.sh.sha1 Refresh 7 2020-03-01 22:42:52 -05:00
sm64.us.sha1 init2 2019-08-25 00:46:40 -04:00
undefined_syms.txt Refresh 13 2020-12-03 14:26:38 -05:00
util.mk Refresh 13 2020-12-03 14:26:38 -05:00

README.md

Super Mario 64 (1996) for Nintendo DSi

  • This repo contains a full decompilation of Super Mario 64 (J), (U), (E), and (SH), ported to the Nintendo DSi.
  • Naming and documentation of the source code and data structures are in progress.

This repo does not include all assets necessary for compiling the ROMs. A prior copy of the game is required to extract the assets.

Windows installation

  • Download the latest source from here, extract it somewhere
  • Install Docker Desktop from the Docker website, and reboot when the installer prompts you
  • Place a Super Mario 64 ROM as baserom.us.z64 in the directory you extracted the zip to
  • Run build_docker.bat
  • Once the build is complete, the game will be in build/us_nds/.

Linux installation

  • First follow the guide for installing devkitPro packages, also installing the nds-dev group as mentioned
  • Install the needed tools
    • Debian/Ubuntu: sudo apt install -y build-essential git python sox
    • Fedora: sudo dnf install gcc make git python sox
    • Arch/derivatives like Manjaro: sudo pacman -S base-devel git python sox
  • Clone this repository and change to its directory
    git clone https://github.com/Hydr8gon/sm64.git
    cd sm64
    
  • Place a copy of the USA version of Super Mario 64 in this directory, named baserom.us.z64, it should be in the same directory as Makefile.
  • Run make -j$(nproc) to build the game
  • If the build succeeded, the game will be in build/us_nds, named sm64.us.nds

Docker Installation

Create Docker image

After installing and starting Docker, create the docker image. This only needs to be done once.

docker build -t sm64dsi .

Build

To build, mount the local filesystem into the Docker container and build the ROM with docker run sm64 make.

macOS example for (U):
docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64dsi make VERSION=us -j4
Linux example for (U):

For a Linux host, Docker needs to be instructed which user should own the output files:

docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user $UID:$GID sm64dsi make VERSION=us -j4

Resulting artifacts can be found in the build directory.

Project Structure

sm64
├── actors: object behaviors, geo layout, and display lists
├── asm: handwritten assembly code, rom header
│   └── non_matchings: asm for non-matching sections
├── assets: animation and demo data
│   ├── anims: animation data
│   └── demos: demo data
├── bin: C files for ordering display lists and textures
├── build: output directory
├── data: behavior scripts, misc. data
├── doxygen: documentation infrastructure
├── enhancements: example source modifications
├── include: header files
├── levels: level scripts, geo layout, and display lists
├── lib: SDK library code
├── rsp: audio and Fast3D RSP assembly code
├── sound: sequences, sound samples, and sound banks
├── src: C source code for game
│   ├── audio: audio code
│   ├── buffers: stacks, heaps, and task buffers
│   ├── engine: script processing engines and utils
│   ├── game: behaviors and rest of game source
│   ├── goddard: Mario intro screen
│   ├── menu: title screen and file, act, and debug level selection menus
|   └── nds: Nintendo DS-specific code
├── text: dialog, level names, act names
├── textures: skybox and generic texture data
└── tools: build tools

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Run clang-format on your code to ensure it meets the project's coding standards.

Official Discord for the original decomp: discord.gg/DuYH3Fh