summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-02-16 21:52:24 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2019-02-16 21:52:24 +0100
commita8d4927e29bb1acbf5f3267f368801847acd4222 (patch)
treea5b08502c0fce93f8ef7a429ae873571eca1f852 /src/core
parentUse u128 on Clock Cycles calculation. (diff)
downloadyuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar.gz
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar.bz2
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar.lz
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar.xz
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.tar.zst
yuzu-a8d4927e29bb1acbf5f3267f368801847acd4222.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp2
-rw-r--r--src/core/core_timing_util.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp
index 25f76259b..4fdc12f11 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic.cpp
@@ -152,7 +152,7 @@ std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit() const {
config.tpidr_el0 = &cb->tpidr_el0;
config.dczid_el0 = 4;
config.ctr_el0 = 0x8444c004;
- config.cntfrq_el0 = Timing::CNTFREQ; // Value from fusee.
+ config.cntfrq_el0 = Timing::CNTFREQ;
// Unpredictable instructions
config.define_unpredictable_behaviour = true;
diff --git a/src/core/core_timing_util.cpp b/src/core/core_timing_util.cpp
index aab4aa697..7942f30d6 100644
--- a/src/core/core_timing_util.cpp
+++ b/src/core/core_timing_util.cpp
@@ -62,9 +62,8 @@ s64 nsToCycles(u64 ns) {
}
u64 CpuCyclesToClockCycles(u64 ticks) {
- u128 temporal = Common::Multiply64Into128(ticks, CNTFREQ);
- std::pair<u64, u64> result = Common::Divide128On64(temporal, BASE_CLOCK_RATE);
- return result.first;
+ const u128 temporal = Common::Multiply64Into128(ticks, CNTFREQ);
+ return Common::Divide128On32(temporal, static_cast<u32>(BASE_CLOCK_RATE)).first;
}
} // namespace Core::Timing