The world’s first Game Boy ROM written in Pure Rust

233 points zlfn 19 comments

https://i.redd.it/kj0s7l9foxmh1.gif

For the past two years, I have been working on Rust-GB, a project to compile Rust to the Game Boy.

At first, it went through SDCC, borrowing GBDK, a C library for the Game Boy. (Previous post)

However, recently I wrote LLVM-Z80, which can compile LLVM IR directly to Game Boy machine code, and based on that, I built a Rust library for the Game Boy.

As a result, I can now write a Game Boy Game in Pure Rust!

You can download ROM file here: https://github.com/zlfn/rust-gb/releases/download/v0.0.1-alpha/sprite.gb

Project link: https://github.com/zlfn/rust-gb
Game code: https://github.com/zlfn/rust-gb/blob/main/examples/sprite/src/main.rs
LLVM-Z80: https://github.com/llvm-z80/llvm-z80

Please take a look around, and I’d be happy if you could leave a star.

I am also working on a safe Rust API for the Game Boy hardware, and I would like design feedback from anyone who knows both Rust and the Game Boy.
https://zlfn.github.io/rust-gb/gb/index.html