Author here. The YM2149/AY-3-8910 was the sound chip in the Atari ST, ZX Spectrum 128, Amstrad CPC, and MSX. I spent the past year building a
complete Rust ecosystem for it.
The interesting technical bits:
- Cycle-accurate emulation at clk/8 (~250kHz). This matters because demoscene musicians abused timing-dependent tricks like "SID voice" (rapid
volume register toggling for pulse waves) and "Sync Buzzer" (envelope restarts synchronized to tone periods).
- SNDH files contain native 68000 machine code ripped from Atari ST demos. Playing them required emulating not just the sound chip, but the CPU
and MFP timer chip too.
- AY files have Z80 code from ZX Spectrum games. Another CPU emulator, another memory map.
- The WASM build is ~150KB and includes both CPU emulators.
- Bevy plugin with playlists, crossfading, and per-channel muting for game devs who want authentic retro audio.
slippyvex•47m ago
The interesting technical bits:
- Cycle-accurate emulation at clk/8 (~250kHz). This matters because demoscene musicians abused timing-dependent tricks like "SID voice" (rapid volume register toggling for pulse waves) and "Sync Buzzer" (envelope restarts synchronized to tone periods).
- SNDH files contain native 68000 machine code ripped from Atari ST demos. Playing them required emulating not just the sound chip, but the CPU and MFP timer chip too.
- AY files have Z80 code from ZX Spectrum games. Another CPU emulator, another memory map.
- The WASM build is ~150KB and includes both CPU emulators.
- Bevy plugin with playlists, crossfading, and per-channel muting for game devs who want authentic retro audio.
Blog post with implementation details: https://medium.com/@mvelten773/ym2149-in-rust-part-1-buildin...
Browser demo (select from examples or load your own): https://ym2149-rs.org/demo/
Happy to answer questions about emulation accuracy, the demoscene formats, or Rust/WASM audio.