all repos — mgba @ 5c699e9d6cbfbcd5768a876a8fdbb42f6cfaf9d6

mGBA Game Boy Advance Emulator

GBA: Fix rewind boundary conditions
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Jan 2015 22:56:56 -0800
commit

5c699e9d6cbfbcd5768a876a8fdbb42f6cfaf9d6

parent

24fc26d56085694a01cc27c35183663394c64f76

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/gba/gba-serialize.csrc/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); }