Hacker News new | ask | show | jobs
by xmcqdpt2 1067 days ago
I have a physical SID chip and I was looking at implementations of players and ... was shocked at how complicated they are. I guess it makes sense though: SID files are tiny because they are in effect full C64 native programs that generate music. It would be hard to do otherwise on that platform.

I wrote a simple program that transformed basic (60hz, no PCM-style hacks) SID programs to like sequence of byte instructions for the SID chip so that I could replay without emulating and the file sizes are massive compared to the original!

Here is an awesome single file SID player written in C,

https://github.com/mlund/csid/blob/master/csid.c

1 comments

Oh, wow! Such a compact cpu routine! Thanks for the link.

I wrote mine in C too and it's basically a 1k line switch statement for every 6510 instruction :) I went the extra mile and made it cycle-accurate though.

libsidplayfp is probably the best emulator out there. It actually emulates voltage levels at one stage. The wiki has a bunch of info on SID reverse engineered from die shots https://github.com/libsidplayfp/SID_schematics/wiki