diff options
author | Arisotura <thetotalworm@gmail.com> | 2021-11-25 16:49:43 +0100 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2021-11-25 16:49:43 +0100 |
commit | 44757a8323284b82ae68b7d6d28ac6f979909068 (patch) | |
tree | 07a983fd7ca547d933cd4f76fe8163b1ff4c5b85 /src | |
parent | c04e43702cb516d87ee88b4d77dc1e1946c8185b (diff) |
SPU: block reads from ARM7 BIOS region. fixes #1267 (and prolly whatever other stupid game tries to play sound from NULL)
Diffstat (limited to 'src')
-rw-r--r-- | src/NDS.cpp | 2 | ||||
-rw-r--r-- | src/SPU.cpp | 24 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/NDS.cpp b/src/NDS.cpp index b3e4d2c..e809313 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -2516,7 +2516,7 @@ u32 ARM7Read32(u32 addr) (GBACart::SRAMRead(addr+3) << 24); } - printf("unknown arm7 read32 %08X | %08X\n", addr, ARM7->R[15]); + //printf("unknown arm7 read32 %08X | %08X\n", addr, ARM7->R[15]); return 0; } diff --git a/src/SPU.cpp b/src/SPU.cpp index 8ae437e..1de6a26 100644 --- a/src/SPU.cpp +++ b/src/SPU.cpp @@ -285,12 +285,26 @@ void Channel::FIFO_BufferData() if ((FIFOReadOffset + 16) > totallen) burstlen = totallen - FIFOReadOffset; - for (u32 i = 0; i < burstlen; i += 4) + // sound DMA can't read from the ARM7 BIOS + if ((SrcAddr + FIFOReadOffset) >= 0x00004000) { - FIFO[FIFOWritePos] = BusRead32(SrcAddr + FIFOReadOffset); - FIFOReadOffset += 4; - FIFOWritePos++; - FIFOWritePos &= 0x7; + for (u32 i = 0; i < burstlen; i += 4) + { + FIFO[FIFOWritePos] = BusRead32(SrcAddr + FIFOReadOffset); + FIFOReadOffset += 4; + FIFOWritePos++; + FIFOWritePos &= 0x7; + } + } + else + { + for (u32 i = 0; i < burstlen; i += 4) + { + FIFO[FIFOWritePos] = 0; + FIFOReadOffset += 4; + FIFOWritePos++; + FIFOWritePos &= 0x7; + } } FIFOLevel += burstlen; |