Fix set_background_palette (not sure why dma wasn't working)

This commit is contained in:
Gwilym Kuiper 2022-04-23 23:26:47 +01:00
parent 178db91072
commit 563138937e

View file

@ -348,12 +348,8 @@ impl VRamManager {
}
fn set_background_palette(&mut self, pal_index: u8, palette: &palette16::Palette16) {
unsafe {
dma_copy16(
palette.colours.as_ptr(),
PALETTE_BACKGROUND.as_ptr().add(16 * pal_index as usize),
palette.colours.len(),
);
for (colour_index, &colour) in palette.colours.iter().enumerate() {
PALETTE_BACKGROUND.set(colour_index + 16 * pal_index as usize, colour);
}
}