mirror of https://github.com/mgba-emu/mgba.git
Fix a case where deserializing the FIFO may not restore up to three bytes
This commit is contained in:
parent
a62a932282
commit
83e16d56c0
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue