diff --git a/src/common/ConfigManager.cpp b/src/common/ConfigManager.cpp index 1331328e..9ad2cae9 100644 --- a/src/common/ConfigManager.cpp +++ b/src/common/ConfigManager.cpp @@ -257,9 +257,9 @@ uint32_t autoFrameSkipLastTime; uint32_t movieLastJoypad; uint32_t movieNextJoypad; uint32_t throttle = 100; -uint32_t speedup_throttle = 0; +uint32_t speedup_throttle = 100; uint32_t speedup_frame_skip = 9; -bool speedup_throttle_frame_skip = true; +bool speedup_throttle_frame_skip = false; const char* preparedCheatCodes[MAX_CHEATS]; @@ -557,9 +557,9 @@ void LoadConfig() soundRecordDir = ReadPrefString("soundRecordDir"); threadPriority = ReadPref("priority", 2); throttle = ReadPref("throttle", 100); - speedup_throttle = ReadPref("speedupThrottle", 0); + speedup_throttle = ReadPref("speedupThrottle", 100); speedup_frame_skip = ReadPref("speedupFrameSkip", 9); - speedup_throttle_frame_skip = ReadPref("speedupThrottleFrameSkip", 1); + speedup_throttle_frame_skip = ReadPref("speedupThrottleFrameSkip", 0); tripleBuffering = ReadPref("tripleBuffering", 0); useBios = ReadPrefHex("useBiosGBA"); useBiosFileGB = ReadPref("useBiosGB", 0); diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index 5527c039..e4a476e8 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -4951,26 +4951,21 @@ void gbEmulate(int ticksToStop) static uint32_t last_throttle; if (turbo_button_pressed) { - if (!speedup_throttle_set && throttle != speedup_throttle) { - last_throttle = throttle; - soundSetThrottle(speedup_throttle); - speedup_throttle_set = true; - } - - if (speedup_throttle_set) { - if (speedup_throttle_frame_skip) { - if (speedup_throttle == 0) - framesToSkip += speedup_frame_skip; - else if (speedup_throttle > 100) - framesToSkip += std::ceil(double(speedup_throttle) / 100.0) - 1; - } - } - else + if (speedup_frame_skip) framesToSkip = speedup_frame_skip; + else { + if (!speedup_throttle_set && throttle != speedup_throttle) { + last_throttle = throttle; + soundSetThrottle(speedup_throttle); + speedup_throttle_set = true; + } + + if (speedup_throttle_frame_skip) + framesToSkip += std::ceil(double(speedup_throttle) / 100.0) - 1; + } } else if (speedup_throttle_set) { soundSetThrottle(last_throttle); - speedup_throttle_set = false; } #else diff --git a/src/gba/GBA.cpp b/src/gba/GBA.cpp index b311316b..d82a5508 100644 --- a/src/gba/GBA.cpp +++ b/src/gba/GBA.cpp @@ -3798,26 +3798,21 @@ void CPULoop(int ticks) static uint32_t last_throttle; if (turbo_button_pressed) { - if (!speedup_throttle_set && throttle != speedup_throttle) { - last_throttle = throttle; - soundSetThrottle(speedup_throttle); - speedup_throttle_set = true; - } - - if (speedup_throttle_set) { - if (speedup_throttle_frame_skip) { - if (speedup_throttle == 0) - framesToSkip += speedup_frame_skip; - else if (speedup_throttle > 100) - framesToSkip += std::ceil(double(speedup_throttle) / 100.0) - 1; - } - } - else + if (speedup_frame_skip) framesToSkip = speedup_frame_skip; + else { + if (!speedup_throttle_set && throttle != speedup_throttle) { + last_throttle = throttle; + soundSetThrottle(speedup_throttle); + speedup_throttle_set = true; + } + + if (speedup_throttle_frame_skip) + framesToSkip += std::ceil(double(speedup_throttle) / 100.0) - 1; + } } else if (speedup_throttle_set) { soundSetThrottle(last_throttle); - speedup_throttle_set = false; } #else diff --git a/src/wx/dsound.cpp b/src/wx/dsound.cpp index 799d8787..e5da9f59 100644 --- a/src/wx/dsound.cpp +++ b/src/wx/dsound.cpp @@ -194,8 +194,8 @@ bool DirectSound::init(long sampleRate) void DirectSound::setThrottle(unsigned short throttle_) { HRESULT hr; - if (!throttle_) - throttle_ = 100; + if (throttle_ == 0) + throttle_ = 450; // Close to upper bound on frequency. long freq = soundGetSampleRate(); diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 2677be6b..40833556 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -2333,7 +2333,7 @@ public: void DoSetThrottleSel(uint32_t val) { - if (val <= 600) + if (val <= 450) thrsel->SetSelection(std::round((double)val / 25)); else thrsel->SetSelection(100 / 25); @@ -2345,7 +2345,7 @@ public: (void)evt; // unused params uint32_t val = thrsel->GetSelection() * 25; - if (val <= 600) + if (val <= 450) thr->SetValue(val); else thr->SetValue(100); @@ -2374,24 +2374,26 @@ public: evt.Skip(false); if (val == 0) { - speedup_throttle = 0; - speedup_frame_skip = 0; - + speedup_throttle = 0; + speedup_frame_skip = 0; speedup_throttle_frame_skip = false; + frame_skip_cb->SetValue(false); frame_skip_cb->Disable(); if (evt.GetEventType() == wxEVT_TEXT) return; // Do not update value if user cleared text box. } - else if (val <= 600) { - speedup_throttle = val; + else if (val <= 450) { + speedup_throttle = val; + speedup_frame_skip = 0; frame_skip_cb->SetValue(prev_frame_skip_cb); frame_skip_cb->Enable(); } - else { // val > 600 - speedup_throttle = 0; + else { // val > 450 + speedup_throttle = 100; + speedup_throttle_frame_skip = false; unsigned rounded = std::round((double)val / 100) * 100; @@ -2405,7 +2407,6 @@ public: else if ((int)(val - rounded) < 0) speedup_frame_skip--; - speedup_throttle_frame_skip = true; frame_skip_cb->SetValue(true); frame_skip_cb->Disable(); @@ -2426,26 +2427,25 @@ public: void Init(wxShowEvent& ev) { - uint32_t val = 0; - - if (speedup_throttle != 0) - val = speedup_throttle; - else if (speedup_frame_skip != 0) - val = (speedup_frame_skip + 1) * 100; - - speedup_throttle_spin->SetValue(val); - - frame_skip_cb->SetValue(speedup_throttle_frame_skip); - - prev_frame_skip_cb = frame_skip_cb->GetValue(); - - if (val > 600 || val == 0) + if (speedup_frame_skip != 0) { + speedup_throttle_spin->SetValue((speedup_frame_skip + 1) * 100); + frame_skip_cb->SetValue(true); frame_skip_cb->Disable(); + } + else { + speedup_throttle_spin->SetValue(speedup_throttle); + frame_skip_cb->SetValue(speedup_throttle_frame_skip); + + if (speedup_throttle != 0) + frame_skip_cb->Enable(); + else + frame_skip_cb->Disable(); + } ev.Skip(); } private: - bool prev_frame_skip_cb = true; + bool prev_frame_skip_cb = speedup_throttle_frame_skip; } speedup_throttle_ctrl; ///////////////////////////// diff --git a/src/wx/opts.cpp b/src/wx/opts.cpp index 3f925163..6acf4450 100644 --- a/src/wx/opts.cpp +++ b/src/wx/opts.cpp @@ -290,9 +290,9 @@ opt_desc opts[] = { INTOPT("preferences/skipBios", "SkipIntro", wxTRANSLATE("Skip BIOS initialization"), skipBios, 0, 1), INTOPT("preferences/skipSaveGameCheats", "", wxTRANSLATE("Do not overwrite cheat list when loading state"), skipSaveGameCheats, 0, 1), INTOPT("preferences/skipSaveGameBattery", "", wxTRANSLATE("Do not overwrite native (battery) save when loading state"), skipSaveGameBattery, 0, 1), - UINTOPT("preferences/throttle", "", wxTRANSLATE("Throttle game speed, even when accelerated (0-600%, 0 = no throttle)"), throttle, 0, 600), + UINTOPT("preferences/throttle", "", wxTRANSLATE("Throttle game speed, even when accelerated (0-450%, 0 = no throttle)"), throttle, 0, 450), UINTOPT("preferences/speedupThrottle", "", wxTRANSLATE("Set throttle for speedup key (0-3000%, 0 = no throttle)"), speedup_throttle, 0, 3000), - UINTOPT("preferences/speedupFrameSkip", "", wxTRANSLATE("Number of frames to skip with speedupThrottle == 0 (no throttle)"), speedup_frame_skip, 0, 300), + UINTOPT("preferences/speedupFrameSkip", "", wxTRANSLATE("Number of frames to skip with speedup (instead of speedup throttle)"), speedup_frame_skip, 0, 300), BOOLOPT("preferences/speedupThrottleFrameSkip", "", wxTRANSLATE("Use frame skip for speedup throttle"), speedup_throttle_frame_skip), INTOPT("preferences/useBiosGB", "BootRomGB", wxTRANSLATE("Use the specified BIOS file for GB"), useBiosFileGB, 0, 1), INTOPT("preferences/useBiosGBA", "BootRomEn", wxTRANSLATE("Use the specified BIOS file"), useBiosFileGBA, 0, 1), diff --git a/src/wx/xrc/GeneralConfig.xrc b/src/wx/xrc/GeneralConfig.xrc index 33272ce6..47939f8e 100644 --- a/src/wx/xrc/GeneralConfig.xrc +++ b/src/wx/xrc/GeneralConfig.xrc @@ -102,7 +102,7 @@ 0 0 - 1000 + 450 0 = no throttle wxALL|wxALIGN_CENTRE_VERTICAL @@ -130,12 +130,6 @@ 400% 425% 450% - 475% - 500% - 525% - 550% - 575% - 600% wxALL|wxALIGN_CENTRE_VERTICAL