diff options
| author | bunnei <bunneidev@gmail.com> | 2019-03-16 21:58:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-16 21:58:59 -0400 |
| commit | 059465d496df3ccf6681e8a1d5aee4be3cc0b7e7 (patch) | |
| tree | d4fb745d01e5c351a4c6646fb886c84cab5e5afe /src/core/core_timing_util.h | |
| parent | 29c242721a420c75e181f5a1ac583da14e9af769 (diff) | |
| parent | a8d4927e29bb1acbf5f3267f368801847acd4222 (diff) | |
Merge pull request #2129 from FernandoS27/cntpct
Correct CNTPCT from using CPU Cycles to using Clock Cycles
Diffstat (limited to 'src/core/core_timing_util.h')
| -rw-r--r-- | src/core/core_timing_util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/core_timing_util.h b/src/core/core_timing_util.h index 513cfac1b..679aa3123 100644 --- a/src/core/core_timing_util.h +++ b/src/core/core_timing_util.h @@ -11,6 +11,7 @@ namespace Core::Timing { // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz // The exact value used is of course unverified. 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 @@ -61,4 +62,6 @@ inline u64 cyclesToMs(s64 cycles) { return cycles * 1000 / BASE_CLOCK_RATE; } +u64 CpuCyclesToClockCycles(u64 ticks); + } // namespace Core::Timing |
