GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio
Jeffrey Pfau jeffrey@endrift.com
Sat, 04 Apr 2015 22:07:46 -0700
2 files changed,
9 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -4,6 +4,7 @@ - GBA: Fix timers not updating timing when writing to only the reload register
- All: Fix sanitize-deb script not cleaning up after itself - Qt: Fix Display object leak when closing a window - Qt: Fix .deb dependencies + - GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio 0.2.0: (2015-04-03) Features:
M
src/gba/audio.c
→
src/gba/audio.c
@@ -514,11 +514,15 @@ } else {
GBALog(audio->p, GBA_LOG_ERROR, "Bad FIFO write to address 0x%03x", fifoId); return; } - if (CircleBufferSize(&channel->fifo) <= 4 * sizeof(int32_t)) { + if (CircleBufferSize(&channel->fifo) <= 4 * sizeof(int32_t) && channel->dmaSource > 0) { struct GBADMA* dma = &audio->p->memory.dma[channel->dmaSource]; - dma->nextCount = 4; - dma->nextEvent = 0; - GBAMemoryUpdateDMAs(audio->p, -cycles); + if (GBADMARegisterGetTiming(dma->reg) == DMA_TIMING_CUSTOM) { + dma->nextCount = 4; + dma->nextEvent = 0; + GBAMemoryUpdateDMAs(audio->p, -cycles); + } else { + channel->dmaSource = 0; + } } CircleBufferRead8(&channel->fifo, &channel->sample); }