Correct CNTPCT to use Clock Cycles instead of Cpu Cycles.

This commit is contained in:
Fernando Sahmkow 2019-02-15 13:15:28 -04:00 committed by FernandoS27
parent 8d25a51b64
commit ab1257e4c2
3 changed files with 13 additions and 2 deletions

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