From cdd330f22d5e8e9f34e0ffe5d680323b94ba18b9 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Tue, 25 Dec 2018 14:47:26 -0700 Subject: [PATCH] start of tiled data types --- src/video/tiled.rs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/video/tiled.rs diff --git a/src/video/tiled.rs b/src/video/tiled.rs new file mode 100644 index 0000000..a2f5d1e --- /dev/null +++ b/src/video/tiled.rs @@ -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], +}