mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
update examples
This commit is contained in:
parent
1f3d3380f1
commit
c74707b1a6
|
@ -8,13 +8,13 @@ use bare_metal::{CriticalSection, Mutex};
|
|||
#[agb::entry]
|
||||
fn main(_gba: agb::Gba) -> ! {
|
||||
let count = Mutex::new(RefCell::new(0));
|
||||
agb::add_interrupt_handler!(
|
||||
let _a = agb::interrupt::add_interrupt_handler(
|
||||
agb::interrupt::Interrupt::VBlank,
|
||||
|key: &CriticalSection| {
|
||||
let mut count = count.borrow(*key).borrow_mut();
|
||||
agb::println!("Hello, world, frame = {}", *count);
|
||||
*count += 1;
|
||||
}
|
||||
},
|
||||
);
|
||||
loop {}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ fn main(mut gba: agb::Gba) -> ! {
|
|||
|
||||
let back = Mutex::new(RefCell::new(BackCosines { cosines, row: 0 }));
|
||||
|
||||
agb::add_interrupt_handler!(Interrupt::HBlank, |key: &CriticalSection| {
|
||||
let _a = agb::interrupt::add_interrupt_handler(Interrupt::HBlank, |key: &CriticalSection| {
|
||||
let mut backc = back.borrow(*key).borrow_mut();
|
||||
let deflection = backc.cosines[backc.row % 32];
|
||||
unsafe { ((0x0400_0010) as *mut u16).write_volatile(deflection) }
|
||||
|
|
Loading…
Reference in a new issue