mirror of
https://github.com/italicsjenga/gba.git
synced 2024-12-24 03:11:29 +11:00
update example
This commit is contained in:
parent
1fbf3077ac
commit
0840f9a6f7
|
@ -15,12 +15,14 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GbaCell is non-freeze, so `.data` section, so this will default to IWRAM.
|
||||||
static KEYS: GbaCell<KeyInput> = GbaCell::new(KeyInput::new());
|
static KEYS: GbaCell<KeyInput> = GbaCell::new(KeyInput::new());
|
||||||
|
|
||||||
|
// We can also put things into EWRAM if we want to.
|
||||||
#[link_section = ".ewram"]
|
#[link_section = ".ewram"]
|
||||||
static VALUE: GbaCell<u16> = GbaCell::new(0);
|
static VALUE: GbaCell<u16> = GbaCell::new(0);
|
||||||
|
|
||||||
extern "C" fn irq_handler(_: u16) {
|
extern "C" fn irq_handler(_: IrqBits) {
|
||||||
// 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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue