mirror of
https://github.com/italicsjenga/gba.git
synced 2025-01-11 11:31:31 +11:00
Quick start of a background module
This commit is contained in:
parent
ce3ddd3bb0
commit
89def7331b
|
@ -11,3 +11,4 @@ use super::*;
|
||||||
pub mod display;
|
pub mod display;
|
||||||
pub mod dma;
|
pub mod dma;
|
||||||
pub mod keypad;
|
pub mod keypad;
|
||||||
|
pub mod background;
|
||||||
|
|
17
src/io/background.rs
Normal file
17
src/io/background.rs
Normal 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) };
|
||||||
|
}
|
Loading…
Reference in a new issue