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)

This commit is contained in:
Sp00ph 2021-01-25 19:54:33 +01:00 committed by GitHub
parent 00897a0657
commit 5ac6ebb1f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View file

@ -12,3 +12,6 @@ Cargo.lock
# The crt0.o file should, under the currently suggested build scheme, be # The crt0.o file should, under the currently suggested build scheme, be
# recompiled every build anyway. # recompiled every build anyway.
crt0.o crt0.o
# Don't track VSCode Workspace settings
/.vscode

View file

@ -15,7 +15,7 @@
pub(crate) use super::*; pub(crate) use super::*;
use typenum::consts::{U256, U32, U512, U6}; use typenum::{U1024, consts::{U256, U32, U512, U6}};
pub mod affine; pub mod affine;
pub mod bitmap; pub mod bitmap;
@ -59,3 +59,7 @@ pub fn get_4bpp_character_block(slot: usize) -> VolBlock<Tile4bpp, U512> {
pub fn get_8bpp_character_block(slot: usize) -> VolBlock<Tile8bpp, U256> { pub fn get_8bpp_character_block(slot: usize) -> VolBlock<Tile8bpp, U256> {
unsafe { VolBlock::new(CHAR_BASE_BLOCKS.index(slot).to_usize()) } unsafe { VolBlock::new(CHAR_BASE_BLOCKS.index(slot).to_usize()) }
} }
pub fn get_screen_block(slot: usize) -> VolBlock<TextScreenblockEntry, U1024> {
unsafe { VolBlock::new(SCREEN_BASE_BLOCKS.index(slot).to_usize()) }
}