mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 02:55:45 +00:00
Add sync core speed
This commit is contained in:
parent
d25bea5762
commit
70c2439d8c
7 changed files with 53 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue