mirror of https://github.com/PCSX2/pcsx2.git
PCSX2-Counters: Fix rounding of blank and render
I guess the intention of the older logic was to get the truncated part by comparing with the original value, but that went wrong due to using the pre-normalized value (before the division) for comparison. Hence let's just do a modulo for rounding the render and blank.
This commit is contained in:
parent
785fe6b2e3
commit
c23241c5f4
|
@ -229,11 +229,12 @@ static void vSyncInfoCalc(vSyncTimingInfo* info, Fixed100 framesPerSecond, u32 s
|
|||
info->hScanlinesPerFrame = scansPerFrame;
|
||||
|
||||
// Apply rounding:
|
||||
if ((Render - info->Render) >= 5000) info->Render++;
|
||||
else if ((Blank - info->Blank) >= 5000) info->Blank++;
|
||||
// To investigate: Why is render rounding prioritized over blank? why skip the latter?
|
||||
if ((Render % 10000) >= 5000) info->Render++;
|
||||
else if ((Blank % 10000) >= 5000) info->Blank++;
|
||||
|
||||
if ((hRender - info->hRender) >= 5000) info->hRender++;
|
||||
else if ((hBlank - info->hBlank) >= 5000) info->hBlank++;
|
||||
if ((hRender % 10000) >= 5000) info->hRender++;
|
||||
else if ((hBlank % 10000) >= 5000) info->hBlank++;
|
||||
|
||||
// Calculate accumulative hSync rounding error per half-frame:
|
||||
if (IsAnalogVideoMode()) // gets off the chart in that mode
|
||||
|
|
Loading…
Reference in New Issue