Fix a case where deserializing the FIFO may not restore up to three bytes

This commit is contained in:
Jeffrey Pfau 2014-07-08 21:56:03 -07:00
parent a62a932282
commit 83e16d56c0
2 changed files with 6 additions and 6 deletions

View File

@ -732,10 +732,10 @@ void GBAAudioDeserialize(struct GBAAudio* audio, const struct GBASerializedState
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;

View File

@ -175,8 +175,8 @@ struct GBASerializedState {
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;