diff --git a/iOS/GBSettingsViewController.m b/iOS/GBSettingsViewController.m index b7c8a54..ecd8982 100644 --- a/iOS/GBSettingsViewController.m +++ b/iOS/GBSettingsViewController.m @@ -130,6 +130,22 @@ static NSString const *typeLightTemp = @"typeLightTemp"; @{@"type": typeRadio, @"pref": @"GBRTCMode", @"title": @"Sync to System Clock", @"value": @(GB_RTC_MODE_SYNC_TO_HOST),}, ] }, + @{ + @"header": @"Turbo Speed", + @"items": @[ + @{@"type": typeRadio, @"pref": @"GBTurboSpeed", @"title": @"200%", @"value": @2,}, + @{@"type": typeRadio, @"pref": @"GBTurboSpeed", @"title": @"400%", @"value": @4,}, + @{@"type": typeRadio, @"pref": @"GBTurboSpeed", @"title": @"Uncapped", @"value": @1,}, + ] + }, + @{ + @"header": @"Rewind Speed", + @"items": @[ + @{@"type": typeRadio, @"pref": @"GBRewindSpeed", @"title": @"100%", @"value": @1,}, + @{@"type": typeRadio, @"pref": @"GBRewindSpeed", @"title": @"200%", @"value": @2,}, + @{@"type": typeRadio, @"pref": @"GBRewindSpeed", @"title": @"400%", @"value": @4,}, + ] + }, @{ @"header": @"Emulated Revisions", @"items": @[ diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m index 29bdba2..664a357 100644 --- a/iOS/GBViewController.m +++ b/iOS/GBViewController.m @@ -708,7 +708,26 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) if (_runMode == GBRunModeRewindPaused) { [_audioClient stop]; } - GB_set_turbo_mode(&_gb, runMode == GBRunModeTurbo, false); + + switch (_runMode) { + case GBRunModeNormal: + case GBRunModeRewindPaused: + GB_set_turbo_mode(&_gb, false, false); + GB_set_clock_multiplier(&_gb, 1.0); + break; + case 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"]; + GB_set_turbo_mode(&_gb, false, false); + GB_set_clock_multiplier(&_gb, multiplier); + break; + } + } } - (AVCaptureDevice *)captureDevice diff --git a/iOS/main.m b/iOS/main.m index d22dd8d..75c516d 100644 --- a/iOS/main.m +++ b/iOS/main.m @@ -19,6 +19,8 @@ int main(int argc, char * argv[]) @"GBSGBModel": @(GB_MODEL_SGB2), @"GBRumbleMode": @(GB_RUMBLE_CARTRIDGE_ONLY), @"GBButtonHaptics": @YES, + @"GBTurboSpeed": @1, + @"GBRewindSpeed": @1, @"GBCurrentTheme": @"Lime (Game Boy)", // Default themes