| Crates.io | bevy_mod_gba |
| lib.rs | bevy_mod_gba |
| version | 0.1.0 |
| created_at | 2025-03-26 23:00:42.562709+00 |
| updated_at | 2025-04-26 07:50:22.974518+00 |
| description | Platform support for the GameBoy Advance with the Bevy game engine |
| homepage | |
| repository | https://github.com/bushrat011899/bevy_mod_gba |
| max_upload_size | |
| id | 1607280 |
| size | 436,678 |
This crate provides integration between the agb HAL for the GameBoy Advance, and the Bevy game engine.
Simply add the AgbPlugin to your no_std Bevy application, and you'll have access to:
Gamepad componentSprite componentTime and the built-in hardware timerBelow is a screenshot from the game example on the repository.

You may want to install the below to allow running the example:
mgba is in your PATH for the best experience.agb-gbafix using cargo install agb-gbafix. This is not required if you are only running your game in an emulator, but does allow neatly packaging a ROM.Since this is largely based on abg it's possible to get started using their template.
If you'd like to setup a project from scratch, here's what you'll want to do:
Create a new project with cargo init.
Create a rust-toolchain.toml file in the project root with the following contents:
[toolchain]
channel = "nightly"
components = ["rust-src", "clippy", "rustfmt"]
Note that this informs cargo that we require a nightly toolchain and would like a copy of the Rust source code, and the clippy and rustfmt tools.
Create a .cargo/config.toml file with the following contents:
[unstable]
build-std = ["core", "alloc"]
build-std-features = ["compiler-builtins-mem"]
[build]
target = "thumbv4t-none-eabi"
[target.thumbv4t-none-eabi]
rustflags = [
"-Clink-arg=-Tgba.ld",
"-Ctarget-cpu=arm7tdmi",
"-Cforce-frame-pointers=yes",
]
runner = ["mgba", "-C", "logToStdout=1", "-C", "logLevel.gba.debug=127"]
[target.armv4t-none-eabi]
rustflags = [
"-Clink-arg=-Tgba.ld",
"-Ctarget-cpu=arm7tdmi",
"-Cforce-frame-pointers=yes",
]
runner = ["mgba", "-C", "logToStdout=1", "-C", "logLevel.gba.debug=127"]
This informs the compiler that we need to compile core and alloc from source, since we have some custom flags to apply.
Additionally, this sets up the mGBA emulator as our runner, allowing cargo run to work as expected.
Once you have the prerequisites installed, you should be able to build using
cargo build
or in release mode (strongly recommended)
cargo build --release
The resulting file will be in target/thumbv4t-none-eabi/debug/my_game or target/thumbv4t-none-eabi/release/my_game depending on
whether you did a release or debug build.
If you have mgba in your path, you will be able to run your game with
cargo run
or in release mode
cargo run --release
To make a game run on real hardware, you will need to convert the built file into a file suitable for running on the real thing.
First build the binary in release mode using the instructions above, then do the following:
agb-gbafix target/thumbv4t-none-eabi/release/my_game -o my_game.gba