Fix rewind buffer sizing itself wrong
Jeffrey Pfau jeffrey@endrift.com
Sun, 26 Jan 2014 12:47:47 -0800
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-serialize.c
→
src/gba/gba-serialize.c
@@ -119,7 +119,7 @@ thread->rewindBuffer[offset] = state;
} GBASerialize(thread->gba, state); thread->rewindBufferSize = thread->rewindBufferSize == thread->rewindBufferCapacity ? thread->rewindBufferCapacity : thread->rewindBufferSize + 1; - thread->rewindBufferWriteOffset = (offset + 1) % thread->rewindBufferSize; + thread->rewindBufferWriteOffset = (offset + 1) % thread->rewindBufferCapacity; } void GBARewind(struct GBAThread* thread, int nStates) {@@ -138,5 +138,6 @@ if (!state) {
return; } thread->rewindBufferSize -= nStates; + thread->rewindBufferWriteOffset = (offset + thread->rewindBufferCapacity - nStates) % thread->rewindBufferCapacity; GBADeserialize(thread->gba, state); }