diff --git a/src/io.rs b/src/io.rs index b744a9b..86ab5b6 100644 --- a/src/io.rs +++ b/src/io.rs @@ -11,3 +11,4 @@ use super::*; pub mod display; pub mod dma; pub mod keypad; +pub mod background; diff --git a/src/io/background.rs b/src/io/background.rs new file mode 100644 index 0000000..926ce06 --- /dev/null +++ b/src/io/background.rs @@ -0,0 +1,17 @@ +//! Module for Background controls + +use super::*; + +newtype! { + BackgroundControlSetting, u16 +} +impl BackgroundControlSetting { + pub const fn from_screen_base_block(screen_base_block: u16) -> Self { + BackgroundControlSetting(screen_base_block << 8) // TODO: mask this for correctness + } +} + +pub struct BG0; +impl BG0 { + pub const BG0CNT: VolAddress = unsafe { VolAddress::new_unchecked(0x400_0008) }; +}