From 1f288e06bc22b33753d39118084fd565b91f7881 Mon Sep 17 00:00:00 2001 From: B3n30 Date: Mon, 13 Nov 2017 16:32:20 +0100 Subject: [PATCH] CoreTiming: fix comments --- src/core/core_timing.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 3d82b49c0..e1c48c8e0 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -23,14 +23,17 @@ // inside callback: // ScheduleEvent(periodInCycles - cycles_late, callback, "whatever") -// The actual timing is 268,111,855.956 Hz +// The timing we get from the assembly is 268,111,855.956 Hz +// It is possible that this number isn't jus a integer because the compiler could have +// optimized the multiplication by a multiply-by-constant division. +// Rounding to the nearest integer should be fine constexpr s64 BASE_CLOCK_RATE_ARM11 = 268111856; constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits::max() / 268111856; extern int g_clock_rate_arm11; inline s64 msToCycles(int ms) { - // since mx is int there is no way to overflow + // since ms is int there is no way to overflow return g_clock_rate_arm11 * static_cast(ms) / 1000; }