| 284 | } |
| 285 | |
| 286 | double GetVerticalFrequency() |
| 287 | { |
| 288 | // Note about NTSC/PAL "double strike" modes: |
| 289 | // NTSC and PAL can be configured in such a way to produce a non-interlaced signal. |
| 290 | // This involves modifying the signal slightly by either adding or subtracting a line (526/524 instead of 525) |
| 291 | // which has the function of causing the odd and even fields to strike the same lines. |
| 292 | // Doing this modifies the vertical refresh rate slightly. Beatmania is sensitive to this and |
| 293 | // not accounting for it will cause the audio and video to become desynced. |
| 294 | // |
| 295 | // In the case of the GS, I believe it adds a halfline to the vertical back porch but more research is needed. |
| 296 | // For now I'm just going to subtract off the config setting. |
| 297 | // |
| 298 | // According to the GS: |
| 299 | // NTSC (interlaced): 59.94 |
| 300 | // NTSC (non-interlaced): 59.82 |
| 301 | // PAL (interlaced): 50.00 |
| 302 | // PAL (non-interlaced): 49.76 |
| 303 | // |
| 304 | // More Information: |
| 305 | // https://web.archive.org/web/20201031235528/https://wiki.nesdev.com/w/index.php/NTSC_video |
| 306 | // https://web.archive.org/web/20201102100937/http://forums.nesdev.com/viewtopic.php?t=7909 |
| 307 | // https://web.archive.org/web/20120629231826fw_/http://ntsc-tv.com/index.html |
| 308 | // https://web.archive.org/web/20200831051302/https://www.hdretrovision.com/240p/ |
| 309 | |
| 310 | switch (gsVideoMode) |
| 311 | { |
| 312 | case GS_VideoMode::Uninitialized: // SetGsCrt hasn't executed yet, give some temporary values. |
| 313 | return 60.00; |
| 314 | case GS_VideoMode::PAL: |
| 315 | case GS_VideoMode::DVD_PAL: |
| 316 | return (IsProgressiveVideoMode() == false) ? EmuConfig.GS.FrameratePAL : EmuConfig.GS.FrameratePAL - 0.24f; |
| 317 | case GS_VideoMode::NTSC: |
| 318 | case GS_VideoMode::DVD_NTSC: |
| 319 | return (IsProgressiveVideoMode() == false) ? EmuConfig.GS.FramerateNTSC : EmuConfig.GS.FramerateNTSC - 0.11f; |
| 320 | case GS_VideoMode::SDTV_480P: |
| 321 | return 59.94; |
| 322 | case GS_VideoMode::HDTV_1080P: |
| 323 | case GS_VideoMode::HDTV_1080I: |
| 324 | case GS_VideoMode::HDTV_720P: |
| 325 | case GS_VideoMode::SDTV_576P: |
| 326 | case GS_VideoMode::VESA: |
| 327 | return 60.00; |
| 328 | default: |
| 329 | // Pass NTSC vertical frequency value when unknown video mode is detected. |
| 330 | return FRAMERATE_NTSC * 2; |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | void UpdateVSyncRate(bool force) |
| 335 | { |
no test coverage detected