PDA

View Full Version : Super Mario 64's source code has been decompiled and officially released



wraggster
August 27th, 2019, 23:05
After having been decompiled back in July, the source code for Super Mario 64 has been completely reverse-engineered, and is now publicly available. Available on GitHub is a full decompilation of the beloved 3D platformer, Super Mario 64. The decompilation works for the NTSC-U and NTSC-J builds of the game, with (E) ROM support coming soon. To keep things legal, you will need to provide your own copy of the game, in order to compile the data, with the exact process being detailed, below. If you've ever wanted to see some of the magic that went into creating such an iconic game, you can now finally see into all of the finer details.


Linux


For each version (jp/us/eu) that you want to build a ROM for, put an existing ROM at ./baserom.<version>.z64 for asset extraction.
Install the following packages:

Debian / Ubuntu



git
binutils-mips-linux-gnu / mips64-elf (>= 2.27)
python3 (>= 3.7)
build-essential
pkg-config
zlib1g-dev
libaudiofile-dev

Arch Linux



base-devel
python
audiofile
mips64-elf-binutils (https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR)
qemu-irix-git (https://aur.archlinux.org/packages/qemu-irix-git) (AUR)



Install qemu-irix

3.a Options: 1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its install instructions in the README. 2. Optionally, grab the prebuilt qemu-irix from the Releases section. 3. (Arch) Use AUR package qemu-irix-git (https://aur.archlinux.org/packages/qemu-irix-git)

3.b (For options 1 or 2), copy executable qemu-irix from irix-linux-user to somewhere convenient with a relatively short path.

mkdir -p /opt/qemu-irix/bin
cp irix-linux-user/qemu-irix /opt/qemu-irix/bin

3.c Define QEMU_IRIX environment variable in your ~/.bashrc to point to this qemu-irix executable.

export QEMU_IRIX=/opt/qemu-irix/bin/qemu-irix



Run make to build the ROM (defaults to us version). Make sure your path to the repo is not too long or else this process will error, as the emulated IDO compiler cannot handle paths longer than 255 characters. Build examples:

make VERSION=jp -j4 # build (J) version instead with 4 jobs
make VERSION=eu COMPARE=0 # non-matching EU version still WIP

Windows
For Windows, install WSL and a distro of your choice and follow the Linux guide.
https://github.com/n64decomp/sm64/blob/master/README.md
https://gbatemp.net/threads/super-mario-64s-source-code-has-been-decompiled-and-officially-released.546814/