From 5bf78f6274bddda24ca8f4605eba87808f0b64c4 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sun, 13 Mar 2022 19:53:55 +0000 Subject: [PATCH] Also for raw copy --- agb/src/display/tiled/vram_manager.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agb/src/display/tiled/vram_manager.rs b/agb/src/display/tiled/vram_manager.rs index 5c99f89f..7a3c31c7 100644 --- a/agb/src/display/tiled/vram_manager.rs +++ b/agb/src/display/tiled/vram_manager.rs @@ -260,8 +260,8 @@ impl<'a> VRamManager<'a> { /// Copies raw palettes to the background palette without any checks. pub fn set_background_palette_raw(&mut self, palette: &[u16]) { - for (index, &colour) in palette.iter().enumerate() { - PALETTE_BACKGROUND.set(index, colour); + unsafe { + dma_copy16(palette.as_ptr(), PALETTE_BACKGROUND.as_ptr(), palette.len()); } }