Skip to content

v0.4.0 — Audio architecture overhaul + PSG boop fix

Choose a tag to compare

@mstan mstan released this 23 Apr 17:43
· 95 commits to master since this release

Production release (Release x64 build, not debug).

What's new

Major audio architecture rework. The recompiled game now drives its own cycle-stamped YM2612 + SN76489 renderer instead of clownmdemu's scanline-synced sampling path.

Fixed

  • Off-tune music (previously drifted from correct pitch over a few seconds of play)
  • Ring-pickup squelches (previously clicked/garbled on every ring grab)
  • Missing DAC — the "SEGA" voice at boot, Green Hill drums, and other PCM samples now play correctly
  • PSG high-frequency clicks (99%+ reduction) via the missing low-pass filter on the PSG output path

Under the hood

  • New `runner/audio/` module: cycle-stamped event queue, YM2612 + PSG renderers, observability layer, mixer
  • 68K / Z80 bus writes to FM and PSG now push cycle-stamped events that the mixer drains each wall frame, advancing the chips with accurate inter-write cycle spacing
  • `runner/audio/observability.c` — output-side debugger (per-frame peak-derivative and RMS tracking, parallel to the CPU-side `rdb_*` system)
  • Paired-capture diff tool: `tools/wav_paired_boop_diff.py`
  • Runtime A/B switch: `--audio-backend=ours|clownmdemu`
  • Repository hygiene: clownmdemu-core submodule returned to clean upstream commit (4de4cb3); all project-specific changes live in `segagenesisrecomp/runner/clownmdemu_patch.patch` applied at cmake configure time, matching sibling recomp projects' vendored-submodule pattern.

Known issues

See `ISSUES.md` in the repo. Extremely infrequent residual boops below the detector threshold; music/SFX quality is solid overall.

Usage

Drop a legally-acquired Sonic 1 ROM (`sonic.bin` or `.md`) anywhere Windows can find it; the exe will prompt for one on first launch.

```
SonicTheHedgehogRecomp.exe <rom.bin> # normal play
SonicTheHedgehogRecomp.exe <rom.bin> --turbo # no-wait (for captures)
SonicTheHedgehogRecomp.exe <rom.bin> --wav out.wav # audio capture
```