LD53/src/lib.rs

31 lines
542 B
Rust

#[cfg(feature = "buddy-alloc")]
mod alloc;
mod wasm4;
use wasm4::*;
#[rustfmt::skip]
const SMILEY: [u8; 8] = [
0b11000011,
0b10000001,
0b00100100,
0b00100100,
0b00000000,
0b00100100,
0b10011001,
0b11000011,
];
#[no_mangle]
fn update() {
unsafe { *DRAW_COLORS = 2 }
text("Hello from Rust!", 10, 10);
let gamepad = unsafe { *GAMEPAD1 };
if gamepad & BUTTON_1 != 0 {
unsafe { *DRAW_COLORS = 4 }
}
blit(&SMILEY, 76, 76, 8, 8, BLIT_1BPP);
text("Press X to blink", 16, 90);
}