Modern SDK: Getting Started

Installation Tutorial

This is the tutorial for installing the SDK.
The SDK has only been tested on my Ubuntu 22.04 setup. However, I am reasonably certain it will work on other Debian-based distros, such as Linux Mint.
Additionally, it should work just fine on WSL1 or WSL2, however note that x86 tools will not work on WSL1.

Setting up the toolchain

Add a definition of N64_LIBGCCDIR to your .bashrc. This is because ld does not search for libraries in that directory by default, so it cannot find libgcc.
As the compiler installs to /opt/crashsdk I've added

export N64_LIBGCCDIR="/opt/crashsdk/lib/gcc/mips64-elf/12.2.0"

to the end of my ~/.bashrc script.

Finally, add a definition of PATH to your .bashrc. As the compiler installs to /opt/crashsdk I've added

PATH=$PATH:/opt/crashsdk/bin; export PATH

to the end of my ~/.bashrc script.

Adding the SDK to APT

The SDK is packaged as an APT repo. APT is the software management tool used in Debian and Ubuntu.
You must add our APT repo to the list of repos APT can download from.
To add it, run
echo "deb [trusted=yes] https://crashoveride95.github.io/apt/ ./" | sudo tee /etc/apt/sources.list.d/n64sdk.list
in a Terminal.

Then, run sudo apt update to update the package lists.

You can now download the SDK packages!

Installing the SDK packages

First you need to install the toolchain.

Run
sudo apt install binutils-mips-n64 gcc-mips-n64 newlib-mips-n64
To install.

You have two options for the main N64 libraries: iquesdk, and n64sdk.
n64sdk contains version 2.0L of the N64 SDK library, which is the latest version.
iquesdk contains the version used in the iQue SDK, which is a modified version of 2.0L that removes code for N64 acessories irrelevant to the iQue and edits code for some functions to get correct results with its slightly faster CPU and RAM.

I highly suggest getting the n64sdk package, only get iquesdk if you are specifically targeting the iQue, otherwise things such as rumble and controller pak support will NOT WORK!

To begin setup, install the sdk by installing the package with APT.

sudo apt install (sdk of your choice here)

Then, you need makemask, which fixes the CRC checksum on your ROM.
sudo apt install makemask

Next, you need to setup the root compatibilty environment. This is needed because in the old nintendo SDKs, there was a "ROOT" folder which simulated a unix filesystem.
This creates that setup for compatibility's sake.
sudo apt install root-compatibility-environment

Some distros prevent you from installing i386 packages by default, to fix this do

sudo dpkg --add-architecture i386

Then do

sudo apt install root-compatibility-environment

After you install the environment, add a definition of ROOT to your .bashrc:

export ROOT=/etc/n64

If you want to install the demos, use APT install once again:

sudo apt install n64-demos

You are ready to compile the demos!

Compiling the demos

First, copy the PR directory from /usr/src to your home directory.

cp -r /usr/src/PR ~/n64demos

Then change directory to that folder:

cd ~/n64demos
Change directory to the demo of your choice, and run make to compile it.

(Note that hvqmsample requires libhvqm, a FMV library which the sample demonstrates.)

After you make the demo, you can run the resulting .z64 in the emulator/flashcart of your choice, and it should work perfectly!

NuSystem demos

The NuSystem demos can also be installed via APT:

sudo apt install nusys-demos

They can then be found at /usr/src/PR/nusys. Like the regular demos, it's best to copy them to another directory before compiling.

Back home