My actor.rpg avatar walking around on a GBA game
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update to v0.10.0

GBA bot 0b95dc82 2bd6b011

+104 -12
+10 -2
Cargo.toml
··· 7 7 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 8 9 9 [dependencies] 10 - agb = "0.9.2" 10 + agb = "0.10.0" 11 + 12 + [dev-dependencies] 13 + agb = { version = "0.10.0", features = ["testing"] } 14 + 15 + [profile.dev] 16 + opt-level = 2 17 + debug = true 11 18 12 19 [profile.release] 13 20 panic = "abort" 14 - lto = true 21 + lto = true 22 + debug = true
+73
README.md
··· 1 + # AGBRS template 2 + 3 + ## A basic template example for agb projects 4 + 5 + This makes getting started with a new project for the Game Boy Advance in rust really simple, by providing 6 + all the boiler plate files for you. 7 + 8 + ## Building 9 + 10 + ### Prerequisites 11 + 12 + You will need the following installed in order to build and run this project: 13 + 14 + * A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system 15 + * `arm-none-eabi-binutils` for assembling and linking 16 + * Windows: [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). 17 + Make sure you select "Add path to environment variable" during the install 18 + * Debian and derivatives (e.g. Ubuntu, raspberry pi OS, linux mint): `sudo apt install binutils-arm-none-eabi` 19 + * Arch linux and derivatives: `sudo pacman -S arm-none-eabi-binutils` 20 + 21 + You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with 22 + `println!` support via `agb::println!` but any emulator should work. You'll get the best experience if 23 + `mgba-qt` is in your `PATH`. 24 + 25 + If you want to run your game on real hardware, you will also need to install `gbafix` which you can do after installing 26 + rust with the following: `cargo install gbafix`. This is not required if you are only running your game in an emulator. 27 + 28 + ### Running in an emulator 29 + 30 + Once you have the prerequisites installed, you should be able to build using 31 + 32 + ```sh 33 + cargo build 34 + ``` 35 + 36 + or in release mode (recommended for the final version to ship to players) 37 + 38 + ```sh 39 + cargo build --release 40 + ``` 41 + 42 + The resulting file will be in `target/thumbv4t-none-eabi/debug/<your game>` or `target/thumbv4t-none-eabi/release/<your game>` depending on 43 + whether you did a release or debug build. 44 + 45 + If you have `mgba-qt` in your path, you will be able to run your game with 46 + 47 + ```sh 48 + cargo run 49 + ``` 50 + 51 + or in release mode 52 + 53 + ```sh 54 + cargo run --release 55 + ``` 56 + 57 + ## Starting development 58 + 59 + You can find the documentation for agb [here](https://docs.rs/agb/latest/agb/). 60 + 61 + You may also want to change the package name and version in `Cargo.toml` before you start. 62 + 63 + ## Shipping a .gba file for real hardware 64 + 65 + To make a game run on real hardware, you will need to convert the built file into a file suitable for 66 + running on the real thing. 67 + 68 + First build the binary in release mode using the instructions above, then do the following: 69 + 70 + ```sh 71 + arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/<your game> <your game>.gba 72 + gbafix <your game>.gba 73 + ```
+8 -4
gba.ld
··· 4 4 ENTRY(__start) 5 5 EXTERN(__RUST_INTERRUPT_HANDLER) 6 6 7 + EXTERN(__agbabi_memset) 8 + EXTERN(__agbabi_memcpy) 9 + 7 10 MEMORY { 8 11 ewram (w!x) : ORIGIN = 0x02000000, LENGTH = 256K 9 12 iwram (w!x) : ORIGIN = 0x03000000, LENGTH = 32K ··· 12 15 13 16 __text_start = ORIGIN(rom); 14 17 18 + INPUT (agb.a) 19 + 15 20 SECTIONS { 16 21 . = __text_start; 17 22 18 - .crt0 : { 19 - KEEP (crt0.o(.text)); 20 - . = ALIGN(4); 21 - } > rom 22 23 23 24 .text : { 25 + KEEP(*(.crt0)); 26 + *(.crt0 .crt0*); 24 27 *(.text .text*); 25 28 . = ALIGN(4); 26 29 } > rom ··· 62 65 .bss : { 63 66 *(.bss .bss.*); 64 67 . = ALIGN(4); 68 + __iwram_end = ABSOLUTE(.); 65 69 } > iwram 66 70 67 71 __iwram_rom_length_bytes = __iwram_data_end - __iwram_data_start;
+9 -6
gba_mb.ld
··· 4 4 ENTRY(__start) 5 5 EXTERN(__RUST_INTERRUPT_HANDLER) 6 6 7 + EXTERN(__agbabi_memset) 8 + EXTERN(__agbabi_memcpy) 9 + 7 10 MEMORY { 8 11 ewram (w!x) : ORIGIN = 0x02000000, LENGTH = 256K 9 12 iwram (w!x) : ORIGIN = 0x03000000, LENGTH = 32K ··· 11 14 12 15 __text_start = ORIGIN(ewram); 13 16 17 + INPUT (agb.a) 18 + 14 19 SECTIONS { 15 20 . = __text_start; 16 21 17 - .crt0 : { 18 - KEEP (crt0.o(.text)); 19 - . = ALIGN(4); 20 - } > ewram 21 - 22 22 .text : { 23 + KEEP(*(.crt0)); 24 + *(.crt0 .crt0*); 23 25 *(.text .text*); 24 26 . = ALIGN(4); 25 - } > ewram 27 + } > rom 26 28 __text_end = .; 27 29 28 30 .rodata : { ··· 61 63 .bss : { 62 64 *(.bss .bss.*); 63 65 . = ALIGN(4); 66 + __iwram_end = ABSOLUTE(.); 64 67 } > iwram 65 68 66 69 __iwram_rom_length_bytes = __iwram_data_end - __iwram_data_start;
+4
src/main.rs
··· 9 9 // using the #[agb::entry] proc macro. Failing to do so will cause failure in linking 10 10 // which won't be a particularly clear error message. 11 11 #![no_main] 12 + // This is required to allow writing tests 13 + #![cfg_attr(test, feature(custom_test_frameworks))] 14 + #![cfg_attr(test, reexport_test_harness_main = "test_main")] 15 + #![cfg_attr(test, test_runner(agb::test_runner::test_runner))] 12 16 13 17 use agb::{display, syscall}; 14 18