Merge ec29d120b5
into 53b54406bd
This commit is contained in:
commit
4d897eca15
|
@ -45,6 +45,7 @@ const Info<bool> MAIN_ACCURATE_CPU_CACHE{{System::Main, "Core", "AccurateCPUCach
|
||||||
const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
|
const Info<bool> MAIN_DSP_HLE{{System::Main, "Core", "DSPHLE"}, true};
|
||||||
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
|
const Info<int> MAIN_MAX_FALLBACK{{System::Main, "Core", "MaxFallback"}, 100};
|
||||||
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
|
const Info<int> MAIN_TIMING_VARIANCE{{System::Main, "Core", "TimingVariance"}, 40};
|
||||||
|
const Info<bool> MAIN_CORRECT_TIME_DRIFT{{System::Main, "Core", "CorrectTimeDrift"}, false};
|
||||||
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true};
|
const Info<bool> MAIN_CPU_THREAD{{System::Main, "Core", "CPUThread"}, true};
|
||||||
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
|
const Info<bool> MAIN_SYNC_ON_SKIP_IDLE{{System::Main, "Core", "SyncOnSkipIdle"}, true};
|
||||||
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};
|
const Info<std::string> MAIN_DEFAULT_ISO{{System::Main, "Core", "DefaultISO"}, ""};
|
||||||
|
|
|
@ -63,6 +63,7 @@ extern const Info<bool> MAIN_ACCURATE_CPU_CACHE;
|
||||||
extern const Info<bool> MAIN_DSP_HLE;
|
extern const Info<bool> MAIN_DSP_HLE;
|
||||||
extern const Info<int> MAIN_MAX_FALLBACK;
|
extern const Info<int> MAIN_MAX_FALLBACK;
|
||||||
extern const Info<int> MAIN_TIMING_VARIANCE;
|
extern const Info<int> MAIN_TIMING_VARIANCE;
|
||||||
|
extern const Info<bool> MAIN_CORRECT_TIME_DRIFT;
|
||||||
extern const Info<bool> MAIN_CPU_THREAD;
|
extern const Info<bool> MAIN_CPU_THREAD;
|
||||||
extern const Info<bool> MAIN_SYNC_ON_SKIP_IDLE;
|
extern const Info<bool> MAIN_SYNC_ON_SKIP_IDLE;
|
||||||
extern const Info<std::string> MAIN_DEFAULT_ISO;
|
extern const Info<std::string> MAIN_DEFAULT_ISO;
|
||||||
|
|
|
@ -105,10 +105,20 @@ void CoreTimingManager::Init()
|
||||||
|
|
||||||
m_last_oc_factor = m_config_oc_factor;
|
m_last_oc_factor = m_config_oc_factor;
|
||||||
m_globals.last_OC_factor_inverted = m_config_oc_inv_factor;
|
m_globals.last_OC_factor_inverted = m_config_oc_inv_factor;
|
||||||
|
|
||||||
|
m_on_state_changed_handle = Core::AddOnStateChangedCallback([this](Core::State state) {
|
||||||
|
if (state == Core::State::Running)
|
||||||
|
{
|
||||||
|
// We don't want Throttle to attempt catch-up for all the time lost while paused.
|
||||||
|
ResetThrottle(GetTicks());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreTimingManager::Shutdown()
|
void CoreTimingManager::Shutdown()
|
||||||
{
|
{
|
||||||
|
Core::RemoveOnStateChangedCallback(&m_on_state_changed_handle);
|
||||||
|
|
||||||
std::lock_guard lk(m_ts_write_lock);
|
std::lock_guard lk(m_ts_write_lock);
|
||||||
MoveEvents();
|
MoveEvents();
|
||||||
ClearPendingEvents();
|
ClearPendingEvents();
|
||||||
|
@ -131,6 +141,8 @@ void CoreTimingManager::RefreshConfig()
|
||||||
|
|
||||||
m_max_variance = std::chrono::duration_cast<DT>(DT_ms(Config::Get(Config::MAIN_TIMING_VARIANCE)));
|
m_max_variance = std::chrono::duration_cast<DT>(DT_ms(Config::Get(Config::MAIN_TIMING_VARIANCE)));
|
||||||
|
|
||||||
|
m_correct_time_drift = Config::Get(Config::MAIN_CORRECT_TIME_DRIFT);
|
||||||
|
|
||||||
if (AchievementManager::GetInstance().IsHardcoreModeActive() &&
|
if (AchievementManager::GetInstance().IsHardcoreModeActive() &&
|
||||||
Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f &&
|
Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f &&
|
||||||
Config::Get(Config::MAIN_EMULATION_SPEED) > 0.0f)
|
Config::Get(Config::MAIN_EMULATION_SPEED) > 0.0f)
|
||||||
|
@ -428,7 +440,9 @@ void CoreTimingManager::Throttle(const s64 target_cycle)
|
||||||
const TimePoint time = Clock::now();
|
const TimePoint time = Clock::now();
|
||||||
|
|
||||||
const TimePoint min_target = time - m_max_fallback;
|
const TimePoint min_target = time - m_max_fallback;
|
||||||
if (target_time < min_target)
|
|
||||||
|
// "Correct Time Drift" setting prevents timing relaxing.
|
||||||
|
if (!m_correct_time_drift && target_time < min_target)
|
||||||
{
|
{
|
||||||
// Core is running too slow.. i.e. CPU bottleneck.
|
// Core is running too slow.. i.e. CPU bottleneck.
|
||||||
const DT adjustment = min_target - target_time;
|
const DT adjustment = min_target - target_time;
|
||||||
|
|
|
@ -211,6 +211,7 @@ private:
|
||||||
|
|
||||||
DT m_max_fallback = {};
|
DT m_max_fallback = {};
|
||||||
DT m_max_variance = {};
|
DT m_max_variance = {};
|
||||||
|
bool m_correct_time_drift = false;
|
||||||
double m_emulation_speed = 1.0;
|
double m_emulation_speed = 1.0;
|
||||||
|
|
||||||
bool IsSpeedUnlimited() const;
|
bool IsSpeedUnlimited() const;
|
||||||
|
@ -225,6 +226,8 @@ private:
|
||||||
std::atomic_bool m_use_precision_timer = false;
|
std::atomic_bool m_use_precision_timer = false;
|
||||||
Common::PrecisionTimer m_precision_cpu_timer;
|
Common::PrecisionTimer m_precision_cpu_timer;
|
||||||
Common::PrecisionTimer m_precision_gpu_timer;
|
Common::PrecisionTimer m_precision_gpu_timer;
|
||||||
|
|
||||||
|
int m_on_state_changed_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace CoreTiming
|
} // namespace CoreTiming
|
||||||
|
|
|
@ -89,6 +89,18 @@ void AdvancedPane::CreateLayout()
|
||||||
"needed.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"));
|
"needed.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"));
|
||||||
cpu_options_group_layout->addWidget(m_accurate_cpu_cache_checkbox);
|
cpu_options_group_layout->addWidget(m_accurate_cpu_cache_checkbox);
|
||||||
|
|
||||||
|
auto* const timing_group = new QGroupBox(tr("Timing"));
|
||||||
|
main_layout->addWidget(timing_group);
|
||||||
|
auto* timing_group_layout = new QVBoxLayout{timing_group};
|
||||||
|
auto* const correct_time_drift =
|
||||||
|
new ConfigBool{tr("Correct Time Drift"), Config::MAIN_CORRECT_TIME_DRIFT};
|
||||||
|
correct_time_drift->SetDescription(
|
||||||
|
tr("Allow the emulated console to run fast after stutters,"
|
||||||
|
"<br>pursuing accurate overall elapsed time unless paused or speed-adjusted."
|
||||||
|
"<br><br>This may be useful for internet play."
|
||||||
|
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"));
|
||||||
|
timing_group_layout->addWidget(correct_time_drift);
|
||||||
|
|
||||||
auto* clock_override = new QGroupBox(tr("Clock Override"));
|
auto* clock_override = new QGroupBox(tr("Clock Override"));
|
||||||
auto* clock_override_layout = new QVBoxLayout();
|
auto* clock_override_layout = new QVBoxLayout();
|
||||||
clock_override->setLayout(clock_override_layout);
|
clock_override->setLayout(clock_override_layout);
|
||||||
|
|
Loading…
Reference in New Issue