From 941ee580a7649bc31a0d6130a71f85690a59aaeb Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 19 Apr 2015 22:07:49 +0000 Subject: [PATCH] Fixed the throttle menu option git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1356 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/common/ConfigManager.cpp | 1 + src/gba/Sound.cpp | 4 ++-- src/win32/VBA.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/ConfigManager.cpp b/src/common/ConfigManager.cpp index 4b5a6319..4a6fda81 100644 --- a/src/common/ConfigManager.cpp +++ b/src/common/ConfigManager.cpp @@ -450,6 +450,7 @@ void LoadConfig() fullScreenStretch = ReadPref("stretch", 0) ? true : false; videoOption = ReadPref("video", 2); // VIDEO_3X = 2 fsAdapter = ReadPref("fsAdapter", 0); + throttle = ReadPref("throttle", 0); fsWidth = ReadPref("fsWidth", 800); fsHeight = ReadPref("fsHeight", 600); fsColorDepth = ReadPref("fsColorDepth", 32); diff --git a/src/gba/Sound.cpp b/src/gba/Sound.cpp index 439b5afc..03ea4bd4 100644 --- a/src/gba/Sound.cpp +++ b/src/gba/Sound.cpp @@ -560,11 +560,11 @@ bool soundInit() return true; } -void soundSetThrottle(unsigned short throttle) +void soundSetThrottle(unsigned short _throttle) { if(!soundDriver) return; - soundDriver->setThrottle(throttle); + soundDriver->setThrottle(_throttle); } long soundGetSampleRate() diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index f74f92d3..8bbcf9ca 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -852,10 +852,10 @@ void VBA::updateFilter() } -void VBA::updateThrottle( unsigned short throttle ) +void VBA::updateThrottle( unsigned short _throttle ) { - if( throttle ) { - Sm60FPS::K_fCpuSpeed = (float)throttle; + if( _throttle ) { + Sm60FPS::K_fCpuSpeed = (float)_throttle; Sm60FPS::K_fTargetFps = 60.0f * Sm60FPS::K_fCpuSpeed / 100; Sm60FPS::K_fDT = 1000.0f / Sm60FPS::K_fTargetFps; autoFrameSkip = false; @@ -863,7 +863,8 @@ void VBA::updateThrottle( unsigned short throttle ) systemFrameSkip = 0; } - soundSetThrottle(throttle); + throttle = _throttle; + soundSetThrottle(_throttle); }