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