Fix a case where deserializing the FIFO may not restore up to three bytes
Jeffrey Pfau jeffrey@endrift.com
Tue, 08 Jul 2014 21:56:03 -0700
2 files changed,
6 insertions(+),
6 deletions(-)
M
src/gba/gba-audio.c
→
src/gba/gba-audio.c
@@ -732,10 +732,10 @@ audio->nextCh4 = state->audio.ch4.nextEvent;
CircleBufferClear(&audio->chA.fifo); CircleBufferClear(&audio->chB.fifo); - unsigned i; - for (i = 0; i < state->audio.fifoSize / sizeof(uint32_t); ++i) { - CircleBufferWrite32(&audio->chA.fifo, state->audio.fifoA[i]); - CircleBufferWrite32(&audio->chB.fifo, state->audio.fifoB[i]); + int i; + for (i = 0; i < state->audio.fifoSize; ++i) { + CircleBufferWrite8(&audio->chA.fifo, state->audio.fifoA[i]); + CircleBufferWrite8(&audio->chB.fifo, state->audio.fifoB[i]); } audio->nextEvent = state->audio.nextEvent;
M
src/gba/gba-serialize.h
→
src/gba/gba-serialize.h
@@ -175,8 +175,8 @@ int32_t envelopeNextStep;
int32_t endTime; int32_t nextEvent; } ch4; - uint32_t fifoA[8]; - uint32_t fifoB[8]; + uint8_t fifoA[32]; + uint8_t fifoB[32]; int32_t nextEvent; int32_t eventDiff; int32_t nextSample;