From c57f861f2bbad5a45ab666b484ecd30f269c4fea Mon Sep 17 00:00:00 2001 From: Kojin Date: Thu, 12 Nov 2020 17:15:42 -0500 Subject: [PATCH] counters: account for vertical frequency differences in non-interlaced anolog modes (#3862) --- pcsx2/Counters.cpp | 25 +++++++++++++++++++++++-- pcsx2/GS.cpp | 3 --- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index 5d00ef86d3..b5ad96f178 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -278,16 +278,37 @@ const char* ReportVideoMode() Fixed100 GetVerticalFrequency() { + // Note about NTSC/PAL "double strike" modes: + // NTSC and PAL can be configured in such a way to produce a non-interlaced signal. + // This involves modifying the signal slightly by either adding or subtracting a line (526/524 instead of 525) + // which has the function of causing the odd and even fields to strike the same lines. + // Doing this modifies the vertical refresh rate slightly. Beatmania is sensitive to this and + // not accounting for it will cause the audio and video to become desynced. + // + // In the case of the GS, I believe it adds a halfline to the vertical back porch but more research is needed. + // For now I'm just going to subtract off the config setting. + // + // According to the GS: + // NTSC (interlaced): 59.94 + // NTSC (non-interlaced): 59.82 + // PAL (interlaced): 50.00 + // PAL (non-interlaced): 49.76 + // + // More Information: + // https://web.archive.org/web/20201031235528/https://wiki.nesdev.com/w/index.php/NTSC_video + // https://web.archive.org/web/20201102100937/http://forums.nesdev.com/viewtopic.php?t=7909 + // https://web.archive.org/web/20120629231826fw_/http://ntsc-tv.com/index.html + // https://web.archive.org/web/20200831051302/https://www.hdretrovision.com/240p/ switch (gsVideoMode) { case GS_VideoMode::Uninitialized: // SetGsCrt hasn't executed yet, give some temporary values. return 60; case GS_VideoMode::PAL: case GS_VideoMode::DVD_PAL: - return EmuConfig.GS.FrameratePAL; + return gsIsInterlaced ? EmuConfig.GS.FrameratePAL : EmuConfig.GS.FrameratePAL - 0.24f; case GS_VideoMode::NTSC: case GS_VideoMode::DVD_NTSC: - return EmuConfig.GS.FramerateNTSC; + return gsIsInterlaced ? EmuConfig.GS.FramerateNTSC : EmuConfig.GS.FramerateNTSC - 0.11f; case GS_VideoMode::SDTV_480P: return 59.94; case GS_VideoMode::HDTV_1080P: diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index 235f2c6891..d2d4a0211f 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -36,9 +36,6 @@ void gsOnModeChanged( Fixed100 framerate, u32 newTickrate ) void gsSetVideoMode(GS_VideoMode mode ) { - if( gsVideoMode == mode ) - return; - gsVideoMode = mode; UpdateVSyncRate(); }