diff options
| author | 2018-01-08 19:18:50 -0500 | |
|---|---|---|
| committer | 2018-01-08 19:18:50 -0500 | |
| commit | d6e4e6ea321aaf734198bffea5a3f976f5b4d23b (patch) | |
| tree | af62d27a2c2403280aadfd95e8cdd026dc6595ef /src/core | |
| parent | CoreTiming: Reworked CoreTiming (cherry-picked from Citra #3119) (diff) | |
| download | yuzu-d6e4e6ea321aaf734198bffea5a3f976f5b4d23b.tar.gz yuzu-d6e4e6ea321aaf734198bffea5a3f976f5b4d23b.tar.xz yuzu-d6e4e6ea321aaf734198bffea5a3f976f5b4d23b.zip | |
core_timing: Use 1.020GHz for core clock rate.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/core_timing.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 46ddcd18b..b9eb38ea4 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h | |||
| @@ -23,11 +23,9 @@ | |||
| 23 | #include "common/common_types.h" | 23 | #include "common/common_types.h" |
| 24 | #include "common/logging/log.h" | 24 | #include "common/logging/log.h" |
| 25 | 25 | ||
| 26 | // The timing we get from the assembly is 268,111,855.956 Hz | 26 | // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz |
| 27 | // It is possible that this number isn't just an integer because the compiler could have | 27 | // The exact value used is of course unverified. |
| 28 | // optimized the multiplication by a multiply-by-constant division. | 28 | constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch clock speed is 1020MHz un/docked |
| 29 | // Rounding to the nearest integer should be fine | ||
| 30 | constexpr u64 BASE_CLOCK_RATE = 383778816; // Switch clock speed is 384MHz docked | ||
| 31 | constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; | 29 | constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; |
| 32 | 30 | ||
| 33 | inline s64 msToCycles(int ms) { | 31 | inline s64 msToCycles(int ms) { |