mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Rename dma_copy to dma_copy16
This commit is contained in:
parent
056a38703d
commit
ea3d3d4936
|
@ -578,7 +578,7 @@ impl SpriteController {
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
dma::dma_copy(
|
dma::dma_copy16(
|
||||||
sprite.data.as_ptr().cast(),
|
sprite.data.as_ptr().cast(),
|
||||||
dest.as_ptr().cast(),
|
dest.as_ptr().cast(),
|
||||||
sprite.data.len() / 2,
|
sprite.data.len() / 2,
|
||||||
|
@ -614,7 +614,7 @@ impl SpriteControllerInner {
|
||||||
let dest = unsafe { PALETTE_ALLOCATOR.alloc(Palette16::layout())? };
|
let dest = unsafe { PALETTE_ALLOCATOR.alloc(Palette16::layout())? };
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
dma::dma_copy(
|
dma::dma_copy16(
|
||||||
palette.colours.as_ptr().cast(),
|
palette.colours.as_ptr().cast(),
|
||||||
dest.as_ptr().cast(),
|
dest.as_ptr().cast(),
|
||||||
palette.colours.len(),
|
palette.colours.len(),
|
||||||
|
|
|
@ -3,7 +3,7 @@ use core::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
use crate::bitarray::Bitarray;
|
use crate::bitarray::Bitarray;
|
||||||
use crate::display::{Priority, DISPLAY_CONTROL};
|
use crate::display::{Priority, DISPLAY_CONTROL};
|
||||||
use crate::dma::dma_copy;
|
use crate::dma::dma_copy16;
|
||||||
use crate::fixnum::Vector2D;
|
use crate::fixnum::Vector2D;
|
||||||
use crate::memory_mapped::MemoryMapped;
|
use crate::memory_mapped::MemoryMapped;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ impl RegularMap {
|
||||||
let screenblock_memory = self.screenblock_memory();
|
let screenblock_memory = self.screenblock_memory();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
dma_copy(
|
dma_copy16(
|
||||||
self.tiles.as_ptr() as *const u16,
|
self.tiles.as_ptr() as *const u16,
|
||||||
screenblock_memory,
|
screenblock_memory,
|
||||||
32 * 32,
|
32 * 32,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use alloc::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_copy,
|
dma::dma_copy16,
|
||||||
memory_mapped::MemoryMapped1DArray,
|
memory_mapped::MemoryMapped1DArray,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ impl<'a> VRamManager<'a> {
|
||||||
let tile_size_in_half_words = TileFormat::FourBpp.tile_size() / 2;
|
let tile_size_in_half_words = TileFormat::FourBpp.tile_size() / 2;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
dma_copy(
|
dma_copy16(
|
||||||
tile_slice.as_ptr() as *const u16,
|
tile_slice.as_ptr() as *const u16,
|
||||||
new_reference.as_ptr() as *mut u16,
|
new_reference.as_ptr() as *mut u16,
|
||||||
tile_size_in_half_words,
|
tile_size_in_half_words,
|
||||||
|
|
|
@ -16,7 +16,7 @@ const DMA3_SOURCE_ADDR: MemoryMapped<u32> = unsafe { MemoryMapped::new(dma_sourc
|
||||||
const DMA3_DEST_ADDR: MemoryMapped<u32> = unsafe { MemoryMapped::new(dma_dest_addr(3)) };
|
const DMA3_DEST_ADDR: MemoryMapped<u32> = unsafe { MemoryMapped::new(dma_dest_addr(3)) };
|
||||||
const DMA3_CONTROL: MemoryMapped<u32> = unsafe { MemoryMapped::new(dma_control_addr(3)) };
|
const DMA3_CONTROL: MemoryMapped<u32> = unsafe { MemoryMapped::new(dma_control_addr(3)) };
|
||||||
|
|
||||||
pub(crate) unsafe fn dma_copy(src: *const u16, dest: *mut u16, count: usize) {
|
pub(crate) unsafe fn dma_copy16(src: *const u16, dest: *mut u16, count: usize) {
|
||||||
assert!(count < u16::MAX as usize);
|
assert!(count < u16::MAX as usize);
|
||||||
|
|
||||||
DMA3_SOURCE_ADDR.set(src as u32);
|
DMA3_SOURCE_ADDR.set(src as u32);
|
||||||
|
|
Loading…
Reference in a new issue