all repos — mgba @ 83e16d56c05f2e7714c29b52f50a8b943b027f27

mGBA Game Boy Advance Emulator

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
commit

83e16d56c05f2e7714c29b52f50a8b943b027f27

parent

a62a9322828103b9abb83ff06cd90e6789cb58c0

2 files changed, 6 insertions(+), 6 deletions(-)

jump to
M src/gba/gba-audio.csrc/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.hsrc/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;