diff options
| author | CamilleLaVey <camillelavey@noreply.localhost> | 2025-04-19 22:33:59 +0000 |
|---|---|---|
| committer | CamilleLaVey <camillelavey@noreply.localhost> | 2025-04-19 22:33:59 +0000 |
| commit | 922d678abd185eab71545f6fe33788635eb67285 (patch) | |
| tree | 49edfc47713a05100f31b702ef066b3847bf3093 /src/core/core_timing.cpp | |
| parent | 6acf63839bfeb873e87cef75080b2ef6d3462a90 (diff) | |
| parent | e77ef26293d36259b4cd5e7853e1e18319da8680 (diff) | |
Merge pull request 'Add changes of my fork into newer repo' (#32) from MrPurple666/eden:purple into master
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/32
Reviewed NCE modifications and implementations, those makes a good addition; merging also Briar features.
Diffstat (limited to 'src/core/core_timing.cpp')
| -rw-r--r-- | src/core/core_timing.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 1abfa920c4..3d67ab9f5c 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -14,6 +14,7 @@ #include "common/x64/cpu_wait.h" #endif +#include "common/settings.h" #include "common/microprofile.h" #include "core/core_timing.h" #include "core/hardware_properties.h" @@ -184,10 +185,20 @@ void CoreTiming::ResetTicks() { } u64 CoreTiming::GetClockTicks() const { + u64 fres; if (is_multicore) [[likely]] { - return clock->GetCNTPCT(); + fres = clock->GetCNTPCT(); + } else { + fres = Common::WallClock::CPUTickToCNTPCT(cpu_ticks); + } + + if (Settings::values.sync_core_speed.GetValue()) { + const double ticks = static_cast<double>(fres); + const double speed_limit = static_cast<double>(Settings::values.speed_limit.GetValue())*0.01; + return static_cast<u64>(ticks/speed_limit); + } else { + return fres; } - return Common::WallClock::CPUTickToCNTPCT(cpu_ticks); } u64 CoreTiming::GetGPUTicks() const { |
