mirror of https://github.com/mgba-emu/mgba.git
GBA: GBARewind now returns how many states it has rewound
This commit is contained in:
parent
db30642645
commit
4c5cdcaa4e
1
CHANGES
1
CHANGES
|
@ -40,6 +40,7 @@ Misc:
|
|||
- Qt: Show version info in window title
|
||||
- All: Fix sanitize-deb script to set file permissions properly if run as (fake)root
|
||||
- GBA SIO: Add a dummy driver for Normal mode
|
||||
- GBA: GBARewind now returns how many states it has rewound
|
||||
|
||||
0.2.1: (2015-05-13)
|
||||
Bugfixes:
|
||||
|
|
|
@ -314,12 +314,12 @@ void GBARewindSettingsChanged(struct GBAThread* threadContext, int newCapacity,
|
|||
}
|
||||
}
|
||||
|
||||
void GBARewind(struct GBAThread* thread, int nStates) {
|
||||
int GBARewind(struct GBAThread* thread, int nStates) {
|
||||
if (nStates > thread->rewindBufferSize || nStates < 0) {
|
||||
nStates = thread->rewindBufferSize;
|
||||
}
|
||||
if (nStates == 0) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
int offset = thread->rewindBufferWriteOffset - nStates;
|
||||
if (offset < 0) {
|
||||
|
@ -327,7 +327,7 @@ void GBARewind(struct GBAThread* thread, int nStates) {
|
|||
}
|
||||
struct GBASerializedState* state = thread->rewindBuffer[offset];
|
||||
if (!state) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
thread->rewindBufferSize -= nStates;
|
||||
thread->rewindBufferWriteOffset = offset;
|
||||
|
@ -335,6 +335,7 @@ void GBARewind(struct GBAThread* thread, int nStates) {
|
|||
if (thread->rewindScreenBuffer) {
|
||||
thread->gba->video.renderer->putPixels(thread->gba->video.renderer, VIDEO_HORIZONTAL_PIXELS, &thread->rewindScreenBuffer[offset * VIDEO_HORIZONTAL_PIXELS * VIDEO_VERTICAL_PIXELS * BYTES_PER_PIXEL]);
|
||||
}
|
||||
return nStates;
|
||||
}
|
||||
|
||||
void GBARewindAll(struct GBAThread* thread) {
|
||||
|
|
|
@ -335,7 +335,7 @@ void GBADeallocateState(struct GBASerializedState* state);
|
|||
|
||||
void GBARecordFrame(struct GBAThread* thread);
|
||||
void GBARewindSettingsChanged(struct GBAThread* thread, int newCapacity, int newInterval);
|
||||
void GBARewind(struct GBAThread* thread, int nStates);
|
||||
int GBARewind(struct GBAThread* thread, int nStates);
|
||||
void GBARewindAll(struct GBAThread* thread);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue