all repos — mgba @ 2a9a738bfb76d540f39d8145d014170d8b095f52

mGBA Game Boy Advance Emulator

GBA: Fix rewind boundary conditions
Jeffrey Pfau jeffrey@endrift.com
Sun, 12 Apr 2015 20:19:02 -0700
commit

2a9a738bfb76d540f39d8145d014170d8b095f52

parent

470538d4db412c84261b477e02413c04c6be322b

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -17,6 +17,7 @@ - GBA Audio: Force audio FIFOs to 32-bit

- GBA Memory: Ensure changing the timing of a DMA reschedules it - Qt: Fix window not regaining focus after exiting savestate window - Qt: Fix regression where video would not record if the game had already started + - GBA: Fix rewind boundary conditions Misc: - Qt: Show multiplayer numbers in window title
M src/gba/serialize.csrc/gba/serialize.c

@@ -291,14 +291,14 @@ return;

} int offset = thread->rewindBufferWriteOffset - nStates; if (offset < 0) { - offset += thread->rewindBufferSize; + offset += thread->rewindBufferCapacity; } struct GBASerializedState* state = thread->rewindBuffer[offset]; if (!state) { return; } - thread->rewindBufferSize -= nStates - 1; - thread->rewindBufferWriteOffset = (offset + 1) % thread->rewindBufferCapacity; + thread->rewindBufferSize -= nStates; + thread->rewindBufferWriteOffset = offset; GBADeserialize(thread->gba, state); }