aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-20 11:37:34 +0200
committerBad Diode <bd@badd10de.dev>2023-04-20 11:37:34 +0200
commit773cd197a323d2f9b701addd63e30d54e43c74f5 (patch)
treea50a76dfd6111af296cddab1c407f1c4f1ae6128 /src/common.h
parent1d1e1123f8b76c40ba57427367f34b6f5c61de85 (diff)
downloaduxngba-773cd197a323d2f9b701addd63e30d54e43c74f5.tar.gz
uxngba-773cd197a323d2f9b701addd63e30d54e43c74f5.zip
Add optional DMA usage on flipbuf
This will copy an entire row of tiles instead of per tile copy, but for applications that clear the screen on each frame it will be more efficient.
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index e62c78c..1fbfa4c 100644
--- a/src/common.h
+++ b/src/common.h
@@ -419,12 +419,16 @@ dma_transfer_fill(void *dst, volatile u32 src, u32 count, int channel, u32 optio
419inline void 419inline void
420dma_copy(void *dst, const void *src, u32 size, int channel) { 420dma_copy(void *dst, const void *src, u32 size, int channel) {
421 dma_transfer_copy(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE); 421 dma_transfer_copy(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE);
422 // Stall for 2 cycles in case we call this function more than once.
423 asm("nop"); asm("nop");
422} 424}
423 425
424// Fill the dst location with the word set at src. 426// Fill the dst location with the word set at src.
425inline void 427inline void
426dma_fill(void *dst, vu32 src, u32 size, int channel) { 428dma_fill(void *dst, vu32 src, u32 size, int channel) {
427 dma_transfer_fill(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE); 429 dma_transfer_fill(dst, src, size / 4, channel, DMA_CHUNK_32 | DMA_ENABLE);
430 // Stall for 2 cycles in case we call this function more than once.
431 asm("nop"); asm("nop");
428} 432}
429 433
430// 434//