Quick start of a background module

This commit is contained in:
Lokathor 2018-12-25 16:45:26 -07:00
parent ce3ddd3bb0
commit 89def7331b
2 changed files with 18 additions and 0 deletions

View file

@ -11,3 +11,4 @@ use super::*;
pub mod display;
pub mod dma;
pub mod keypad;
pub mod background;

17
src/io/background.rs Normal file
View file

@ -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<BackgroundControlSetting> = unsafe { VolAddress::new_unchecked(0x400_0008) };
}