Sid Vicious - VIC 20 SID emulation

Basic and Machine Language

Moderator: Moderators

aeb
Vic 20 Amateur
Posts: 67
Joined: Sat Jun 19, 2004 2:06 pm

Sid Vicious - VIC 20 SID emulation

Post by aeb »

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!
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Ah, so it generates a three note sample on the fly? Cool, along with what you'd expect from Aleksi.. Is the Polytracker also feasible to convert, or does it use too much RAM for samples?
Anders Carlsson

Image Image Image Image Image
User avatar
GreyGhost
Vic 20 Nerd
Posts: 525
Joined: Wed Oct 05, 2005 11:10 pm

Post by GreyGhost »

very cool
Rob
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

wow, is "upside down" ever well done!
adam.klotblixt
Vic 20 Newbie
Posts: 9
Joined: Tue Dec 13, 2005 1:22 pm

Post by adam.klotblixt »

Very nice indeed!

I like the Zoids clip, very close to the real thing.

I gather you use the wla_dx assembler?
/Adam
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Amazing

Post by Victragic »

This is exactly the sort of project I was hoping to find someone working on in rediscovering my interest in VIC 20s recently..

It's a very impressive result, and I'll say the 'Commando' soundtrack is spot on as well..

I guess it's possible to get the valiant VIC-I to emulate anything.. (but obviously not everything at the same time!)

Excellent work!

-G
Jaicen
Vic 20 Dabbler
Posts: 98
Joined: Thu May 04, 2006 7:12 am

Post by Jaicen »

Wow that's brilliant!
Seriously, Upside Down is fantastic! Great work for sure. Could it be applied to run sampled music during games? Though you mention it eats up most of the raster time, so i'm guessing that's a no?
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Goodness! Amazing!
aneurysm
not your PAL
Posts: 178
Joined: Sat Mar 06, 2004 11:06 pm

Post by aneurysm »

\o/

too bad i know nothing about cross-platform development
Jaicen
Vic 20 Dabbler
Posts: 98
Joined: Thu May 04, 2006 7:12 am

Post by Jaicen »

You know how to rock a tasty jam tho ;)
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

The idea of emulating a SID on a VIC (and the fact that it can actually be done) is one of the most incredible things I've seen lately (and I've seen a lot of amazing VIC-20 things since joining DENIAL). 8)
blackystardust
Vic 20 Newbie
Posts: 12
Joined: Sat Jan 14, 2006 6:31 pm

Post by blackystardust »

I know it has been a while since this topic first appeared, but I just got wind of it now. I can't seem to be able to download any of the files, does anyone else still have them or has an alternate link to them.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Seems I missed this thread too...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Wonder-Boy
Vic 20 Enthusiast
Posts: 187
Joined: Wed Sep 13, 2006 3:04 pm

Post by Wonder-Boy »

@blackystardust

I can download them
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I can't
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Post Reply