aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2022-04-10 02:15:49 +0200
committerArisotura <thetotalworm@gmail.com>2022-04-10 02:15:49 +0200
commitb572d8cd70cebf5a4866ff1d985c95e116f0d035 (patch)
tree268c25bcb0c0139b8d02687003ec47754de5dfba /src
parent0feed13cc4bb9538f921d2c7ccb3aefb7fe0ef51 (diff)
add support for GXFIFO NDMA
Diffstat (limited to 'src')
-rw-r--r--src/DSi_NDMA.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/DSi_NDMA.cpp b/src/DSi_NDMA.cpp
index 4f404c2..3c61e67 100644
--- a/src/DSi_NDMA.cpp
+++ b/src/DSi_NDMA.cpp
@@ -123,10 +123,17 @@ void DSi_NDMA::WriteCnt(u32 val)
if ((StartMode & 0x1F) == 0x10)
Start();
+ else if (StartMode == 0x0A)
+ GPU3D::CheckFIFODMA();
- if (StartMode != 0x10 && StartMode != 0x30 &&
- StartMode != 0x04 && StartMode != 0x06 && StartMode != 0x07 && StartMode != 0x08 && StartMode != 0x09 && StartMode != 0x0B &&
- StartMode != 0x24 && StartMode != 0x26 && StartMode != 0x28 && StartMode != 0x29 && StartMode != 0x2A && StartMode != 0x2B)
+ // TODO: unsupported start modes:
+ // * timers (00-03)
+ // * camera (ARM9 0B)
+ // * microphone (ARM7 0C)
+ // * NDS-wifi?? (ARM7 07, likely not working)
+
+ if (StartMode <= 0x03 || StartMode == 0x05 || (StartMode >= 0x0B && StartMode <= 0x0F) ||
+ (StartMode >= 0x20 && StartMode <= 0x23) || StartMode == 0x25 || StartMode == 0x27 || (StartMode >= 0x2C && StartMode <= 0x2F))
printf("UNIMPLEMENTED ARM%d NDMA%d START MODE %02X, %08X->%08X LEN=%d BLK=%d CNT=%08X\n",
CPU?7:9, Num, StartMode, SrcAddr, DstAddr, TotalLength, BlockLength, Cnt);
}
@@ -143,8 +150,12 @@ void DSi_NDMA::Start()
RemCount = 0x1000000;
}
- // TODO: how does GXFIFO DMA work with all the block shito?
- IterCount = RemCount;
+ // CHECKME: this is assumed to work the same as the old DMA version
+ // also not really certain how this interacts with the block subdivision system here
+ if (StartMode == 0x0A && RemCount > 112)
+ IterCount = 112;
+ else
+ IterCount = RemCount;
if (((StartMode & 0x1F) != 0x10) && !(Cnt & (1<<29)))
{