all repos — mgba @ 6fe17bc0f8526e3974f534be7d5489b393dc735f

mGBA Game Boy Advance Emulator

GBA Audio: Reset audio FIFO DMA if an invalid destination is set
Jeffrey Pfau jeffrey@endrift.com
Fri, 08 Jul 2016 21:35:22 -0700
commit

6fe17bc0f8526e3974f534be7d5489b393dc735f

parent

fcd1ce8073f89581346e6ccdc15d3d538cac1655

2 files changed, 7 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -30,6 +30,7 @@ - Util: Fix realloc semantics in utf16to8

- ARM7: Fix setting spsr privilege bits when spsr is empty - GBA BIOS: Fix ArcTan2 accuracy and boundary conditions - SDL: Fix sporadic crash when deinitializing audio + - GBA Audio: Reset audio FIFO DMA if an invalid destination is set Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M src/gba/audio.csrc/gba/audio.c

@@ -126,6 +126,12 @@ case BASE_IO | REG_FIFO_B_LO:

audio->chB.dmaSource = number; break; default: + if (audio->chA.dmaSource == number) { + audio->chA.dmaSource = -1; + } + if (audio->chB.dmaSource == number) { + audio->chB.dmaSource = -1; + } mLOG(GBA_AUDIO, GAME_ERROR, "Invalid FIFO destination: 0x%08X", info->dest); return; }