Skip to content

libretro: report 60.00 fps for NTSC instead of 59.94 - #2333

Merged
flyinghead merged 1 commit into
flyinghead:masterfrom
AurisDSP:feature/force-60hz-ntsc
Jun 1, 2026
Merged

flyinghead merged 1 commit into
flyinghead:masterfrom
AurisDSP:feature/force-60hz-ntsc

Conversation

@AurisDSP

@AurisDSP AurisDSP commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes the NTSC framerate reported to the libretro frontend in setAVInfo() from 59.94 to 60.00 (and the 240p NTSC-mode special case from 59.82366 to 60.00). PAL is unchanged.

Motivation

On non-VRR 60 Hz displays, the 0.1% drift between the core's reported 59.94 fps and the host's 60 Hz refresh produces a periodic frame skip/duplicate roughly every 17 seconds. The hiccup is normally absorbed by frontend audio resampling and goes unnoticed, but it becomes visible when:

  • Black Frame Insertion is enabled — the strobe pattern visibly stutters at the drift point
  • Strict V-Sync is used without dynamic refresh-rate matching

Reporting 60.00 fps lines the core up with the typical 60 Hz monitor and removes the hiccup entirely on those setups.

Diff

- double fps = SPG_CONTROL.isPAL() ? 50.0 : 59.94;
+ double fps = SPG_CONTROL.isPAL() ? 50.0 : 60.0;
- 	fps = 59.82366;
+ 	fps = 60.0;

Trade-off

The reported rate diverges 0.1% from cycle-accurate NTSC. Audio sample rate is unchanged (44100 Hz) and the per-run sample count sample_rate / fps adjusts automatically, so frontend resamplers absorb the difference cleanly. Anyone needing strict NTSC timing should rely on the frontend's auto-refresh-rate features (or VRR), which is the more correct fix anyway.

If a configurable option is preferred (force_60hz style), happy to follow up with one — kept this PR minimal.

Test plan

  • Builds cleanly on macOS arm64
  • RetroArch log shows [INFO] [Core] ... FPS: 60.00 instead of 59.94
  • Tested with Jazz Jackrabbit DC port and Volgarr the Viking
  • Reviewers welcome to verify on Linux/Windows and additional retail titles

Aligns the reported core framerate with the typical 60 Hz host display
refresh, eliminating the periodic frame-pacing skip that drift between
59.94 fps content and a 60 Hz monitor produces under strict V-Sync or
Black Frame Insertion (the skip happens roughly every 17 seconds).

PAL (50.0 Hz) is unchanged. The 240p VGA rate is also moved to 60.0
so it benefits from the same alignment. Audio sample rate stays at
44100 Hz; the per-run sample count `sample_rate / fps` adjusts
automatically.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@AurisDSP

AurisDSP commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing for personal reasons. Will revisit later.

@AurisDSP AurisDSP closed this May 2, 2026
@AurisDSP AurisDSP reopened this May 30, 2026
@flyinghead
flyinghead merged commit 2c7c687 into flyinghead:master Jun 1, 2026
19 of 21 checks passed
flyinghead added a commit that referenced this pull request Jun 4, 2026
@flyinghead

Copy link
Copy Markdown
Owner

I had to revert this change by fear of starting a religious war.

My personal opinion is that, given the current timing precision of Flycast, reporting 59.94 Hz instead of 60 Hz is ridiculous. But any rational argument is useless when accuracy is elevated to the rank of religion.

@AurisDSP

AurisDSP commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

I understand, sir. Thank you for the clarification

misantronic pushed a commit to misantronic/flycast that referenced this pull request Jun 10, 2026
Aligns the reported core framerate with the typical 60 Hz host display
refresh, eliminating the periodic frame-pacing skip that drift between
59.94 fps content and a 60 Hz monitor produces under strict V-Sync or
Black Frame Insertion (the skip happens roughly every 17 seconds).

PAL (50.0 Hz) is unchanged. The 240p VGA rate is also moved to 60.0
so it benefits from the same alignment. Audio sample rate stays at
44100 Hz; the per-run sample count `sample_rate / fps` adjusts
automatically.

Co-authored-by: jf624708-blip <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>

[ci skip]
misantronic pushed a commit to misantronic/flycast that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants