Counters: Pass correct start cycle

This commit is contained in:
refractionpcsx2 committed 2023-11-08 17:19:55 +00:00
1 parent e3d4b0e56a
commit 8e9fd91cee
1 file changed
+12 -11
+12 -11
View File
@@ -600,13 +600,13 @@ __fi void rcntUpdate_hScanline()
//iopEventAction = 1;
if (hsyncCounter.Mode == MODE_HBLANK)
{ //HBLANK Start
rcntStartGate(false, hsyncCounter.sCycle);
psxCheckStartGate16(0);
// Setup the hRender's start and end cycle information:
hsyncCounter.sCycle += vSyncInfo.hBlank; // start (absolute cycle value)
hsyncCounter.CycleT = vSyncInfo.hRender; // endpoint (delta from start value)
hsyncCounter.Mode = MODE_HRENDER;
rcntStartGate(false, hsyncCounter.sCycle);
psxCheckStartGate16(0);
}
else
{ //HBLANK END / HRENDER Begin
@@ -616,16 +616,17 @@ __fi void rcntUpdate_hScanline()
if (!GSIMR.HSMSK)
gsIrq();
}
if (gates)
rcntEndGate(false, hsyncCounter.sCycle);
if (psxhblankgate)
psxCheckEndGate16(0);
// set up the hblank's start and end cycle information:
hsyncCounter.sCycle += vSyncInfo.hRender; // start (absolute cycle value)
hsyncCounter.CycleT = vSyncInfo.hBlank; // endpoint (delta from start value)
hsyncCounter.Mode = MODE_HBLANK;
if (gates)
rcntEndGate(false, hsyncCounter.sCycle);
if (psxhblankgate)
psxCheckEndGate16(0);
#ifdef VSYNC_DEBUG
hsc++;
#endif
@@ -639,11 +640,11 @@ __fi void rcntUpdate_vSync()
if (vsyncCounter.Mode == MODE_VSYNC)
{
VSyncEnd(vsyncCounter.sCycle);
vsyncCounter.sCycle += vSyncInfo.Blank;
vsyncCounter.CycleT = vSyncInfo.Render;
vsyncCounter.Mode = MODE_VRENDER;
VSyncEnd(vsyncCounter.sCycle);
}
else if (vsyncCounter.Mode == MODE_GSBLANK) // GS CSR Swap and interrupt
{
@@ -655,8 +656,6 @@ __fi void rcntUpdate_vSync()
}
else // VSYNC end / VRENDER begin
{
VSyncStart(vsyncCounter.sCycle);
vsyncCounter.sCycle += vSyncInfo.Render;
vsyncCounter.CycleT = vSyncInfo.GSBlank;
vsyncCounter.Mode = MODE_GSBLANK;
@@ -664,6 +663,8 @@ __fi void rcntUpdate_vSync()
// Accumulate hsync rounding errors:
hsyncCounter.sCycle += vSyncInfo.hSyncError;
VSyncStart(vsyncCounter.sCycle);
#ifdef VSYNC_DEBUG
vblankinc++;
if (vblankinc > 1)