test the test logo

This commit is contained in:
Corwin Kuiper 2021-06-04 10:30:25 +01:00
parent da7bdbe745
commit 12406fc952

View file

@ -1 +1,31 @@
include!(concat!(env!("OUT_DIR"), "/test_logo.rs")); include!(concat!(env!("OUT_DIR"), "/test_logo.rs"));
#[test_case]
fn logo_display(gba: &mut crate::Gba) {
let mut gfx = gba.display.video.tiled0();
gfx.set_background_palettes(PALETTE_DATA);
gfx.set_background_tilemap(0, TILE_DATA);
let mut back = gfx.get_background().unwrap();
let mut entries: [u16; 30 * 20] = [0; 30 * 20];
for tile_id in 0..(30 * 20) {
let palette_entry = PALETTE_ASSIGNMENT[tile_id as usize] as u16;
entries[tile_id as usize] = tile_id | (palette_entry << 12);
}
back.set_map(&entries, 30, 20);
back.set_position(0, 0);
back.show();
let vblank = gba.display.vblank.get();
vblank.wait_for_VBlank();
let mut mgba = crate::mgba::Mgba::new().unwrap();
mgba.print(
format_args!("image:gfx/test_logo.png"),
crate::mgba::DebugLevel::Info,
)
.unwrap();
vblank.wait_for_VBlank();
}