gba/examples/instruction_inline.rs
2022-12-01 19:13:31 -07:00

25 lines
441 B
Rust

#![no_std]
#![no_main]
use gba::prelude::*;
#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
loop {}
}
//#[inline(always)]
#[instruction_set(arm::a32)]
fn make_3rd_bg_pal_entry_black() {
let x: u16;
unsafe { core::arch::asm!("movs {}, #0", out(reg) x) };
BG_PALETTE.index(3).write(Color(x));
}
#[no_mangle]
#[instruction_set(arm::t32)]
extern "C" fn main() -> ! {
make_3rd_bg_pal_entry_black();
loop {}
}