Write audio FIFO in discrete chunks to avoid ordering issues
Jeffrey Pfau jeffrey@endrift.com
Tue, 07 Oct 2014 01:54:02 -0700
1 files changed,
6 insertions(+),
3 deletions(-)
jump to
M
src/gba/gba-audio.c
→
src/gba/gba-audio.c
@@ -437,9 +437,12 @@ default:
GBALog(audio->p, GBA_LOG_ERROR, "Bad FIFO write to address 0x%03x", address); return; } - while (!CircleBufferWrite32(fifo, value)) { - int32_t dummy; - CircleBufferRead32(fifo, &dummy); + int i; + for (i = 0; i < 4; ++i) { + while (!CircleBufferWrite8(fifo, value >> (8 * i))) { + int8_t dummy; + CircleBufferRead8(fifo, &dummy); + } } }