Merge pull request #896 from raven02/patch-5

Set accumulatedHcount based on currentHCount
This commit is contained in:
Henrik Rydgård 2013-03-07 00:55:01 -08:00
commit c3bb71ae5b

View File

@ -604,8 +604,9 @@ u32 sceDisplayAdjustAccumulatedHcount() {
}
u32 sceDisplayGetAccumulatedHcount() {
// Just do an estimate
u32 accumHCount = CoreTiming::GetTicks() / (CoreTiming::GetClockFrequencyMHz() * 1000000 / 60 / 272);
float hCountPerVblank = 285.72f; // insprired by jpcsp
u32 currentHCount = (CoreTiming::GetTicks() - frameStartTicks) / ((u64)CoreTiming::GetClockFrequencyMHz() * 1000000 / 60 / 272)
u32 accumHCount = currentHCount + (u32) (vCount * hCountPerVblank);
DEBUG_LOG(HLE,"%i=sceDisplayGetAccumulatedHcount()", accumHCount);
return accumHCount;
}