Sid Vicious - VIC 20 SID emulation
Posted: Sun Dec 17, 2006 10:40 pm
I wrote a little piece of code which emulates the C-64 SID sound chip on VIC 20. Patched versions of the actual original C-64 music routines are used, only the SID part is emulated by software.
(For patching you need to change SID writes $d400-$d418 to somewhere else, like $03e0-$03f8, and check that the player doesn't overwrite any zeropage locations used by the tone generator)
Here's two examples that run on unexpanded VIC 20 (on NTSC they run a little too slow):
http://www.cncd.fi/aeeben/temp/upside.prg
http://www.cncd.fi/aeeben/temp/zoids.prg
Some sounds recorded from VICE:
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-uuno.mp3
http://www.cncd.fi/aeeben/temp/vic20-si ... dedown.mp3
http://www.cncd.fi/aeeben/temp/vic20-si ... mmando.mp3
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-zoids.mp3
What is emulated?
- Pulse wave (32 widths), triangle, sawtooth, noise
- ADSR envelopes, but decay and release are linear and there's only 8 volume steps
- Pitch accuracy is 1/13th of SID
- Output at 6.1 kHz, 4-bit DAC (through $900e)
The routine uses almost all rastertime (depending on playroutine used) and if there's any cycles free from NMI & IRQ, it runs in a busy loop generating random numbers to improve the noise emulation.
Here's how it's done:
http://www.cncd.fi/aeeben/temp/sidemu_source_v0.zip
This is still very much work in progress, for example most of the patching could be automated. SID players that are located below VIC 20 ROM's need to be relocated, which is a bit more work.
Have fun!
(For patching you need to change SID writes $d400-$d418 to somewhere else, like $03e0-$03f8, and check that the player doesn't overwrite any zeropage locations used by the tone generator)
Here's two examples that run on unexpanded VIC 20 (on NTSC they run a little too slow):
http://www.cncd.fi/aeeben/temp/upside.prg
http://www.cncd.fi/aeeben/temp/zoids.prg
Some sounds recorded from VICE:
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-uuno.mp3
http://www.cncd.fi/aeeben/temp/vic20-si ... dedown.mp3
http://www.cncd.fi/aeeben/temp/vic20-si ... mmando.mp3
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-zoids.mp3
What is emulated?
- Pulse wave (32 widths), triangle, sawtooth, noise
- ADSR envelopes, but decay and release are linear and there's only 8 volume steps
- Pitch accuracy is 1/13th of SID
- Output at 6.1 kHz, 4-bit DAC (through $900e)
The routine uses almost all rastertime (depending on playroutine used) and if there's any cycles free from NMI & IRQ, it runs in a busy loop generating random numbers to improve the noise emulation.
Here's how it's done:
http://www.cncd.fi/aeeben/temp/sidemu_source_v0.zip
This is still very much work in progress, for example most of the patching could be automated. SID players that are located below VIC 20 ROM's need to be relocated, which is a bit more work.
Have fun!