summaryrefslogtreecommitdiff
path: root/arm9/lib/NitroSDK/src/MI_dma_card.c
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2021-07-23 01:11:15 +0100
committerred031000 <rubenru09@aol.com>2021-07-23 01:12:27 +0100
commit5bf13c7f48fe91c7902ce50250bc1a5a2398a2ae (patch)
tree2e91e60bdb7a9174b16d8ca1b532809d4ae2e5b6 /arm9/lib/NitroSDK/src/MI_dma_card.c
parentc2d91a2d997afd01fa4f40e1e16d5ee85557c9a8 (diff)
separate out libs to libc, libnns and NitroSDK
Diffstat (limited to 'arm9/lib/NitroSDK/src/MI_dma_card.c')
-rw-r--r--arm9/lib/NitroSDK/src/MI_dma_card.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arm9/lib/NitroSDK/src/MI_dma_card.c b/arm9/lib/NitroSDK/src/MI_dma_card.c
new file mode 100644
index 00000000..c3b8b897
--- /dev/null
+++ b/arm9/lib/NitroSDK/src/MI_dma_card.c
@@ -0,0 +1,24 @@
+#include "MI_dma_card.h"
+#include "MI_dma.h"
+#include "function_target.h"
+
+ARM_FUNC void MIi_CardDmaCopy32(u32 dmaNo, const void *src, void *dest, u32 size)
+{
+ MIi_CheckAnotherAutoDMA(dmaNo, MIi_DMA_TIMING_ANY);
+ MIi_CheckDma0SourceAddress(dmaNo, (u32)src, size, MI_DMA_SRC_FIX);
+
+ if (size == 0)
+ {
+ return;
+ }
+
+ vu32 *dmaCntp;
+
+ do
+ {
+ dmaCntp = &((vu32 *)REG_ADDR_DMA0SAD)[dmaNo * 3 + 2];
+ while (*dmaCntp & 0x80000000) {}
+ } while(0);
+
+ MIi_DmaSetParams(dmaNo, (u32)src, (u32)dest, (u32)(0xaf000001));
+}