Skip to content

ErikMN/SimpleN64Demo

Repository files navigation

SimpleN64Demo N64 logo

⚠️ Important: These demo applications are not affiliated with Nintendo.
They are for educational purposes only.

A simple Nintendo 64 application using Nintendo libraries.
Includes a script for automatically setting up the N64 SDK on modern Linux distributions.

├── SimpleN64Demo       // Demo using libultra
└── SimpleN64DemoNusys  // Demo using NuSystem abstraction layer

N64 demo

🔨 Setup toolchain and SDK

Building natively on host

For Debian/Ubuntu/Fedora run:

make deps

For other Linux distributions you will have to install the dependencies manually.
Look in the package list for Debian or Fedora to get an idea of what is needed.

Then run:

make hostsetup

This will take a while (the n64chain will take about 1GB of disk space when done).
After that just source the init script like so (this will be done automatically in VSCodes integrated terminal):

source init_n64_env.sh

Building using Docker

This will build the n64chain in Docker without the need to install any host dependencies, just run:

make dockersetup

Then run:

make dockerbuild

To build the N64 apps (the Docker image takes about 2.5GB of disk space).

Problems

If you get an error message when building stating something like:

../mips64-elf/bin/as: error while loading shared libraries: libopcodes-2.34.so: cannot open shared object file: No such file or directory

You will need to set LD_LIBRARY_PATH to point to the lib directory of the toolchain:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$N64_TOOLCHAIN/tools/x86_64-pc-linux-gnu/mips64-elf/lib/

Emulators

Cen64 is included when setting up the n64chain.

alias cen64mt="cen64 -multithread -noaudio $N64_TOOL_CHAIN/tools/bin"

More emulators here.

Debugging using VSCode and GDB

It is possible to debug the N64 app using GDB.
This has been setup with Visual Studio Code.

Prerequisites

With cen64 setup as the N64 emulator just run:

make debug

to start the GDB server on port 8080.
Then press F5 in VSCode to connect to the GDB server.
If a breakpoint has been set in the code, GDB will pause the execution at that point.

⭐ Useful links

Developing software for the N64 can be challenging. Here are some useful links to help you get started.

Awesome N64 Development

Nintendo 64 Development Resource

Nintendo 64 Online Manuals

Nintendo 64 Architecture

Debugging Nintendo 64 ROMs with GDB and Cen64

Wavefront OBJ model converter

Nintendo 64 Programming notes

Nintendo 64 modern SDK

n64chain

Nintendo 64 homebrew demo & tutorial

About

Simple demo app setup tool for Nintendo 64

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published