From 5ac6ebb1f743dfc42de334bc51963a7e299b7cfa Mon Sep 17 00:00:00 2001 From: Sp00ph <61327188+Sp00ph@users.noreply.github.com> Date: Mon, 25 Jan 2021 19:54:33 +0100 Subject: [PATCH] Add a `get_screen_block` function. This simplifies working with tiles as currently there is no easy way to manipulate single tiles using `SCREEN_BASE_BLOCKS` (#101) --- .gitignore | 3 +++ src/vram.rs | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ba7bc1f..b180dad 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ Cargo.lock # The crt0.o file should, under the currently suggested build scheme, be # recompiled every build anyway. crt0.o + +# Don't track VSCode Workspace settings +/.vscode \ No newline at end of file diff --git a/src/vram.rs b/src/vram.rs index a0efeb2..9ccd27d 100644 --- a/src/vram.rs +++ b/src/vram.rs @@ -15,7 +15,7 @@ pub(crate) use super::*; -use typenum::consts::{U256, U32, U512, U6}; +use typenum::{U1024, consts::{U256, U32, U512, U6}}; pub mod affine; pub mod bitmap; @@ -59,3 +59,7 @@ pub fn get_4bpp_character_block(slot: usize) -> VolBlock { pub fn get_8bpp_character_block(slot: usize) -> VolBlock { unsafe { VolBlock::new(CHAR_BASE_BLOCKS.index(slot).to_usize()) } } + +pub fn get_screen_block(slot: usize) -> VolBlock { + unsafe { VolBlock::new(SCREEN_BASE_BLOCKS.index(slot).to_usize()) } +} \ No newline at end of file