diff options
author | Lioncash <mathew1800@gmail.com> | 2019-06-05 01:41:48 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-06-05 01:44:05 +0200 |
commit | 79189c7e3edfd2d628a927ea4be707eb0deeb4e3 (patch) | |
tree | 222036bfb19793d30eb7cf474258116ba9b226c4 /src/core/core_timing_util.h | |
parent | Merge pull request #2525 from FearlessTobi/remove-unused-settings (diff) | |
download | yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar.gz yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar.bz2 yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar.lz yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar.xz yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.tar.zst yuzu-79189c7e3edfd2d628a927ea4be707eb0deeb4e3.zip |
Diffstat (limited to 'src/core/core_timing_util.h')
-rw-r--r-- | src/core/core_timing_util.h | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/core/core_timing_util.h b/src/core/core_timing_util.h index 679aa3123..c8749ff12 100644 --- a/src/core/core_timing_util.h +++ b/src/core/core_timing_util.h @@ -13,41 +13,10 @@ namespace Core::Timing { constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch clock speed is 1020MHz un/docked constexpr u64 CNTFREQ = 19200000; // Value from fusee. -inline s64 msToCycles(int ms) { - // since ms is int there is no way to overflow - return BASE_CLOCK_RATE * static_cast<s64>(ms) / 1000; -} - -inline s64 msToCycles(float ms) { - return static_cast<s64>(BASE_CLOCK_RATE * (0.001f) * ms); -} - -inline s64 msToCycles(double ms) { - return static_cast<s64>(BASE_CLOCK_RATE * (0.001) * ms); -} - -inline s64 usToCycles(float us) { - return static_cast<s64>(BASE_CLOCK_RATE * (0.000001f) * us); -} - -inline s64 usToCycles(int us) { - return (BASE_CLOCK_RATE * static_cast<s64>(us) / 1000000); -} - s64 usToCycles(s64 us); - s64 usToCycles(u64 us); -inline s64 nsToCycles(float ns) { - return static_cast<s64>(BASE_CLOCK_RATE * (0.000000001f) * ns); -} - -inline s64 nsToCycles(int ns) { - return BASE_CLOCK_RATE * static_cast<s64>(ns) / 1000000000; -} - s64 nsToCycles(s64 ns); - s64 nsToCycles(u64 ns); inline u64 cyclesToNs(s64 cycles) { |