Sid Vicious - VIC 20 SID emulation

Basic and Machine Language

Moderator: Moderators

aeb
Vic 20 Drifter
Posts: 26
Joined: Sat Jun 19, 2004 2:06 pm

Sid Vicious - VIC 20 SID emulation

Postby aeb » 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!

User avatar
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Postby carlsson » Mon Dec 18, 2006 2:18 am

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: 515
Joined: Wed Oct 05, 2005 11:10 pm

Postby GreyGhost » Mon Dec 18, 2006 9:15 am

very cool
Rob

User avatar
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Postby vic user » Mon Dec 18, 2006 9:42 am

wow, is "upside down" ever well done!

adam.klotblixt
Vic 20 Newbie
Posts: 9
Joined: Tue Dec 13, 2005 1:22 pm

Postby adam.klotblixt » Sat Dec 30, 2006 3:30 pm

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: 492
Joined: Tue Nov 14, 2006 5:56 pm

Amazing

Postby Victragic » Sat Jan 06, 2007 1:17 am

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

Postby Jaicen » Sat Jan 06, 2007 6:34 am

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: 5451
Joined: Wed Dec 31, 1969 6:00 pm

Postby Jeff-20 » Sat Jan 06, 2007 2:06 pm

Goodness! Amazing!

User avatar
aneurysm
not your PAL
Posts: 178
Joined: Sat Mar 06, 2004 11:06 pm

Postby aneurysm » Sun Jan 07, 2007 7:19 pm

\o/

too bad i know nothing about cross-platform development

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

Postby Jaicen » Mon Jan 08, 2007 4:54 am

You know how to rock a tasty jam tho ;)

User avatar
ral-clan
plays wooden flutes
Posts: 3521
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Postby ral-clan » Mon Jan 08, 2007 6:36 am

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

Postby blackystardust » Sun Jul 08, 2007 10:14 am

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.

User avatar
Boray
Musical Smurf
Posts: 4026
Joined: Mon May 03, 2004 10:47 am

Postby Boray » Sun Jul 08, 2007 11:47 am

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.)

User avatar
Wonder-Boy
Vic 20 Enthusiast
Posts: 187
Joined: Wed Sep 13, 2006 3:04 pm

Postby Wonder-Boy » Thu Jul 12, 2007 9:50 am

@blackystardust

I can download them

User avatar
Boray
Musical Smurf
Posts: 4026
Joined: Mon May 03, 2004 10:47 am

Postby Boray » Thu Jul 12, 2007 10:15 am

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.)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest