mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
added helpful functions
This commit is contained in:
parent
ad82fe291f
commit
d0808cb7f2
|
@ -12,7 +12,7 @@ const OBJECT_ATTRIBUTE_MEMORY: MemoryMapped1DArray<u16, 512> =
|
||||||
unsafe { MemoryMapped1DArray::new(0x0700_0000) };
|
unsafe { MemoryMapped1DArray::new(0x0700_0000) };
|
||||||
const PALETTE_SPRITE: MemoryMapped1DArray<u16, 256> =
|
const PALETTE_SPRITE: MemoryMapped1DArray<u16, 256> =
|
||||||
unsafe { MemoryMapped1DArray::new(0x0500_0200) };
|
unsafe { MemoryMapped1DArray::new(0x0500_0200) };
|
||||||
const TILE_SPRITE: MemoryMapped1DArray<u32, { 512 * 8 }> =
|
const TILE_SPRITE: MemoryMapped1DArray<u32, { 1024 * 8 }> =
|
||||||
unsafe { MemoryMapped1DArray::new(0x06010000) };
|
unsafe { MemoryMapped1DArray::new(0x06010000) };
|
||||||
|
|
||||||
/// Handles distributing objects and matricies along with operations that effect all objects.
|
/// Handles distributing objects and matricies along with operations that effect all objects.
|
||||||
|
@ -331,6 +331,12 @@ impl ObjectControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_sprite_tilemap_at_idx(&self, idx: usize, tiles: &[u32]) {
|
||||||
|
for (index, &tile) in tiles.iter().enumerate() {
|
||||||
|
self.set_sprite_tilemap_entry(index + idx, tile)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Enable objects on the GBA.
|
/// Enable objects on the GBA.
|
||||||
pub fn enable(&mut self) {
|
pub fn enable(&mut self) {
|
||||||
let disp = DISPLAY_CONTROL.get();
|
let disp = DISPLAY_CONTROL.get();
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct Palette16 {
|
pub struct Palette16 {
|
||||||
pub(crate) colours: [u16; 16],
|
pub(crate) colours: [u16; 16],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue