The timer's NTSC and PAL clock speeds are swapped
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- embedded-iot, testing
Research direction
Start with the timer's two #ifdef branches and Tests/src/testsTimer.hpp, especially timer_from_seconds_builder around line 707. Verify the NTSC 60-frame duration against Mednafen, then add a Capture() test asserting 1000–1006 ms and correct the test comment. Done means the clock values and test expectation match the stated hardware timings.
Written by the indexing model from the issue text.
Description
- What this is: The timer turns hardware ticks into seconds and milliseconds, using the CPU clock of the console's region.
- Problem: The library treats NTSC as 26.6875 / 28.4375 MHz and PAL as 26.8741 / 28.6364 MHz. Mednafen's source has them the other way round: NTSC is 1746818182 / 65 = 26.8741 MHz, and PAL is 26.6875 MHz. So every time value is 0.7% off on both regions. A 10-minute countdown ends about 4 seconds early on NTSC.
- Why the tests missed it: The comment at the top of Tests/src/testsTimer.hpp copies the same wrong numbers. timer_from_seconds_builder (line 707) only checks that High is 3 or 4, which is a ±33% window. Both were written from the code, not from the hardware.
- Fix: Swap the two #ifdef branches (4 lines) and fix the test comment. Add one test that measures 60 frames with Capture(). On NTSC, one frame is 427 dots × 263 lines × 4 CPU clocks, so 60 frames is about 1003 ms; the swapped constants give about 1010 ms. Assert 1000–1006 ms. Check the expected value in mednafen first.
- Dominant language
- C++
- Stars
- 90
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ReyeMe/SaturnRingLib
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ReyeMe/SaturnRingLib#152 ·
-
SpriteLayer::SetOpacity(1.0) writes ratio -1Possibly taken @seven-shades claimed this today. Openbug required hardware test
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
ReyeMe/SaturnRingLib#151 · 1 assignee ·
-
Sprite priority bank 0 is set twice at startupPossibly taken @seven-shades claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ReyeMe/SaturnRingLib#150 · 1 assignee ·
-
VDP2::ClearVRAM never frees background-layer palettes (saturnringlib/srl_vdp2.hpp:1912,1924,1935,1946)Possibly taken @seven-shades claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ReyeMe/SaturnRingLib#148 · 1 assignee ·
-
128- and 64-color palettes can share color memory with other palettes (saturnringlib/srl_cram.hpp:173-264)Possibly taken @ReyeMe claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ReyeMe/SaturnRingLib#147 · 1 assignee ·
All issues in ReyeMe/SaturnRingLib
Similar issues
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ClickHouse/ClickHouse#132519 ·
Maintainers usually reply within 1 day
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
juce-framework/JUCE#1810 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
petercorke/robotics-toolbox-python#952 ·
Maintainers usually reply within 1 day
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusOpenfunc:engine type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#1276 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day