Skip to content

Export the frame rate and 1.5.0 machine settings through the C API - #19

Merged
bubio merged 1 commit into
mainfrom
feat/frame-rate-capi
Sep 19, 2026
Merged

bubio merged 1 commit into
mainfrom
feat/frame-rate-capi

Conversation

@bubio

@bubio bubio commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add b88_frame_rate (returns PC88.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.
  • Add b88_set_monitor_type / b88_get_monitor_type, b88_set_memory_wait_dip, b88_set_cpu_overclock — public on PC88 but missing from the C API. Monitor type and memory wait must be set before b88_reset (same order as the macOS app's init).
  • Fix 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 Bubilator88C on Windows
  • swift test — 925 tests pass
  • Windows shell built against the new DLL, paced from b88_frame_rate: music tempo confirmed correct on real hardware

🤖 Generated with Claude Code

https://claude.ai/code/session_01XDcDodjGSs9L4P5f6HiBqW

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
@bubio
bubio merged commit 6cb907d into main Sep 19, 2026
3 checks passed
@bubio
bubio deleted the feat/frame-rate-capi branch September 19, 2026 07:05
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.

1 participant