#n64 #rom #mips #elf-file #mips3

bin+lib nust64

Build tools for compiling a Rust project into an N64 ROM

10 unstable releases (3 breaking)

0.4.0 Feb 26, 2024
0.3.1 Feb 22, 2024
0.2.0 Jan 6, 2023
0.1.7 Dec 23, 2022
0.1.3 Jun 17, 2022

#308 in Hardware support

Download history 56/week @ 2023-12-22 2/week @ 2024-01-26 36/week @ 2024-02-02 81/week @ 2024-02-09 295/week @ 2024-02-16 283/week @ 2024-02-23 37/week @ 2024-03-01 10/week @ 2024-03-08 15/week @ 2024-03-15 3/week @ 2024-03-22 60/week @ 2024-03-29 13/week @ 2024-04-05

92 downloads per month

MIT license

26KB
430 lines

License: MIT Crates.io Documentation

Description

nust64 is a tool for building rust projects into n64 roms. It's intended as a Cargo runner, but may also be used as a library.

Usage

For using nust64 as a crate, refer to the docs.

Otherwise, you can install nust64 as a runnable program using cargo install nust64. If you wish to install from source, download the repo and run cargo install --path . Once installed, run nust64 --help for additional details.

Cargo Runner

First you should install nust64 as described above. Next, if your project doesn't already have it, create the file .cargo/config.toml, and include this section:

[target.mips-nintendo64-none]
runner = [
    "nust64",
    "--elf"
]

When you cargo run or cargo run --release, Cargo will append the runner command with the path to the compiled ELF file for your project, and execute the command.

If you are using a target with a different name, then replace mips-nintendo64-none with the desired target triple or cfg expression.

If you want to use any arguments that have spaces in it, you must format it like below.. Say you wanted to run the Ares emulator after building the rom:

[target.mips-nintendo64-none]
runner = [
    "nust64",
    "--post-exec", "/path/to/ares >>ROM<<",
    "--elf"
]

IPL3 Selection

The IPL3 is a small portion of code that the N64 executes automatically during the boot process. Every ROM must contain a valid IPL3.

To provide your own IPL3, use the --ipl3 argument like so:

[target.mips-nintendo64-none]
runner = [
    "nust64",
    "--ipl3", "path/to/ipl3.bin",
    "--elf"
]

To use one of libdragon's open-source IPL3s, you must omit --ipl3 and optionally specify which IPL3 version to use with --libdragon <option>. Available options: compat, debug, or release.

If both --ipl3 and --libdragon are omitted, --libdragon release will be used by default.

Here's an example of using the debug (aka the "dev") version of libdragon's IPL3:

[target.mips-nintendo64-none]
runner = [
    "nust64",
    "--libdragon", "debug",
    "--elf"
]

Acknowledgements

Thanks to the first build tool, cargo-n64, written by parasyte. I initially relied on that project to learn the basics of what was needed to compile for the n64's architecture.

Dependencies

~3.5MB
~71K SLoC