agb/agb/examples/output.rs
2023-04-06 21:16:13 +01:00

19 lines
427 B
Rust

#![no_std]
#![no_main]
use agb::sync::Static;
static COUNT: Static<u32> = Static::new(0);
#[agb::entry]
fn main(_gba: agb::Gba) -> ! {
let _a = unsafe {
agb::interrupt::add_interrupt_handler(agb::interrupt::Interrupt::VBlank, |_| {
let cur_count = COUNT.read();
agb::println!("Hello, world, frame = {}", cur_count);
COUNT.write(cur_count + 1);
})
};
loop {}
}