mirror of
https://github.com/italicsjenga/gba.git
synced 2025-01-11 11:31:31 +11:00
start of tiled data types
This commit is contained in:
parent
cf19303a40
commit
cdd330f22d
41
src/video/tiled.rs
Normal file
41
src/video/tiled.rs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
//! Module for tiled mode types and operations.
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// An 8x8 tile with 4bpp
|
||||||
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct Tile4bpp {
|
||||||
|
pub data: [u32; 8],
|
||||||
|
}
|
||||||
|
|
||||||
|
/// An 8x8 tile with 8bpp
|
||||||
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct Tile8bpp {
|
||||||
|
pub data: [u32; 16],
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A charblock of 4bpp tiles
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct Charblock4bpp {
|
||||||
|
pub data: [Tile4bpp; 512],
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A charblock of 8bpp tiles
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct Charblock8bpp {
|
||||||
|
pub data: [Tile8bpp; 256],
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct TextScreenblockEntry(u16);
|
||||||
|
|
||||||
|
#[derive(Clone, Copy)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct TextScreenblock {
|
||||||
|
pub data: [TextScreenblockEntry; 32 * 32],
|
||||||
|
}
|
Loading…
Reference in a new issue