Counters: Don't skip vblanks on video mode change

This commit is contained in:
Stenzek 2023-09-09 20:05:16 +10:00 committed by Connor McLaughlin
parent ec1b782f2c
commit cc221f590c
1 changed files with 5 additions and 6 deletions

View File

@ -465,11 +465,10 @@ void UpdateVSyncRate(bool force)
if (custom && video_mode_initialized)
Console.Indent().WriteLn(Color_StrongGreen, "... with user configured refresh rate: %.02f Hz", vertical_frequency);
hsyncCounter.CycleT = vSyncInfo.hRender; // Amount of cycles before the counter will be updated
vsyncCounter.CycleT = vSyncInfo.Render; // Amount of cycles before the counter will be updated
hsyncCounter.sCycle = cpuRegs.cycle;
vsyncCounter.sCycle = cpuRegs.cycle;
vsyncCounter.Mode = MODE_VRENDER;
hsyncCounter.CycleT = (hsyncCounter.Mode == MODE_HBLANK) ? vSyncInfo.hBlank : vSyncInfo.hRender;
vsyncCounter.CycleT = (vsyncCounter.Mode == MODE_GSBLANK) ?
vSyncInfo.GSBlank :
((vsyncCounter.Mode == MODE_VSYNC) ? vSyncInfo.Blank : vSyncInfo.Render);
cpuRcntSet();
PerformanceMetrics::SetVerticalFrequency(vertical_frequency);
@ -683,7 +682,7 @@ __fi void rcntUpdate_hScanline()
if( !cpuTestCycle( hsyncCounter.sCycle, hsyncCounter.CycleT ) ) return;
//iopEventAction = 1;
if (hsyncCounter.Mode & MODE_HBLANK) { //HBLANK Start
if (hsyncCounter.Mode == MODE_HBLANK) { //HBLANK Start
rcntStartGate(false, hsyncCounter.sCycle);
psxCheckStartGate16(0);