all repos — mgba @ 4a36c3766ba0acf5ca96998268f72004d4437343

mGBA Game Boy Advance Emulator

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
commit

4a36c3766ba0acf5ca96998268f72004d4437343

parent

d3a0ce00db07af2f1322c4014b79b221ff1b98c9

2 files changed, 9 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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); }