Skip to content

Add VGM logging of YM2608 register writes - #41

Merged
bubio merged 1 commit into
mainfrom
feat/vgm-logging
Nov 22, 2026
Merged

bubio merged 1 commit into
mainfrom
feat/vgm-logging

Conversation

@bubio

@bubio bubio commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • OPNA(YM2608)への書き込みを VGM 1.51 として記録する VGMLogger を追加
  • 待ち時間はエミュレーション時間(T-state)で数えるので、x2 速度やポーズの影響を受けない
  • 曲の途中から録り始めても鳴るよう、開始時に ADPCM RAM と実効レジスタ値(パン・SSG ミキサーの既定値を含む)を書き出す
  • リセット・ステートロードをまたいでも記録を続ける(直前までの時間を保持し、状態を書き直す)
  • PC88.startVGMLogging() / stopVGMLogging(gameName:) と C ABI b88_vgm_start / b88_vgm_is_logging / b88_vgm_stop / b88_vgm_read を追加
  • BootTester は BOOTTEST_VGM で VGM を書き出す

アプリ側は bubio/Bubilator88 の VGM 録音 PR で使います。

Test plan

  • swift test(1144 件パス、VGMLogger のテスト 12 件を含む)
  • 回帰テスト 20 シナリオ PASS
  • 同じ実行で録った WAV と VGM を YM2608Renderer で描画して比較(相関 0.9997 以上)
  • BubiTunes で .vgm / .vgz を再生

🤖 Generated with Claude Code

Machine logs the CPU's writes to the OPNA as a VGM 1.51 stream timed in
emulated T-states, so x2 speed and pauses do not distort the result.
Logging starts mid-song by writing the ADPCM RAM and the chip's effective
register state, and survives resets and state loads by resyncing.

Exposed as PC88.startVGMLogging / stopVGMLogging and the b88_vgm_* C ABI.
BootTester writes a log with BOOTTEST_VGM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bubio
bubio merged commit 7db4af2 into main Nov 22, 2026
3 checks passed
@bubio
bubio deleted the feat/vgm-logging branch November 22, 2026 01:48
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