Nintendo 64 Development
The N64 Development Tools is a collection of tools designed to compile and test code for the Nintendo 64.
Building N64 Development Tools for macOS
Getting these tools working is fairly simple, at least when following the README
in the repository. However, macOS is weird. The install-deps
script does
actually work on macOS! Uses brew, and downloads all the dependencies without
issue. The comment about replacing sed
with gsed
is needed, just symlink
gsed
to sed
in the brew bin folder.
Configuring the package also works fine, although the recommended path of
/opt/n64
gave me a permission denied error late into the process, even as
root. When debugging I ultimately decided to test in my home folder (~/n64
).
Installing the toolchain also worked fine, when going through the process
initially it wasn’t happy because I can’t follow directions and forgot to
symlink gsed
. Oops.
Compiling and installing the programs was the hardest part. During make
, it
would stop every second to say it couldn’t find a particular function, or it
couldn’t find a specific include. Find the Makefile complaining, then specify
the includes and libraries in the appropriate places. -I
for header folders,
-L
for library folders, and -i
for specific files (although if I remember
correctly this isn’t needed to fix any of the problems). These files were
downloaded with brew
, so it’s time to go exploring through the Cellar. It’s
mostly self-explanatory, make sure the header paths line up with what’s given,
and if make defines are messed up manually specify the definition (it’s fine, I
promise). Also, libusb
’s library name is usb-1.0
.
GCC Cross Compiling
The important tools, that being the MIPS cross compilers, oddly enough weren’t
put in the installation folder? Like, they were thrown about in the repository
and the specific build folders, like gcc-cross
was found in
n64/build-gcc/gcc
, and this executable is mips64-gcc
. To add it to my path,
I just copied all the executable binaries in this folder into /opt/n64/bin
.
Was there a cleaner way of doing it? Probably.
macOS headers (the one’s obtained through Xcode) are, in fact, not universal.
The headers only allow the CPUs macOS has ever been officially released on, so
PowerPC, Intel, and ARM. To fix this, I downloaded
universal headers
(yes mips64-linux
works on macOS) and add it to the include path when
compiling C code for anything using MIPS. Probably a better way of doing this,
but it works.