Advanced modifications to the Randomzier source require a bit more software than what is needed for running it.
- Download and install the Visual Studio 2015-202x Visual C++ Redistributable package.
- You will want the x64 Architecture version.
- This is to run the automated build of armips. If you plan to compile it yourself you can ignore this, but that is an advanced setup not covered here.
- Download the armips assembler: https://github.com/Kingcom/armips
- Windows automated builds
- On other platforms you'll need either
clang
orgcc
,cmake
, and eitherninja
ormake
installed. All of these should be available in the package repositories of every major Linux distribution and Homebrew on macOS. After, follow the building from source instructions.
- Put the armips executable in the
tools
directory, or somewhere in your PATH. - Put the ROM you want to patch at
roms/base.z64
. This needs to be an uncompressed ROM; OoTRandomizer will produce one at ZOOTDEC.z64 when you run it with a compressed ROM. - Run
python build.py --no-compile-c
, which will:- create
roms/patched.z64
- update some
txt
files inbuild/
and in../data/generated/
. Checkgit status
to see which ones have changed. Make sure you submit them all together!
- create
Recompiling the C code for randomizer requires the N64 development tools to be installed: https://github.com/glankk/n64. There are several ways to do this depending on your platform.
- Windows:
- Without WSL: Download this zip archive and extract the
n64
folder into thetools
directory alongside armips.- Download and install MSYS2.
- Accept the defaults in the installer.
- After the installer completes a terminal window will open.
- In the terminal type
pacman -Syy make
and press Enter. - Make sure it lists
make
for installation and press Enter again to confirm. - After the installation finishes you can close the terminal window.
- In the Start search bar type "Environment Variables" and click "Edit the system environment variables".
- Near the bottom click on the button labeled "Environment Variables...".
- In the new window in the top section look for the variable called "Path" and click it.
- Click the "Edit..." button below the box you selected "Path" in.
- Click on "New" on the right side of the new window.
- Type
C:\msys64\usr\bin
and press Enter. - Click "OK" on all three windows.
- You will now be able to compile the randomizer's C code from CMD, PowerShell, and MSYS2's terminal.
- Download and install MSYS2.
- Using WSL: Install the latest Debian Linux from the Windows Store and follow the below instructions for Debian.
- Without WSL: Download this zip archive and extract the
- Debian: Follow this how-to on adding the toolchain's package repository and installing the pre-built binaries.
- You will also need to run
apt install build-essential
orapt install make
ifmake
is not installed.
- You will also need to run
- Any platform with a gcc compiler: Build from source from the glankk/n64 repository. Simply follow the readme.
- The dependency install script may not install all the necessary libraries depending on your OS version. Take a look at the output from the configure step to see if anything is missing.
- It is easiest if you use
--prefix=/the/path/to/OoT-Randomizer/ASM/tools
for the./configure
step. This will install all the toolchain in a way the build script can use, however this is inconvenient if you plan to use the toolchain for other projects as well. - If you are trying to update the toolchain this way, it is easiest to just delete your local copy of the repository and clone it again to ensure all the packages get updated and are compatible.
You can substitute using the tools
folder with adding the n64/bin
folder to your environment PATH if you need an advanced setup.
To recompile the C modules, use python build.py
in this directory, or adjust the path to build.py
relative to your terminal's working directory.
To generate symbols for the Project64 debugger, use the --pj64sym
option:
python build.py --pj64sym 'path_to_pj64/Saves/THE LEGEND OF ZELDA.sym'
You'll need to disable Unique Game Save Directory
in Project64 for these to work without copying them into each unique save folder. Remember that some changes in code will not be reflected in an existing save, and they need to be deleted and a new save created with this setting disabled.
How to use the Debug mode:
- First put the DEBUG_MODE variable at 1 in debug.h.
- Now the N64 logo sequence at the start of the game will be skipped, the L button will allow you to levitate and you will then have access to a hidden menu with the following options:
- Instant warps to Dungeons, Bosses or Overworld locations
- Item inventory edits
- Instant age switch with the current location kept
- Bunny Hood
- In-game clock
- Actor and overlay list
- Scene flags setters The menu will appear if you press R + either L or Dpad Up. Use Dpad-Left/Dpad-Right and A/B to navigate it. The warps and items are easily customizable with the code at the top of debug.c.
- Additionally, you can call functions to print numbers on screen, to help you debug new features. Call either draw_debug_int or draw_debug_float in your code, with the first argument being the number wanted to be displayed, and the second argument its place on the screen (up to 10 values).