Export the frame rate and 1.5.0 machine settings through the C API - #19
Merged
Merged
Conversation
runFrame() stops at the top of the CRTC's next frame, which is 55.42Hz on a 24kHz monitor and 62.42Hz on a 15kHz one. A C API host had no way to read that, so the Windows shell kept pacing at 60Hz and ran everything — CPU and YM2608 timers, so music tempo too — about 8% fast. b88_frame_rate returns PC88.frameRate, to be re-read every frame the way the macOS app does. Monitor type, the memory wait DIP and the CPU overclock were also public on PC88 but missing from the C API. The first two decide the reset geometry and waits, so their doc comments say to set them before b88_reset. All additions; no existing signature changes. b88_run_frame's comment no longer says 1/60s. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDcDodjGSs9L4P5f6HiBqW
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
b88_frame_rate(returnsPC88.frameRate). Since 1.5.0 Step 3 a frame is 55.42Hz (24kHz) or 62.42Hz (15kHz), never 60Hz; the Windows shell had no way to read it, kept pacing at 60Hz and ran ~8.3% fast — music tempo included.b88_set_monitor_type/b88_get_monitor_type,b88_set_memory_wait_dip,b88_set_cpu_overclock— public onPC88but missing from the C API. Monitor type and memory wait must be set beforeb88_reset(same order as the macOS app's init).b88_run_frame's stale "1/60s" doc comment.All additive; no existing
b88_*signature or behaviour changes. No emulation code touched.Test plan
swift build -c release --product Bubilator88Con Windowsswift test— 925 tests passb88_frame_rate: music tempo confirmed correct on real hardware🤖 Generated with Claude Code
https://claude.ai/code/session_01XDcDodjGSs9L4P5f6HiBqW