mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Improvements to timer hack.
This commit is contained in:
parent
fb7c3d96fd
commit
20e1bdceeb
1 changed files with 8 additions and 8 deletions
|
@ -99,23 +99,23 @@ void SetClockFrequencyMHz(int cpuMhz)
|
|||
|
||||
int GetClockFrequencyMHz()
|
||||
{
|
||||
if (g_Config.bTimerHack) {
|
||||
float vps;
|
||||
__DisplayGetVPS(&vps);
|
||||
if (vps > 5.0f)
|
||||
return (int)((float)(CPU_HZ / 1000000)*(vps / 60.0f));
|
||||
}
|
||||
return CPU_HZ / 1000000;
|
||||
}
|
||||
|
||||
u64 GetGlobalTimeUs()
|
||||
{
|
||||
s64 ticksSinceLast = GetTicks() - lastGlobalTimeTicks;
|
||||
s64 usSinceLast = ticksSinceLast / GetClockFrequencyMHz();
|
||||
int freq = GetClockFrequencyMHz();
|
||||
if (g_Config.bTimerHack) {
|
||||
float vps;
|
||||
__DisplayGetVPS(&vps);
|
||||
if (vps > 5.0f)
|
||||
freq = (int)(((float)CPU_HZ * vps) / (1000000.0f * 60.0f));
|
||||
}
|
||||
s64 usSinceLast = ticksSinceLast / freq;
|
||||
return lastGlobalTimeUs + usSinceLast;
|
||||
}
|
||||
|
||||
|
||||
Event* GetNewEvent()
|
||||
{
|
||||
if(!eventPool)
|
||||
|
|
Loading…
Add table
Reference in a new issue