agb/examples/panic.rs

27 lines
634 B
Rust
Raw Normal View History

2021-03-07 04:58:59 +11:00
#![no_std]
#![feature(start)]
extern crate gba;
use gba::display;
#[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize {
let gba = gba::Gba::new();
let bitmap = gba.display.bitmap3();
let mut input = gba::input::ButtonController::new();
loop {
input.update();
2021-03-07 07:09:23 +11:00
// if A is pressed, draw out of range
2021-03-07 04:58:59 +11:00
if input.is_just_pressed(gba::input::Button::A) {
bitmap.draw_point(display::WIDTH, 0, 0x05);
}
2021-03-07 07:09:23 +11:00
// if B is pressed, try take another bitmap
if input.is_just_pressed(gba::input::Button::B) {
gba.display.bitmap4();
}
2021-03-07 04:58:59 +11:00
}
}