Remove the need for binutils (#425)

Just uses `global_asm!` instead.

- [x] Changelog updated / no changelog update needed
This commit is contained in:
Gwilym Inzani 2023-05-21 20:35:06 +01:00 committed by GitHub
commit 6e441efe92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 90 additions and 216 deletions

View file

@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Install build tools - name: Install build tools
run: sudo apt-get update && sudo apt-get install build-essential binutils-arm-none-eabi libelf-dev zip -y run: sudo apt-get update && sudo apt-get install build-essential libelf-dev zip -y
- name: Install Miri - name: Install Miri
run: | run: |
rustup toolchain install nightly --component miri rustup toolchain install nightly --component miri

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Install build tools - name: Install build tools
run: sudo apt-get update && sudo apt-get install build-essential binutils-arm-none-eabi zip -y run: sudo apt-get update && sudo apt-get install build-essential zip -y
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:

View file

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Changed the default template game. - Changed the default template game.
- `DynamicSprite` has a new API which changes the constructor and adds a `set_pixel` method. - `DynamicSprite` has a new API which changes the constructor and adds a `set_pixel` method.
- You no longer need to install arm-none-eabi-binutils. In order to write games using `agb`, you now only need to install rust nightly.
## [0.15.0] - 2023/04/25 ## [0.15.0] - 2023/04/25
@ -21,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Importing background tiles has been improved. You no longer need to use `include_gfx!` with the toml file. Instead, use `include_background_gfx`. See the documentation for usage. - Importing background tiles has been improved. You no longer need to use `include_gfx!` with the toml file. Instead, use `include_background_gfx`. See the documentation for usage.
- The hashmap implementation is now it its own crate, `agb-hashmap`. There is no change in API, but you can now use this for interop between non-agb code and agb code - The hashmap implementation is now it its own crate, `agb-hashmap`. There is no change in API, but you can now use this for interop between non-agb code and agb code.
- Moved the existing object API to be the OamManaged API. The old names persist with deprecated notices on them. - Moved the existing object API to be the OamManaged API. The old names persist with deprecated notices on them.
## [0.14.0] - 2023/04/11 ## [0.14.0] - 2023/04/11

View file

@ -51,12 +51,6 @@ to just write games for the Game Boy Advance using this library:
for instructions for your operating system. for instructions for your operating system.
* You can update rustup with `rustup update`, or using your package manager * You can update rustup with `rustup update`, or using your package manager
if you obtained rustup in this way. if you obtained rustup in this way.
* arm eabi binutils
* Debian and derivatives: `sudo apt install binutils-arm-none-eabi`
* Arch Linux and derivatives: `pacman -S arm-none-eabi-binutils`
* Windows can apparently use the [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads).
Make sure to select "Add path to environment variable" during the install.
* This process has only been tested on Ubuntu and Arch Linux.
* libelf and cmake * libelf and cmake
* Debian and derivatives: `sudo apt install libelf-dev cmake` * Debian and derivatives: `sudo apt install libelf-dev cmake`
* Arch Linux and derivatives: `pacman -S libelf cmake` * Arch Linux and derivatives: `pacman -S libelf cmake`

View file

@ -1,76 +1,5 @@
use std::path;
fn main() { fn main() {
let asm = &[
"src/crt0.s",
"src/interrupt_handler.s",
"src/sound/mixer/mixer.s",
"src/agbabi/memset.s",
"src/agbabi/memcpy.s",
"src/save/asm_routines.s",
];
println!("cargo:rerun-if-changed=gba.ld"); println!("cargo:rerun-if-changed=gba.ld");
println!("cargo:rerun-if-changed=gba_mb.ld"); println!("cargo:rerun-if-changed=gba_mb.ld");
println!("cargo:rerun-if-changed=src/asm_include.s");
println!("cargo:rerun-if-changed=src/agbabi/macros.inc");
println!("cargo:rerun-if-changed=gfx/test_logo.png");
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR environment variable must be specified");
let mut o_files = vec![];
for &a in asm.iter() {
println!("cargo:rerun-if-changed={a}");
let filename = path::Path::new(a);
let filename = filename.with_extension("o");
let filename = filename
.file_name()
.expect("should have filename")
.to_str()
.expect("Please make it valid utf-8");
let out_file_path = format!("{out_dir}/{filename}");
let out = std::process::Command::new("arm-none-eabi-as")
.arg("-mthumb-interwork")
.arg("-mcpu=arm7tdmi")
.arg("-g")
.args(["-o", out_file_path.as_str()])
.arg(a)
.output()
.unwrap_or_else(|_| panic!("failed to compile {a}"));
assert!(
out.status.success(),
"{}",
String::from_utf8_lossy(&out.stderr)
);
for warning_line in String::from_utf8_lossy(&out.stderr).split('\n') {
if !warning_line.is_empty() {
println!("cargo:warning={warning_line}");
}
}
o_files.push(out_file_path);
}
let archive = format!("{out_dir}/agb.a");
let _ = std::fs::remove_file(&archive);
let ar_out = std::process::Command::new("arm-none-eabi-ar")
.arg("-crs")
.arg(&archive)
.args(&o_files)
.output()
.expect("Failed to create static library");
assert!(
ar_out.status.success(),
"{}",
String::from_utf8_lossy(&ar_out.stderr)
);
println!("cargo:rustc-link-search={out_dir}");
} }

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -11,8 +11,6 @@
=============================================================================== ===============================================================================
*/ */
.include "src/agbabi/macros.inc"
.arm .arm
.section .iwram.__aeabi_memcpy, "ax", %progbits .section .iwram.__aeabi_memcpy, "ax", %progbits
@ -32,14 +30,14 @@ __aeabi_memcpy:
joaobapt_test r3 joaobapt_test r3
// Copy byte head to align // Copy byte head to align
ldrmib r3, [r1], #1 ldrbmi r3, [r1], #1
strmib r3, [r0], #1 strbmi r3, [r0], #1
submi r2, r2, #1 submi r2, r2, #1
// r0, r1 are now half aligned // r0, r1 are now half aligned
// Copy half head to align // Copy half head to align
ldrcsh r3, [r1], #2 ldrhcs r3, [r1], #2
strcsh r3, [r0], #2 strhcs r3, [r0], #2
subcs r2, r2, #2 subcs r2, r2, #2
// r0, r1 are now word aligned // r0, r1 are now word aligned
@ -51,13 +49,13 @@ __aeabi_memcpy4:
blt .Lcopy_words blt .Lcopy_words
// Word aligned, 32-byte copy // Word aligned, 32-byte copy
push {r4-r10} push {{r4-r10}}
.Lloop_32: .Lloop_32:
subs r2, r2, #32 subs r2, r2, #32
ldmgeia r1!, {r3-r10} ldmiage r1!, {{r3-r10}}
stmgeia r0!, {r3-r10} stmiage r0!, {{r3-r10}}
bgt .Lloop_32 bgt .Lloop_32
pop {r4-r10} pop {{r4-r10}}
bxeq lr bxeq lr
// < 32 bytes remaining to be copied // < 32 bytes remaining to be copied
@ -77,40 +75,40 @@ __aeabi_memcpy4:
// This test still works when r2 is negative // This test still works when r2 is negative
joaobapt_test r2 joaobapt_test r2
// Copy half // Copy half
ldrcsh r3, [r1], #2 ldrhcs r3, [r1], #2
strcsh r3, [r0], #2 strhcs r3, [r0], #2
// Copy byte // Copy byte
ldrmib r3, [r1] ldrbmi r3, [r1]
strmib r3, [r0] strbmi r3, [r0]
bx lr bx lr
.Lcopy_halves: .Lcopy_halves:
// Copy byte head to align // Copy byte head to align
tst r0, #1 tst r0, #1
ldrneb r3, [r1], #1 ldrbne r3, [r1], #1
strneb r3, [r0], #1 strbne r3, [r0], #1
subne r2, r2, #1 subne r2, r2, #1
// r0, r1 are now half aligned // r0, r1 are now half aligned
.global __agbabi_memcpy2 .global __agbabi_memcpy2
__agbabi_memcpy2: __agbabi_memcpy2:
subs r2, r2, #2 subs r2, r2, #2
ldrgeh r3, [r1], #2 ldrhge r3, [r1], #2
strgeh r3, [r0], #2 strhge r3, [r0], #2
bgt __agbabi_memcpy2 bgt __agbabi_memcpy2
bxeq lr bxeq lr
// Copy byte tail // Copy byte tail
adds r2, r2, #1 adds r2, r2, #1
ldreqb r3, [r1] ldrbeq r3, [r1]
streqb r3, [r0] strbeq r3, [r0]
bx lr bx lr
.global __agbabi_memcpy1 .global __agbabi_memcpy1
__agbabi_memcpy1: __agbabi_memcpy1:
subs r2, r2, #1 subs r2, r2, #1
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0], #1 strbge r3, [r0], #1
bgt __agbabi_memcpy1 bgt __agbabi_memcpy1
bx lr bx lr
@ -118,7 +116,7 @@ __agbabi_memcpy1:
.align 2 .align 2
.global memcpy .global memcpy
memcpy: memcpy:
push {r0, lr} push {{r0, lr}}
bl __aeabi_memcpy bl __aeabi_memcpy
pop {r0, lr} pop {{r0, lr}}
bx lr bx lr

View file

@ -40,9 +40,9 @@ __aeabi_memset:
// JoaoBapt carry & sign bit test // JoaoBapt carry & sign bit test
movs r1, r1, lsl #31 movs r1, r1, lsl #31
// Set byte and half // Set byte and half
strmib r2, [r0], #1 strbmi r2, [r0], #1
strcsb r2, [r0], #1 strbcs r2, [r0], #1
strcsb r2, [r0] strbcs r2, [r0]
bx lr bx lr
.LskipShortHead: .LskipShortHead:
@ -50,9 +50,9 @@ __aeabi_memset:
// JoaoBapt carry & sign bit test // JoaoBapt carry & sign bit test
movs r3, r3, lsl #31 movs r3, r3, lsl #31
// Set half and byte head // Set half and byte head
strmib r2, [r0], #1 strbmi r2, [r0], #1
submi r1, r1, #1 submi r1, r1, #1
strcsh r2, [r0], #2 strhcs r2, [r0], #2
subcs r1, r1, #2 subcs r1, r1, #2
b __agbabi_wordset4 b __agbabi_wordset4
@ -79,7 +79,7 @@ __agbabi_wordset4:
beq .Lskip32 beq .Lskip32
lsl r3, r12, #5 lsl r3, r12, #5
sub r1, r1, r3 sub r1, r1, r3
push {r4-r9} push {{r4-r9}}
mov r3, r2 mov r3, r2
mov r4, r2 mov r4, r2
mov r5, r2 mov r5, r2
@ -88,10 +88,10 @@ __agbabi_wordset4:
mov r8, r2 mov r8, r2
mov r9, r2 mov r9, r2
.LsetWords8: .LsetWords8:
stmia r0!, {r2-r9} stmia r0!, {{r2-r9}}
subs r12, r12, #1 subs r12, r12, #1
bne .LsetWords8 bne .LsetWords8
pop {r4-r9} pop {{r4-r9}}
.Lskip32: .Lskip32:
// Set words // Set words
@ -104,8 +104,8 @@ __agbabi_wordset4:
// Set half and byte tail // Set half and byte tail
// JoaoBapt carry & sign bit test // JoaoBapt carry & sign bit test
movs r3, r1, lsl #31 movs r3, r1, lsl #31
strcsh r2, [r0], #2 strhcs r2, [r0], #2
strmib r2, [r0] strbmi r2, [r0]
bx lr bx lr
.section .iwram.memset, "ax", %progbits .section .iwram.memset, "ax", %progbits
@ -115,7 +115,7 @@ memset:
mov r3, r1 mov r3, r1
mov r1, r2 mov r1, r2
mov r2, r3 mov r2, r3
push {r0, lr} push {{r0, lr}}
bl __aeabi_memset bl __aeabi_memset
pop {r0, lr} pop {{r0, lr}}
bx lr bx lr

View file

@ -1,3 +1,9 @@
use core::arch::global_asm;
global_asm!(include_str!("macros.inc"));
global_asm!(include_str!("memcpy.s"));
global_asm!(include_str!("memset.s"));
#[cfg(test)] #[cfg(test)]
mod test { mod test {
mod memset { mod memset {

View file

@ -4,14 +4,14 @@
.align 2 .align 2
.global \functionName .global \functionName
.type \functionName, %function .type \functionName, %function
.func \functionName @ .func \functionName
\functionName: \functionName:
.endm .endm
.macro agb_arm_end functionName:req .macro agb_arm_end functionName:req
.pool .pool
.size \functionName,.-\functionName .size \functionName,.-\functionName
.endfunc @ .endfunc
.endm .endm
.macro agb_thumb_func functionName:req .macro agb_thumb_func functionName:req
@ -20,12 +20,12 @@
.align 1 .align 1
.global \functionName .global \functionName
.type \functionName, %function .type \functionName, %function
.func \functionName @ .func \functionName
\functionName: \functionName:
.endm .endm
.macro agb_thumb_end functionName:req .macro agb_thumb_end functionName:req
.pool .pool
.size \functionName,.-\functionName .size \functionName,.-\functionName
.endfunc @ .endfunc
.endm .endm

8
agb/src/global_asm.rs Normal file
View file

@ -0,0 +1,8 @@
use core::arch::global_asm;
global_asm!(include_str!("asm_include.s"));
global_asm!(include_str!("crt0.s"));
global_asm!(include_str!("interrupt_handler.s"));
global_asm!(include_str!("sound/mixer/mixer.s"));
global_asm!(include_str!("save/asm_routines.s"));

View file

@ -26,10 +26,10 @@ InterruptHandler:
@ call the rust interrupt handler with r0 set to the triggered interrupts @ call the rust interrupt handler with r0 set to the triggered interrupts
ldr r1, =__RUST_INTERRUPT_HANDLER ldr r1, =__RUST_INTERRUPT_HANDLER
push {r2, lr} push {{r2, lr}}
mov lr, pc mov lr, pc
bx r1 bx r1
pop {r2, lr} pop {{r2, lr}}
@ change back to interrupt mode @ change back to interrupt mode
mrs r1, cpsr mrs r1, cpsr

View file

@ -174,6 +174,7 @@ mod no_game;
pub use no_game::no_game; pub use no_game::no_game;
pub(crate) mod arena; pub(crate) mod arena;
mod global_asm;
pub use {agb_alloc::ExternalAllocator, agb_alloc::InternalAllocator}; pub use {agb_alloc::ExternalAllocator, agb_alloc::InternalAllocator};

View file

@ -1,5 +1,3 @@
.include "src/asm_include.s"
@ @
@ char WramReadByte(const char* offset); @ char WramReadByte(const char* offset);
@ @
@ -16,7 +14,7 @@ agb_thumb_end agb_rs__WramReadByte
@ A routine that compares two memory offsets. @ A routine that compares two memory offsets.
@ @
agb_thumb_func agb_rs__WramVerifyBuf agb_thumb_func agb_rs__WramVerifyBuf
push {r4-r5, lr} push {{r4-r5, lr}}
movs r5, r0 @ set up r5 to be r0, so we can use it immediately for the return result movs r5, r0 @ set up r5 to be r0, so we can use it immediately for the return result
movs r0, #0 @ set up r0 so the default return result is false movs r0, #0 @ set up r0 so the default return result is false
@ -25,14 +23,14 @@ agb_thumb_func agb_rs__WramVerifyBuf
ldrb r4, [r1,r2] ldrb r4, [r1,r2]
cmp r3, r4 cmp r3, r4
bne 0f bne 0f
sub r2, #1 subs r2, #1
bpl 1b bpl 1b
@ Returns from the function successfully @ Returns from the function successfully
movs r0, #1 movs r0, #1
0: @ Jumps to here return the function unsuccessfully, because r0 contains 0 at this point 0: @ Jumps to here return the function unsuccessfully, because r0 contains 0 at this point
pop {r4-r5} pop {{r4-r5}}
pop {r1} pop {{r1}}
bx r1 bx r1
agb_thumb_end agb_rs__WramVerifyBuf agb_thumb_end agb_rs__WramVerifyBuf
@ -43,7 +41,7 @@ agb_thumb_end agb_rs__WramVerifyBuf
@ A routine that copies one buffer into another. @ A routine that copies one buffer into another.
@ @
agb_thumb_func agb_rs__WramTransferBuf agb_thumb_func agb_rs__WramTransferBuf
0: sub r2, #1 0: subs r2, #1
ldrb r3, [r0,r2] ldrb r3, [r0,r2]
strb r3, [r1,r2] strb r3, [r1,r2]
bne 0b bne 0b

View file

@ -1,5 +1,3 @@
.include "src/asm_include.s"
.section .iwram.buffer_size .section .iwram.buffer_size
.global agb_rs__buffer_size .global agb_rs__buffer_size
.balign 4 .balign 4
@ -15,7 +13,7 @@ agb_arm_func agb_rs__mixer_add
@ stack position 1 - amount to modify the right channel by (u16 fixnum with 4 bits) @ stack position 1 - amount to modify the right channel by (u16 fixnum with 4 bits)
@ @
@ The sound buffer must be SOUND_BUFFER_SIZE * 2 in size = 176 * 2 @ The sound buffer must be SOUND_BUFFER_SIZE * 2 in size = 176 * 2
push {r4-r8} push {{r4-r8}}
ldr r7, [sp, #20] @ load the right channel modification amount into r7 ldr r7, [sp, #20] @ load the right channel modification amount into r7
@ -46,7 +44,7 @@ modifications_fallback:
subs r8, r8, #4 @ loop counter subs r8, r8, #4 @ loop counter
bne 1b @ jump back if we're done with the loop bne 1b @ jump back if we're done with the loop
pop {r4-r8} pop {{r4-r8}}
bx lr bx lr
same_modification: same_modification:
@ -88,7 +86,7 @@ same_modification:
subs r8, r8, #4 @ loop counter subs r8, r8, #4 @ loop counter
bne 1b @ jump back if we're done with the loop bne 1b @ jump back if we're done with the loop
pop {r4-r8} pop {{r4-r8}}
bx lr bx lr
agb_arm_end agb_rs__mixer_add agb_arm_end agb_rs__mixer_add
@ -100,7 +98,7 @@ agb_arm_func agb_rs__mixer_add_stereo
@ r2 - volume to play the sound at @ r2 - volume to play the sound at
@ @
@ The sound buffer must be SOUND_BUFFER_SIZE * 2 in size = 176 * 2 @ The sound buffer must be SOUND_BUFFER_SIZE * 2 in size = 176 * 2
push {r4-r9} push {{r4-r9}}
mov r9, r2 mov r9, r2
ldr r5, =0x00000FFF ldr r5, =0x00000FFF
@ -140,7 +138,7 @@ agb_arm_func agb_rs__mixer_add_stereo
subs r8, r8, #4 @ loop counter subs r8, r8, #4 @ loop counter
bne 1b @ jump back if we're done with the loop bne 1b @ jump back if we're done with the loop
pop {r4-r9} pop {{r4-r9}}
bx lr bx lr
agb_arm_end agb_rs__mixer_add_stereo agb_arm_end agb_rs__mixer_add_stereo
@ -150,7 +148,7 @@ agb_arm_func agb_rs__mixer_collapse
@ r0 = target buffer (i8) @ r0 = target buffer (i8)
@ r1 = input buffer (i16) of fixnums with 4 bits of precision (read in sets of i16 in an i32) @ r1 = input buffer (i16) of fixnums with 4 bits of precision (read in sets of i16 in an i32)
push {r4-r11} push {{r4-r11}}
CONST_0 .req r7 CONST_0 .req r7
CONST_FF .req r8 CONST_FF .req r8
@ -228,6 +226,6 @@ SWAP_SIGN .req r11
subs r2, r2, #16 @ r2 -= 16 subs r2, r2, #16 @ r2 -= 16
bne 1b @ loop if not 0 bne 1b @ loop if not 0
pop {r4-r11} pop {{r4-r11}}
bx lr bx lr
agb_arm_end agb_rs__mixer_collapse agb_arm_end agb_rs__mixer_collapse

View file

@ -10,6 +10,7 @@ agb = { version = "0.15.0", path = "../../../agb" }
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -9,21 +9,14 @@ Firstly, ensure that you have **rustup** installed which you can do by following
If you have already installed rustup, you can update it with `rustup update`. If you have already installed rustup, you can update it with `rustup update`.
# 2. arm-none-eabi # 2. git
To assemble the small amount of assembly in agb and to do the final linking, you'll need to install the `arm-none-eabi` binutils.
* On Debian and derivatives (like Ubuntu): `sudo apt install binutils-arm-none-eabi`
* On Arch Linux and derivatives: `pacman -S arm-none-eabi-binutils`
# 3. git
The source code for the game is hosted on github, so you will need to install git. The source code for the game is hosted on github, so you will need to install git.
* On Debian and derivatives (like Ubuntu): `sudo apt install git` * On Debian and derivatives (like Ubuntu): `sudo apt install git`
* On Arch Linux and derivatives: `pacman -S git` * On Arch Linux and derivatives: `pacman -S git`
# 4. gbafix # 3. gbafix
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'. In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'.
Agb's implementation can be installed very easily using `cargo install agb-gbafix`. Agb's implementation can be installed very easily using `cargo install agb-gbafix`.

View file

@ -9,30 +9,11 @@ Firstly, ensure that you have **rustup** installed which you can do by following
If you have already installed rustup, you can update it with `rustup update`. If you have already installed rustup, you can update it with `rustup update`.
# 2. Install arm-none-eabi # 2. Get git
To assemble the small amount of assembly in agb and to do the final linking, you'll need to install the `arm-none-eabi` binutils.
## Install from ARM
Download the toolchain from [ARM here](https://developer.arm.com/downloads/-/gnu-rm)
* Run the .pkg to install
* Add `/Applications/ARM/bin` to your `/etc/paths` file
## Install from Homebrew
Or you can try installing with homebrew from the [Arm Mbed repo](https://github.com/ARMmbed/homebrew-formulae):
```
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc
```
# 3. Get git
The source code for the game is hosted on github, so you will need git installed. Follow the instructions at [git-scm.com](https://git-scm.com/) The source code for the game is hosted on github, so you will need git installed. Follow the instructions at [git-scm.com](https://git-scm.com/)
# 4. GBA Emulator - mGBA # 3. GBA Emulator - mGBA
We recommend using the mGBA emulator which you can download for Mac [here](https://mgba.io/downloads.html). We recommend using the mGBA emulator which you can download for Mac [here](https://mgba.io/downloads.html).
@ -41,7 +22,7 @@ After installing to your `/Applications` folder you can add the binary to your p
* Add `/Applications/mGBA.app/Contents/MacOS` to `/etc/paths` * Add `/Applications/mGBA.app/Contents/MacOS` to `/etc/paths`
* Inside the `/Applications/mGBA.app/Contents/MacOS` directory (in a terminal) run: `ln -s mGBA mgba-qt` * Inside the `/Applications/mGBA.app/Contents/MacOS` directory (in a terminal) run: `ln -s mGBA mgba-qt`
# 5. Real hardware - gbafix # 4. Real hardware - gbafix
In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'. In order to be able to play games made with agb on real hardware or on some emulators, you will need to install 'agb-gbafix'.
Agb's implementation can be installed very easily using `cargo install agb-gbafix`. Agb's implementation can be installed very easily using `cargo install agb-gbafix`.

View file

@ -1,6 +1,6 @@
# Environment setup # Environment setup
Environment setup will depend on the platform you are using. Environment setup will depend on the platform you are using.
agb's requirements are [rust nightly](https://www.rust-lang.org/) edition and the gnu binutils for `arm-none-eabi`. You need to install the [rust nightly](https://www.rust-lang.org/) edition along with (optionally) some additional tools.
See the sub-pages here for platform specific setup guides. See the sub-pages here for platform specific setup guides.

View file

@ -16,7 +16,7 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
[[package]] [[package]]
name = "agb" name = "agb"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"agb_fixnum", "agb_fixnum",
"agb_hashmap", "agb_hashmap",
@ -31,21 +31,21 @@ dependencies = [
[[package]] [[package]]
name = "agb_fixnum" name = "agb_fixnum"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"agb_macros", "agb_macros",
] ]
[[package]] [[package]]
name = "agb_hashmap" name = "agb_hashmap"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"rustc-hash", "rustc-hash",
] ]
[[package]] [[package]]
name = "agb_image_converter" name = "agb_image_converter"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"asefile", "asefile",
"fontdue", "fontdue",
@ -57,7 +57,7 @@ dependencies = [
[[package]] [[package]]
name = "agb_macros" name = "agb_macros"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -66,7 +66,7 @@ dependencies = [
[[package]] [[package]]
name = "agb_sound_converter" name = "agb_sound_converter"
version = "0.14.0" version = "0.15.0"
dependencies = [ dependencies = [
"hound", "hound",
"proc-macro2", "proc-macro2",

View file

@ -12,6 +12,7 @@ agb = { version = "0.15.0", path = "../../agb" }
[profile.dev] [profile.dev]
opt-level = 2 opt-level = 2
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
panic = "abort" panic = "abort"

View file

@ -12,11 +12,6 @@ all the boiler plate files for you.
You will need the following installed in order to build and run this project: You will need the following installed in order to build and run this project:
* A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system * A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system
* `arm-none-eabi-binutils` for assembling and linking
* Windows: [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads).
Make sure you select "Add path to environment variable" during the install
* Debian and derivatives (e.g. Ubuntu, raspberry pi OS, linux mint): `sudo apt install binutils-arm-none-eabi`
* Arch linux and derivatives: `sudo pacman -S arm-none-eabi-binutils`
You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with
`println!` support via `agb::println!` but any emulator should work. You'll get the best experience if `println!` support via `agb::println!` but any emulator should work. You'll get the best experience if

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -15,6 +15,7 @@ amplitude = { path = "../amplitude" }
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -10,6 +10,7 @@ agb = { version = "0.15.0", path = "../../agb" }
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -16,6 +16,7 @@ serde_json = "1.0"
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -17,6 +17,7 @@ tiled = { version = "0.9.4", default-features = false }
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -12,6 +12,7 @@ agb = "0.15.0"
[profile.dev] [profile.dev]
opt-level = 3 opt-level = 3
debug = true debug = true
codegen-units = 1
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View file

@ -12,11 +12,6 @@ all the boiler plate files for you.
You will need the following installed in order to build and run this project: You will need the following installed in order to build and run this project:
* A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system * A recent version of `rustup`. See the [rust website](https://www.rust-lang.org/tools/install) for instructions for your operating system
* `arm-none-eabi-binutils` for assembling and linking
* Windows: [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads).
Make sure you select "Add path to environment variable" during the install
* Debian and derivatives (e.g. Ubuntu, raspberry pi OS, linux mint): `sudo apt install binutils-arm-none-eabi`
* Arch linux and derivatives: `sudo pacman -S arm-none-eabi-binutils`
You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with You will also want to install an emulator. The best support in agb is with [mgba](https://mgba.io), with
`println!` support via `agb::println!` but any emulator should work. You'll get the best experience if `println!` support via `agb::println!` but any emulator should work. You'll get the best experience if

View file

@ -15,8 +15,6 @@ MEMORY {
__text_start = ORIGIN(rom); __text_start = ORIGIN(rom);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;

View file

@ -14,8 +14,6 @@ MEMORY {
__text_start = ORIGIN(ewram); __text_start = ORIGIN(ewram);
INPUT (agb.a)
SECTIONS { SECTIONS {
. = __text_start; . = __text_start;