A toolchain that compiles Rust code to GBZ80 assembly for creating Game Boy games.
rust-gb is a compiler toolchain that allows developers to write Game Boy games in the Rust programming language by targeting the GBZ80 CPU. It solves the problem of Rust not natively supporting the Game Boy as a compilation target by using a multi-step transpilation process through LLVM-IR and C. The project aims to provide a safer and more modern development experience compared to traditional C or assembly for retro game creation.
Rust developers interested in retro game development, particularly those wanting to create games for the original Game Boy (DMG) using a modern, memory-safe language.
Developers choose rust-gb because it brings Rust's memory safety, strong typing, and expressive syntax to Game Boy development, reducing common bugs associated with low-level C or assembly. It's a unique open-source effort to make Rust a viable language for a classic platform that lacks official compiler support.
Compile Rust code to GBZ80 (Gameboy Z80)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages Rust's ownership model to help prevent common memory errors on the constrained GBZ80 CPU, as emphasized in the README for writing more reliable code.
Uses Rust's expressive syntax and strict type system for higher-quality development compared to traditional C, making it fun and less error-prone.
Integrates with the Game Boy Development Kit for linking and ROM generation, providing access to essential libraries and tools without reinventing the wheel.
Aims to develop a dedicated LLVM backend for Z80/SM83 to simplify the build chain and achieve Tier 3 Rust support, promising long-term improvements.
Relies on a multi-step compilation through LLVM-IR and C conversion using tools like avr-gcc and sdcc, which adds setup complexity and potential failure points.
The project is a work in progress with dependencies on nightly Rust and untested outside the developer's environment, leading to frequent changes and unreliability.
Currently heavily relies on GBDK for libraries and linking, with plans to reduce it not yet implemented, limiting native Rust feature usage and flexibility.