Don't use DMA outside of the eeprom case

This commit is contained in:
Gwilym Inzani 2023-09-30 15:38:56 +01:00
parent eaf5a83076
commit 43718773d7
2 changed files with 4 additions and 5 deletions

View file

@ -5,7 +5,6 @@ use crate::bitarray::Bitarray;
use crate::display::affine::AffineMatrixBackground; use crate::display::affine::AffineMatrixBackground;
use crate::display::tile_data::TileData; use crate::display::tile_data::TileData;
use crate::display::{Priority, DISPLAY_CONTROL}; use crate::display::{Priority, DISPLAY_CONTROL};
use crate::dma::dma_copy16;
use crate::fixnum::Vector2D; use crate::fixnum::Vector2D;
use crate::memory_mapped::MemoryMapped; use crate::memory_mapped::MemoryMapped;
@ -93,9 +92,8 @@ where
if *self.tiles_dirty() { if *self.tiles_dirty() {
unsafe { unsafe {
dma_copy16( screenblock_memory.copy_from(
self.tiles_mut().as_ptr() as *const u16, self.tiles_mut().as_ptr() as *const u16,
screenblock_memory,
self.map_size().num_tiles(), self.map_size().num_tiles(),
); );
} }

View file

@ -5,7 +5,6 @@ use alloc::{slice, vec::Vec};
use crate::{ use crate::{
agb_alloc::{block_allocator::BlockAllocator, bump_allocator::StartEnd}, agb_alloc::{block_allocator::BlockAllocator, bump_allocator::StartEnd},
display::palette16, display::palette16,
dma::dma_copy16,
hash_map::{Entry, HashMap}, hash_map::{Entry, HashMap},
memory_mapped::MemoryMapped1DArray, memory_mapped::MemoryMapped1DArray,
}; };
@ -413,7 +412,9 @@ impl VRamManager {
/// Copies raw palettes to the background palette without any checks. /// Copies raw palettes to the background palette without any checks.
pub fn set_background_palette_raw(&mut self, palette: &[u16]) { pub fn set_background_palette_raw(&mut self, palette: &[u16]) {
unsafe { unsafe {
dma_copy16(palette.as_ptr(), PALETTE_BACKGROUND.as_ptr(), palette.len()); PALETTE_BACKGROUND
.as_ptr()
.copy_from_nonoverlapping(palette.as_ptr(), palette.len());
} }
} }