Correct CNTPCT to use Clock Cycles instead of Cpu Cycles.

This commit is contained in:
Fernando Sahmkow authored and FernandoS27 committed 2019-02-15 22:55:29 -04:00
1 parent 99da6362c4
commit 5b7ec71fb7
3 files changed
+13 -2

No files matched your search

+7
View File
@@ -60,4 +60,11 @@ s64 nsToCycles(u64 ns) {
return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000;
}
u64 CpuCyclesToClockCycles(u64 ticks) {
u64 result = ticks;
result *= CNTFREQ;
result /= BASE_CLOCK_RATE;
return static_cast<u64>(result);
}
} // namespace Core::Timing