From ec4e11b44aec6a711398b9ceac48768eab5abf7c Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sat, 10 Apr 2021 19:37:55 +0100 Subject: [PATCH] add an example to just test building --- examples/just_build.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/just_build.rs diff --git a/examples/just_build.rs b/examples/just_build.rs new file mode 100644 index 00000000..e1c1f7bb --- /dev/null +++ b/examples/just_build.rs @@ -0,0 +1,22 @@ +#![no_std] +#![no_main] + +#[panic_handler] +fn panic_handler(info: &core::panic::PanicInfo) -> ! { + loop {} +} + +// implementation of tonc's "My first GBA demo" +// https://coranac.com/tonc/text/first.htm + +#[no_mangle] +pub fn main() -> ! { + unsafe { + *(0x0400_0000 as *mut u32) = 0x0403; + let video = 0x0600_0000 as *mut u16; + *video.offset(120 + 80 * 240) = 0x001F; + *video.offset(136 + 80 * 240) = 0x001F; + *video.offset(120 + 96 * 240) = 0x001F; + } + loop {} +}