2018-12-15 16:57:14 +11:00
|
|
|
#![no_std]
|
|
|
|
#![feature(start)]
|
2018-12-24 09:52:42 +11:00
|
|
|
#![forbid(unsafe_code)]
|
2018-12-15 16:57:14 +11:00
|
|
|
|
2018-12-24 09:52:42 +11:00
|
|
|
use gba::{
|
2018-12-26 17:19:16 +11:00
|
|
|
io::display::{DisplayControlSetting, DisplayMode, DISPCNT},
|
2018-12-27 17:13:10 +11:00
|
|
|
vram::bitmap::Mode3,
|
2018-12-24 09:52:42 +11:00
|
|
|
Color,
|
|
|
|
};
|
2018-12-15 16:57:14 +11:00
|
|
|
|
|
|
|
#[panic_handler]
|
|
|
|
fn panic(info: &core::panic::PanicInfo) -> ! {
|
2018-12-24 09:52:42 +11:00
|
|
|
use core::fmt::Write;
|
|
|
|
use gba::mgba::{MGBADebug, MGBADebugLevel};
|
2018-12-26 08:44:05 +11:00
|
|
|
|
2018-12-24 09:52:42 +11:00
|
|
|
if let Some(mut mgba) = MGBADebug::new() {
|
|
|
|
let _ = write!(mgba, "{}", info);
|
|
|
|
mgba.send(MGBADebugLevel::Fatal);
|
2018-12-15 16:57:14 +11:00
|
|
|
}
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[start]
|
|
|
|
fn main(_argc: isize, _argv: *const *const u8) -> isize {
|
2018-12-27 14:19:53 +11:00
|
|
|
const SETTING: DisplayControlSetting = DisplayControlSetting::new().with_mode(DisplayMode::Mode3).with_bg2(true);
|
2018-12-24 09:52:42 +11:00
|
|
|
DISPCNT.write(SETTING);
|
|
|
|
Mode3::write_pixel(120, 80, Color::from_rgb(31, 0, 0));
|
|
|
|
Mode3::write_pixel(136, 80, Color::from_rgb(0, 31, 0));
|
|
|
|
Mode3::write_pixel(120, 96, Color::from_rgb(0, 0, 31));
|
|
|
|
panic!("fumoffu!");
|
2018-12-15 16:57:14 +11:00
|
|
|
}
|