Write Game Boy games in Rust
See the code
Compile Rust to Game Boy ROMs.
Everything needed to write a Game Boy program in Rust, and to build it into a ROM.
Rust libraries for writing Game Boy programs
rust-gb: the hardware abstraction layer, and the crate to start from.gb-bank, gb-hram, gb-pak,
gb-ram-fn: the pieces behind rust-gbgb-rt: the runtime. rrt0.s is the
startup code a cartridge boots into.gbdk-sys: Rust bindings to
GBDK-2020.Host tools for building ROM
cargo-gb, gb-header-fix,
gb-bank-pack: turn a crate into a ROM.gb-image-fx: convert images into Game Boy tile data.Example programs
examples/: example Game Boy ROMs written in Rust.Building Rust-GB also produced llvm-z80, rust-z80 and decolorize.
Install the build tool once:
cargo install --path tools/cargo-gb
Then, in any example (or your own crate):
cargo gb build # compiles and writes target/<name>.gb
cargo gb run # build, then launch $EMULATOR (default: sameboy)
The rust-z80 toolchain bundles the SM83 linker and LLVM tools, so there is nothing else to configure.
The Game Boy is not a Rust target (it is not even in Tier 3), and there has been no stable LLVM backend for its CPU.
Rust-GB uses a custom LLVM backend for Game Boy:
sm83 and emits LLVM-IR.cargo gb build (cargo-gb) drives the whole pipeline.This project's goal is to develop a Game Boy Development Kit that enables the creation of Game Boy games using Rust, including safe management APIs in Game Boy memory, abstracted functions, and more.
If you like this project, you can always join our Discussion! Please feel free to share your opinions or ideas.
This project is in its very early stages, and we are still designing many things, so it would be nice to have a variety of ideas.
PRs are always welcome too!
Rust
96.3%
Assembly
2.2%
Write Game Boy games in Rust
See the code
Compile Rust to Game Boy ROMs.
Everything needed to write a Game Boy program in Rust, and to build it into a ROM.
Rust libraries for writing Game Boy programs
rust-gb: the hardware abstraction layer, and the crate to start from.gb-bank, gb-hram, gb-pak,
gb-ram-fn: the pieces behind rust-gbgb-rt: the runtime. rrt0.s is the
startup code a cartridge boots into.gbdk-sys: Rust bindings to
GBDK-2020.Host tools for building ROM
cargo-gb, gb-header-fix,
gb-bank-pack: turn a crate into a ROM.gb-image-fx: convert images into Game Boy tile data.Example programs
examples/: example Game Boy ROMs written in Rust.Building Rust-GB also produced llvm-z80, rust-z80 and decolorize.
Install the build tool once:
cargo install --path tools/cargo-gb
Then, in any example (or your own crate):
cargo gb build # compiles and writes target/<name>.gb
cargo gb run # build, then launch $EMULATOR (default: sameboy)
The rust-z80 toolchain bundles the SM83 linker and LLVM tools, so there is nothing else to configure.
The Game Boy is not a Rust target (it is not even in Tier 3), and there has been no stable LLVM backend for its CPU.
Rust-GB uses a custom LLVM backend for Game Boy:
sm83 and emits LLVM-IR.cargo gb build (cargo-gb) drives the whole pipeline.This project's goal is to develop a Game Boy Development Kit that enables the creation of Game Boy games using Rust, including safe management APIs in Game Boy memory, abstracted functions, and more.
If you like this project, you can always join our Discussion! Please feel free to share your opinions or ideas.
This project is in its very early stages, and we are still designing many things, so it would be nice to have a variety of ideas.
PRs are always welcome too!
Rust
96.3%
Assembly
2.2%