diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 3 | ||||
| -rw-r--r-- | src/common/x64/native_clock.h | 5 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 926f92ff8..f1bc60fd2 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -62,7 +62,8 @@ u64 NativeClock::GetRTSC() { | |||
| 62 | } | 62 | } |
| 63 | accumulated_ticks += diff; | 63 | accumulated_ticks += diff; |
| 64 | rtsc_serialize.unlock(); | 64 | rtsc_serialize.unlock(); |
| 65 | return accumulated_ticks; | 65 | /// The clock cannot be more precise than the guest timer, remove the lower bits |
| 66 | return accumulated_ticks & inaccuracy_mask; | ||
| 66 | } | 67 | } |
| 67 | 68 | ||
| 68 | void NativeClock::Pause(bool is_paused) { | 69 | void NativeClock::Pause(bool is_paused) { |
diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h index 3851f8fc2..e853094d2 100644 --- a/src/common/x64/native_clock.h +++ b/src/common/x64/native_clock.h | |||
| @@ -31,6 +31,11 @@ public: | |||
| 31 | private: | 31 | private: |
| 32 | u64 GetRTSC(); | 32 | u64 GetRTSC(); |
| 33 | 33 | ||
| 34 | /// value used to reduce the native clocks accuracy as some apss rely on | ||
| 35 | /// undefined behavior where the level of accuracy in the clock shouldn't | ||
| 36 | /// be higher. | ||
| 37 | static constexpr u64 inaccuracy_mask = ~(0x100 - 1); | ||
| 38 | |||
| 34 | SpinLock rtsc_serialize{}; | 39 | SpinLock rtsc_serialize{}; |
| 35 | u64 last_measure{}; | 40 | u64 last_measure{}; |
| 36 | u64 accumulated_ticks{}; | 41 | u64 accumulated_ticks{}; |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 547a6e07e..3f18dede2 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -184,6 +184,9 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& | |||
| 184 | config.enable_fast_dispatch = false; | 184 | config.enable_fast_dispatch = false; |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | // CNTPCT uses wall clock. | ||
| 188 | config.wall_clock_cntpct = true; | ||
| 189 | |||
| 187 | return std::make_shared<Dynarmic::A64::Jit>(config); | 190 | return std::make_shared<Dynarmic::A64::Jit>(config); |
| 188 | } | 191 | } |
| 189 | 192 | ||