GBA: Fix rewind boundary conditions

This commit is contained in:
Jeffrey Pfau 2015-01-05 22:56:56 -08:00
parent 24fc26d560
commit 5c699e9d6c
1 changed files with 2 additions and 2 deletions

View File

@ -264,7 +264,7 @@ void GBARewind(struct GBAThread* thread, int nStates) {
if (!state) {
return;
}
thread->rewindBufferSize -= nStates;
thread->rewindBufferWriteOffset = (offset + thread->rewindBufferCapacity - nStates) % thread->rewindBufferCapacity;
thread->rewindBufferSize -= nStates - 1;
thread->rewindBufferWriteOffset = (offset + 1) % thread->rewindBufferCapacity;
GBADeserialize(thread->gba, state);
}