mirror of
https://github.com/italicsjenga/gba.git
synced 2024-12-23 19:01:30 +11:00
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:
parent
00897a0657
commit
5ac6ebb1f7
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -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
|
|
@ -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()) }
|
||||||
|
}
|
Loading…
Reference in a new issue