Better rewind speed (use a different amount of rewind pops rather than clock multiplier)
@@ -537,10 +537,12 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
if (_rewind) {
_rewind = false;
GB_rewind_pop(&_gb);
+ for (unsigned i = [[NSUserDefaults standardUserDefaults] integerForKey:@"GBRewindSpeed"]; i--;) {
if (!GB_rewind_pop(&_gb)) {
self.runMode = GBRunModeRewindPaused;
}
}
+ }
if (_runMode != GBRunModeRewindPaused) {
GB_run(&_gb);
}
@@ -709,24 +711,14 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
[_audioClient stop];
}
- switch (_runMode) {
- case GBRunModeNormal:
- case GBRunModeRewindPaused:
- GB_set_turbo_mode(&_gb, false, false);
- GB_set_clock_multiplier(&_gb, 1.0);
- break;
- case GBRunModeTurbo: {
+ if (_runMode == GBRunModeTurbo) {
double multiplier = [[NSUserDefaults standardUserDefaults] doubleForKey:@"GBTurboSpeed"];
GB_set_turbo_mode(&_gb, multiplier == 1, false);
GB_set_clock_multiplier(&_gb, multiplier);
- break;
}
- case GBRunModeRewind: {
- double multiplier = [[NSUserDefaults standardUserDefaults] doubleForKey:@"GBRewindSpeed"];
+ else {
GB_set_turbo_mode(&_gb, false, false);
- GB_set_clock_multiplier(&_gb, multiplier);
- break;
- }
+ GB_set_clock_multiplier(&_gb, 1.0);
}
}
