GBA: Fix rewind boundary conditions
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Jan 2015 22:56:56 -0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/gba/gba-serialize.c
→
src/gba/gba-serialize.c
@@ -264,7 +264,7 @@ struct GBASerializedState* state = thread->rewindBuffer[offset];
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); }