Step 1:
If you're running Windows 10, install WSL. If you're running an older version of Windows, install a Linux VM. If you're already running a Linux OS, you're good to go.
Step 2:
Install the following packages:
make
git
binutils-mips-linux-gnu
python3
pip3
For your convenience, you can copy the following:
sudo apt-get update
sudo apt-get install make
sudo apt-get install git
sudo apt-get install binutils-mips-linux-gnu
sudo apt-get install python3
sudo apt-get install python3-pip
Step 3:
Make a fork of the main repository https://github.com/zeldaret/mm.git and clone your fork.
Step 4:
You will need to acquire a copy of the ROM. The md5 of this ROM should be 2a0a8acb61538235bc1094d297fb6556
.
Run the command
make init
This will extract all the individual files in the ROM into a newly created baserom folder, as well as decompress the compressed files in a newly created decomp folder. This will create the build folders as well as a newly created asm folder containing the disassemblies of nearly all the files containing code.
This make target will also build the ROM. You should see the following text printed:
rom.z64: OK
If you instead see the following:
rom.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
This means that something is wrong with the ROM's contents. Either the baserom files are incorrect due to a bad ROM, or some piece of code is not matching.
The make init
target will also copy the successful build to the ./expected
directory which will be used by the diff script.
This command can be used to invoke the diff script in order to aid in decompiling functions: ./tools/asm-differ/diff.py -wmo {function_name}
Happy decompiling!
Step 5 (Optional):
Step 5 is optional since ido recomp is now the default compiler.
- Download build_tools.zip from the Releases section.
- Extract build_tools.zip to the
/path/to/mm/tools
folder. - This contains the compilers the decompilation uses, as well as a modified version of Qemu to emulate them on a modern Linux system.
- The compilers must go into the tools folder. Qemu may be placed wherever you like. If Qemu is not in the builds folder, then you will need to set the correct path in the next steps.
Option A
Open up your .bashrc file (~/.bashrc), scroll to the bottom, and add the following, replacing /path/to/qemu-mips
with the location the qemu-mips you extracted from the build tools:
export QEMU_IRIX="/path/to/qemu-mips"
Save and close/reopen your terminal window.
Option B
Ensure that QEMU_IRIX
is not a defined environment variable.
Copy qemu-mips
to /path/to/repository/tools/qemu-mips