mirror of https://github.com/LIJI32/SameBoy.git
Fix a bug where controller-triggered rewind doesn't resume after reaching the buffer end
This commit is contained in:
parent
8cce6f7b13
commit
08d58aa992
|
@ -723,7 +723,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
|||
[_backgroundView fadeOverlayOut];
|
||||
}
|
||||
else {
|
||||
if (self.runMode == GBRunModeRewind && _runModeFromController) {
|
||||
if ((self.runMode == GBRunModeRewind || self.runMode == GBRunModePaused) && _runModeFromController) {
|
||||
[self setRunMode:GBRunModeNormal];
|
||||
_runModeFromController = false;
|
||||
}
|
||||
|
@ -1354,14 +1354,22 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
|||
GB_rewind_pop(&_gb);
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GBDynamicSpeed"]) {
|
||||
if (!GB_rewind_pop(&_gb)) {
|
||||
self.runMode = GBRunModePaused;
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
if (_runMode == GBRunModeRewind) {
|
||||
self.runMode = GBRunModePaused;
|
||||
}
|
||||
});
|
||||
_rewindOver = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (unsigned i = [[NSUserDefaults standardUserDefaults] integerForKey:@"GBRewindSpeed"]; i--;) {
|
||||
if (!GB_rewind_pop(&_gb)) {
|
||||
self.runMode = GBRunModePaused;
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
if (_runMode == GBRunModeRewind) {
|
||||
self.runMode = GBRunModePaused;
|
||||
}
|
||||
});
|
||||
_rewindOver = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue