Sega Master System / Mark III / Game Gear|
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew
PSG VGM playback on an ATmega8Posted: Tue Nov 20, 2018 12:26 pm
I thought I'd share a project I've been working on for the past few weeks.
I've simulated the Master System's sound chip on an 8-bit microcontroller (ATmega8), and put the code up on GitHub for anyone that wants to have a play around with it.
A few shortcuts are taken to make things easier, such as using 8-bit registers on the AVR instead of the 10-bit registers in the real hardware, and the smallest time between register updates is 1/60s. The two lost bits of counter resolution result in tones being just slightly more out of tune than they otherwise would.
I've thrown a handful of VGMs at it, and they all seem to play fairly well, other than being cut short if they were too long to fit in the micro's 8K of flash.
The sound is output on a single PWM pin on the microcontroller. This is then amplified and low-pass filtered before going to a speaker.