···77# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8899[dependencies]
1010-agb = "0.9.2"
1010+agb = "0.10.0"
1111+1212+[dev-dependencies]
1313+agb = { version = "0.10.0", features = ["testing"] }
1414+1515+[profile.dev]
1616+opt-level = 2
1717+debug = true
11181219[profile.release]
1320panic = "abort"
1414-lto = true2121+lto = true
2222+debug = true
+73
README.md
···11+# AGBRS template
22+33+## A basic template example for agb projects
44+55+This makes getting started with a new project for the Game Boy Advance in rust really simple, by providing
66+all the boiler plate files for you.
77+88+## Building
99+1010+### Prerequisites
1111+1212+You will need the following installed in order to build and run this project:
1313+1414+* A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system
1515+* `arm-none-eabi-binutils` for assembling and linking
1616+ * Windows: [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads).
1717+ Make sure you select "Add path to environment variable" during the install
1818+ * Debian and derivatives (e.g. Ubuntu, raspberry pi OS, linux mint): `sudo apt install binutils-arm-none-eabi`
1919+ * Arch linux and derivatives: `sudo pacman -S arm-none-eabi-binutils`
2020+2121+You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with
2222+`println!` support via `agb::println!` but any emulator should work. You'll get the best experience if
2323+`mgba-qt` is in your `PATH`.
2424+2525+If you want to run your game on real hardware, you will also need to install `gbafix` which you can do after installing
2626+rust with the following: `cargo install gbafix`. This is not required if you are only running your game in an emulator.
2727+2828+### Running in an emulator
2929+3030+Once you have the prerequisites installed, you should be able to build using
3131+3232+```sh
3333+cargo build
3434+```
3535+3636+or in release mode (recommended for the final version to ship to players)
3737+3838+```sh
3939+cargo build --release
4040+```
4141+4242+The resulting file will be in `target/thumbv4t-none-eabi/debug/<your game>` or `target/thumbv4t-none-eabi/release/<your game>` depending on
4343+whether you did a release or debug build.
4444+4545+If you have `mgba-qt` in your path, you will be able to run your game with
4646+4747+```sh
4848+cargo run
4949+```
5050+5151+or in release mode
5252+5353+```sh
5454+cargo run --release
5555+```
5656+5757+## Starting development
5858+5959+You can find the documentation for agb [here](https://docs.rs/agb/latest/agb/).
6060+6161+You may also want to change the package name and version in `Cargo.toml` before you start.
6262+6363+## Shipping a .gba file for real hardware
6464+6565+To make a game run on real hardware, you will need to convert the built file into a file suitable for
6666+running on the real thing.
6767+6868+First build the binary in release mode using the instructions above, then do the following:
6969+7070+```sh
7171+arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/<your game> <your game>.gba
7272+gbafix <your game>.gba
7373+```
···99// using the #[agb::entry] proc macro. Failing to do so will cause failure in linking
1010// which won't be a particularly clear error message.
1111#![no_main]
1212+// This is required to allow writing tests
1313+#![cfg_attr(test, feature(custom_test_frameworks))]
1414+#![cfg_attr(test, reexport_test_harness_main = "test_main")]
1515+#![cfg_attr(test, test_runner(agb::test_runner::test_runner))]
12161317use agb::{display, syscall};
1418