mirror of
https://github.com/italicsjenga/gba.git
synced 2025-01-11 11:31:31 +11:00
temporarily do not provide our own aeabi divisions
This commit is contained in:
parent
9d06d92067
commit
e31f796375
|
@ -11,6 +11,9 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! {
|
||||||
|
|
||||||
static KEYS: GbaCell<KeyInput> = GbaCell::new(KeyInput::new());
|
static KEYS: GbaCell<KeyInput> = GbaCell::new(KeyInput::new());
|
||||||
|
|
||||||
|
#[link_section = ".ewram"]
|
||||||
|
static VALUE: GbaCell<u16> = GbaCell::new(0);
|
||||||
|
|
||||||
extern "C" fn irq_handler(_: u16) {
|
extern "C" fn irq_handler(_: u16) {
|
||||||
// just as a demo, we'll read the keys during vblank.
|
// just as a demo, we'll read the keys during vblank.
|
||||||
KEYS.write(KEYINPUT.read());
|
KEYS.write(KEYINPUT.read());
|
||||||
|
@ -29,6 +32,7 @@ extern "C" fn main() -> ! {
|
||||||
VBlankIntrWait();
|
VBlankIntrWait();
|
||||||
|
|
||||||
let k = KEYS.read();
|
let k = KEYS.read();
|
||||||
|
VALUE.write((k.to_u16() + 3) / k.to_u16()); // force a runtime division
|
||||||
BACKDROP_COLOR.write(Color(k.to_u16()));
|
BACKDROP_COLOR.write(Color(k.to_u16()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,7 +314,7 @@ unsafe extern "C" fn runtime_irq_handler() {
|
||||||
///
|
///
|
||||||
/// [aeabi-division-by-zero]: https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#division-by-zero
|
/// [aeabi-division-by-zero]: https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#division-by-zero
|
||||||
#[naked]
|
#[naked]
|
||||||
#[no_mangle]
|
//#[no_mangle]
|
||||||
#[instruction_set(arm::a32)]
|
#[instruction_set(arm::a32)]
|
||||||
// this should literally never get called for real, so we leave it in ROM
|
// this should literally never get called for real, so we leave it in ROM
|
||||||
extern "C" fn __aeabi_idiv0(numerator: i32) -> i32 {
|
extern "C" fn __aeabi_idiv0(numerator: i32) -> i32 {
|
||||||
|
@ -339,7 +339,7 @@ extern "C" fn __aeabi_idiv0(numerator: i32) -> i32 {
|
||||||
/// [aeabi-integer-32-32-division]:
|
/// [aeabi-integer-32-32-division]:
|
||||||
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
||||||
#[naked]
|
#[naked]
|
||||||
#[no_mangle]
|
//#[no_mangle]
|
||||||
#[instruction_set(arm::a32)]
|
#[instruction_set(arm::a32)]
|
||||||
#[link_section = ".iwram.aeabi.uidiv"]
|
#[link_section = ".iwram.aeabi.uidiv"]
|
||||||
extern "C" fn __aeabi_uidiv(numerator: u32, denominator: u32) -> u32 {
|
extern "C" fn __aeabi_uidiv(numerator: u32, denominator: u32) -> u32 {
|
||||||
|
@ -383,7 +383,7 @@ extern "C" fn __aeabi_uidiv(numerator: u32, denominator: u32) -> u32 {
|
||||||
/// [aeabi-integer-32-32-division]:
|
/// [aeabi-integer-32-32-division]:
|
||||||
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
||||||
#[naked]
|
#[naked]
|
||||||
#[no_mangle]
|
//#[no_mangle]
|
||||||
#[instruction_set(arm::a32)]
|
#[instruction_set(arm::a32)]
|
||||||
#[link_section = ".iwram.aeabi.idiv"]
|
#[link_section = ".iwram.aeabi.idiv"]
|
||||||
extern "C" fn __aeabi_idiv(numerator: i32, denominator: i32) -> u32 {
|
extern "C" fn __aeabi_idiv(numerator: i32, denominator: i32) -> u32 {
|
||||||
|
@ -421,7 +421,7 @@ extern "C" fn __aeabi_idiv(numerator: i32, denominator: i32) -> u32 {
|
||||||
/// [aeabi-integer-32-32-division]:
|
/// [aeabi-integer-32-32-division]:
|
||||||
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
||||||
#[naked]
|
#[naked]
|
||||||
#[no_mangle]
|
//#[no_mangle]
|
||||||
#[instruction_set(arm::a32)]
|
#[instruction_set(arm::a32)]
|
||||||
#[link_section = ".iwram.aeabi.uidivmod"]
|
#[link_section = ".iwram.aeabi.uidivmod"]
|
||||||
extern "C" fn __aeabi_uidivmod(numerator: u32, denominator: u32) -> u64 {
|
extern "C" fn __aeabi_uidivmod(numerator: u32, denominator: u32) -> u64 {
|
||||||
|
@ -457,7 +457,7 @@ extern "C" fn __aeabi_uidivmod(numerator: u32, denominator: u32) -> u64 {
|
||||||
/// [aeabi-integer-32-32-division]:
|
/// [aeabi-integer-32-32-division]:
|
||||||
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
/// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#integer-32-32-32-division-functions
|
||||||
#[naked]
|
#[naked]
|
||||||
#[no_mangle]
|
//#[no_mangle]
|
||||||
#[instruction_set(arm::a32)]
|
#[instruction_set(arm::a32)]
|
||||||
#[link_section = ".iwram.aeabi.idivmod"]
|
#[link_section = ".iwram.aeabi.idivmod"]
|
||||||
extern "C" fn __aeabi_idivmod(numerator: i32, denominator: i32) -> u64 {
|
extern "C" fn __aeabi_idivmod(numerator: i32, denominator: i32) -> u64 {
|
||||||
|
|
Loading…
Reference in a new issue