mirror of https://github.com/mgba-emu/mgba.git
GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio
This commit is contained in:
parent
d3a0ce00db
commit
4a36c3766b
1
CHANGES
1
CHANGES
|
@ -4,6 +4,7 @@ Bugfixes:
|
||||||
- All: Fix sanitize-deb script not cleaning up after itself
|
- All: Fix sanitize-deb script not cleaning up after itself
|
||||||
- Qt: Fix Display object leak when closing a window
|
- Qt: Fix Display object leak when closing a window
|
||||||
- Qt: Fix .deb dependencies
|
- Qt: Fix .deb dependencies
|
||||||
|
- GBA Audio: FIFOs should not poll DMAs that are not scheduled for audio
|
||||||
|
|
||||||
0.2.0: (2015-04-03)
|
0.2.0: (2015-04-03)
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -514,11 +514,15 @@ void GBAAudioSampleFIFO(struct GBAAudio* audio, int fifoId, int32_t cycles) {
|
||||||
GBALog(audio->p, GBA_LOG_ERROR, "Bad FIFO write to address 0x%03x", fifoId);
|
GBALog(audio->p, GBA_LOG_ERROR, "Bad FIFO write to address 0x%03x", fifoId);
|
||||||
return;
|
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];
|
struct GBADMA* dma = &audio->p->memory.dma[channel->dmaSource];
|
||||||
|
if (GBADMARegisterGetTiming(dma->reg) == DMA_TIMING_CUSTOM) {
|
||||||
dma->nextCount = 4;
|
dma->nextCount = 4;
|
||||||
dma->nextEvent = 0;
|
dma->nextEvent = 0;
|
||||||
GBAMemoryUpdateDMAs(audio->p, -cycles);
|
GBAMemoryUpdateDMAs(audio->p, -cycles);
|
||||||
|
} else {
|
||||||
|
channel->dmaSource = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CircleBufferRead8(&channel->fifo, &channel->sample);
|
CircleBufferRead8(&channel->fifo, &channel->sample);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue