mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 06:18:32 +00:00
Config: Port CPU overclock settings to new config system.
This commit is contained in:
parent
a29d7625dd
commit
cae4b545bd
9 changed files with 26 additions and 37 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "Common/Config/Config.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
|
@ -304,8 +305,8 @@ TEST(CoreTiming, Overclocking)
|
|||
CoreTiming::EventType* cb_e = CoreTiming::RegisterEvent("callbackE", CallbackTemplate<4>);
|
||||
|
||||
// Overclock
|
||||
SConfig::GetInstance().m_OCEnable = true;
|
||||
SConfig::GetInstance().m_OCFactor = 2.0;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK_ENABLE, true);
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 2.0f);
|
||||
|
||||
// Enter slice 0
|
||||
// Updates s_last_OC_factor.
|
||||
|
@ -325,7 +326,7 @@ TEST(CoreTiming, Overclocking)
|
|||
AdvanceAndCheck(4, MAX_SLICE_LENGTH * 2);
|
||||
|
||||
// Underclock
|
||||
SConfig::GetInstance().m_OCFactor = 0.5;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 0.5f);
|
||||
CoreTiming::Advance();
|
||||
|
||||
CoreTiming::ScheduleEvent(100, cb_a, CB_IDS[0]);
|
||||
|
@ -342,7 +343,7 @@ TEST(CoreTiming, Overclocking)
|
|||
AdvanceAndCheck(4, MAX_SLICE_LENGTH / 2);
|
||||
|
||||
// Try switching the clock mid-emulation
|
||||
SConfig::GetInstance().m_OCFactor = 1.0;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 1.0f);
|
||||
CoreTiming::Advance();
|
||||
|
||||
CoreTiming::ScheduleEvent(100, cb_a, CB_IDS[0]);
|
||||
|
@ -353,11 +354,11 @@ TEST(CoreTiming, Overclocking)
|
|||
EXPECT_EQ(100, PowerPC::ppcState.downcount);
|
||||
|
||||
AdvanceAndCheck(0, 100); // (200 - 100)
|
||||
SConfig::GetInstance().m_OCFactor = 2.0;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 2.0f);
|
||||
AdvanceAndCheck(1, 400); // (400 - 200) * 2
|
||||
AdvanceAndCheck(2, 800); // (800 - 400) * 2
|
||||
SConfig::GetInstance().m_OCFactor = 0.1f;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 0.1f);
|
||||
AdvanceAndCheck(3, 80); // (1600 - 800) / 10
|
||||
SConfig::GetInstance().m_OCFactor = 1.0;
|
||||
Config::SetCurrent(Config::MAIN_OVERCLOCK, 1.0f);
|
||||
AdvanceAndCheck(4, MAX_SLICE_LENGTH);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue