From b5991d3ccc7a48ed19c9b828916dc85cdba258ec Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 29 Aug 2023 16:14:05 +0100 Subject: [PATCH] Copy all the tiles for a 256 colour map --- agb/src/display/tiled/map.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agb/src/display/tiled/map.rs b/agb/src/display/tiled/map.rs index 5023a3e9..367f111b 100644 --- a/agb/src/display/tiled/map.rs +++ b/agb/src/display/tiled/map.rs @@ -83,18 +83,18 @@ where fn commit(&mut self, vram: &mut VRamManager) { let screenblock_memory = self.screenblock_memory(); - let tile_count_divisor = self.colours().tile_size() / TileFormat::FourBpp.tile_size(); + if *self.tiles_dirty() { unsafe { dma_copy16( self.tiles_mut().as_ptr() as *const u16, screenblock_memory, - self.map_size().num_tiles() / tile_count_divisor, + self.map_size().num_tiles(), ); } } - let tile_colour_flag: u16 = (tile_count_divisor == 2).into(); + let tile_colour_flag: u16 = (self.colours() == TileFormat::EightBpp).into(); let new_bg_control_value = (self.priority() as u16) | ((self.screenblock() as u16) << 8)