Skip to content
Make Nintendo 64 games in Rust! πŸ¦€
Rust
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cargo-n64 Improve xbuild integration (#21) Feb 21, 2020
examples Forbid unsafe code (where possible) (#10) Nov 7, 2019
.gitignore Initial commit Dec 15, 2018
.travis.yml Pull in cargo-xbuild as a dep (#17) Feb 21, 2020
Cargo.lock Update dependencies (#22) Feb 22, 2020
Cargo.toml Enable CI (#8) Oct 28, 2019
LICENSE Initial commit Dec 15, 2018
README.md Pull in cargo-xbuild as a dep (#17) Feb 21, 2020
rust-toolchain Update Rust nightly (#14) Feb 16, 2020

README.md

cargo-n64

Build Status Crates.io unsafe forbidden

A cargo subcommand to build Nintendo 64 ROMs in Rust! πŸ¦€

Installation

Requires Rust nightly.

When built from source, cargo will automatically install the correct version of the nightly compiler, based on the rust-toolchain file. However you will still need to install the rust-src component separately. It is recommended that you explicitly install the dependencies with the same versions used in CI, as described below.

Install dependencies:

rustup toolchain install nightly-2020-02-16
rustup run nightly-2020-02-16 -- rustup component add rust-src

Install cargo-n64:

cargo install cargo-n64

What does it do?

Nintendo 64 ROMs are flat binaries, and each one is unique. There is no standard format for the binary beyond a simple 64-byte header and a ~4KB bootcode (aka Initial Program Loader 3/IPL3). Everything beyond the first 4KB boundary is MIPS code and whatever data it requires. This is unlike modern application or game development where an operating system has a standard binary format (like ELF, PE, or WASM). In fact, the N64 doesn't even have an operating system! The flat binary in the ROM is the operating system, for all intents and purposes.

This makes it challenging to get started with N64 development, in general. You first have to build an OS from scratch, or use a library like libdragon or libn64. Then you need a tool (or two, or three!) to convert the object files from the compiler toolchain into a flat binary, add the header and IPL3, and finally fix the IPL3 checksum. cargo-n64 takes the place of the latter set of tools and plugs in nicely to the Rust/cargo ecosystem.

For copyright purposes, the IPL3 binary is not included in this package. Collecting a working IPL3 binary is left as an exercise for the reader. You will be required to provide the path to your IPL3 with the --ipl3 command line argument.

You can’t perform that action at this time.