mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 18:30:56 +00:00
Spend a lot less time calculating the hcount.
Tiny loss in precision, can't even notice. Cuts time significantly in Valkyrie Profile.
This commit is contained in:
parent
994e2b3e5c
commit
6e5426a528
@ -686,9 +686,10 @@ u32 sceDisplayGetVcount() {
|
||||
}
|
||||
|
||||
u32 __DisplayGetCurrentHcount() {
|
||||
const u64 ticksIntoFrame = CoreTiming::GetTicks() - frameStartTicks;
|
||||
const static int ticksPerVblank333 = 333 * 1000000 / 60 / hCountPerVblank;
|
||||
const int ticksIntoFrame = CoreTiming::GetTicks() - frameStartTicks;
|
||||
// Can't seem to produce a 0 on real hardware, offsetting by 1 makes things look right.
|
||||
return 1 + (ticksIntoFrame / ((u64)CoreTiming::GetClockFrequencyMHz() * 1000000 / 60 / hCountPerVblank));
|
||||
return 1 + (ticksIntoFrame / (CoreTiming::GetClockFrequencyMHz() * ticksPerVblank333 / 333));
|
||||
}
|
||||
|
||||
u32 __DisplayGetAccumulatedHcount() {
|
||||
|
Loading…
Reference in New Issue
Block a user