starting to add object interface

This commit is contained in:
Corwin Kuiper 2021-03-12 11:40:01 +00:00 committed by Corwin
parent 1ba130f3bf
commit 0bd99e71bd
3 changed files with 17 additions and 1 deletions

View file

@ -6,6 +6,7 @@ use video::Video;
pub mod bitmap3;
pub mod bitmap4;
pub mod object;
pub mod tiled0;
pub mod vblank;
pub mod video;

12
src/display/object.rs Normal file
View file

@ -0,0 +1,12 @@
#[non_exhaustive]
pub struct Object {}
impl Object {
pub(crate) fn new() -> Self {
Object {}
}
pub fn enable(&mut self) {}
pub fn disable(&mut self) {}
}

View file

@ -3,7 +3,8 @@ use core::convert::TryInto;
use crate::memory_mapped::MemoryMapped1DArray;
use super::{
set_graphics_mode, set_graphics_settings, DisplayMode, GraphicsSettings, DISPLAY_CONTROL,
object::Object, set_graphics_mode, set_graphics_settings, DisplayMode, GraphicsSettings,
DISPLAY_CONTROL,
};
const PALETTE_BACKGROUND: MemoryMapped1DArray<u16, 256> =
@ -101,6 +102,7 @@ pub struct Tiled0 {
pub background_1: Background,
pub background_2: Background,
pub background_3: Background,
pub object: Object,
}
impl Tiled0 {
@ -112,6 +114,7 @@ impl Tiled0 {
background_1: Background { layer: 1 },
background_2: Background { layer: 2 },
background_3: Background { layer: 3 },
object: Object::new(),
}
}