mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Protect against vtimers scheduled in past.
This commit is contained in:
parent
f78712ec3a
commit
a42a2864a6
1 changed files with 4 additions and 3 deletions
|
@ -102,9 +102,10 @@ void __KernelScheduleVTimer(VTimer *vt, u64 schedule) {
|
|||
if (schedule < 250) {
|
||||
schedule = 250;
|
||||
}
|
||||
u64 goalUs = vt->nvt.base + schedule - vt->nvt.current;
|
||||
if (goalUs < CoreTiming::GetGlobalTimeUs()) {
|
||||
cyclesIntoFuture = usToCycles(200);
|
||||
s64 goalUs = (u64)vt->nvt.base + schedule - (u64)vt->nvt.current;
|
||||
s64 minGoalUs = CoreTiming::GetGlobalTimeUs() + 250;
|
||||
if (goalUs < minGoalUs) {
|
||||
cyclesIntoFuture = usToCycles(250);
|
||||
} else {
|
||||
cyclesIntoFuture = usToCycles(goalUs - CoreTiming::GetGlobalTimeUs());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue