LD53/src/lib.rs

37 lines
631 B
Rust

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