Emulating A Complete Commodore 64

When the Commodore 64 was released in 1982, it was a masterpiece of engineering. It had capabilities far outstripping other home computers, and that was all due to two fancy chips inside the C64. The VIC-II, the video chip for the C64, had sprites and scrolling, all stuffed into a single bit of silicon. The SID chip was a complete synthesizer on a chip. These bits of silicon made the C64 the best selling computer of all time, but have also stymied efforts to emulate a complete C64 system on a microcontroller.

[Frank Bösing] has just managed to emulate an entire C64 on a Teensy 3.6. The Teensy uses an exceptionally powerful microcontroller, but this is a labor of love and code.

The inspiration for this project comes from a reverse-engineered SID chip that was ported to the Teensy 3.2. The SID chip is the make it or break it feature of any C64 emulation, but the Teensy 3.2 didn’t have enough RAM for the most recent versions of reSID. With the release of the Teensy 3.6, [Frank] figured the increased amount of RAM would allow a complete C64 system, so he built it.

The new C64 emulator uses a Teensy 3.6, with a small add-on ‘shield’ (or whetever we’re calling them) to provide connectors for joysticks and the Commodore IEC bus. There’s audio out, support for USB keyboards, and support for an IL9341 SPI display or a regular ‘ol VGA display.

The entire development of this Commodore emulator has been documented over on the PJRC forums, and all the code is over on GitHub. It’s a fantastic piece of work, and as the video (below) shows, this is a real Commodore 64 that fits in your pocket.

34 thoughts on “Emulating A Complete Commodore 64

      1. No, The C64 did not need the disk-drive – in fact most people would manage well with only a tape-drive.
        But yes, the disk-drive were intelligent (about the same CPU with less RAM as the C64 itself), and could be used similar to an SQL database, so it was really easy to make advanced programs in BSAIC on the C64.

        1. I think it’s in Europe that most C64 did not have a disk drive, i’m Canadian and I’ve never seen a store selling C64 games on anything but disk, American magazines also offered disks, either with the magazine or on order.

      1. I beg to differ. The monitor is definitely an essential part of the system. I imagine a 4k monitor and a bigass air core inductor hand wound to perfectly mimic the magnetic field of crt’s of the era in a 3D printed casing. It must be a high resolution monitor to be able to replicate the rgb segments.

  1. “The Teensy is an exceptionally powerful microcontroller”
    I think NXP/Freescale didn’t rename their Kinetis (Teensy 3.6 is using K66) microcontroller family. Therefore Teensy is just the brand name of the development system. There are way more powerful microcontrollers.

  2. How the hell is 32 kB of RAM insufficient for SID emulation? What kind of hell am I living in? The SID has just a few registers, a few internal state registers and that’s all. The only place where you may need a bit of memory is for applying some filters…
    Reading this makes my eyes bleed.

    1. After a brief look at the ReSid sources, it seems it uses big lookup tables to generate waveforms, which would be a good things because the SID sounds didn’t consist in pure waves: its flaws made its sound that distinctive.

        1. Yes and no. the counters make the ideal triangle and sawtooth wave samples but the DAC inside and the analog circuits where flawed. and of course the filters. and also the filters where controlled by some DAC-values that had a huge variation from sid to sid. these non-linear DAC behaviours need to be emulated somehow. one approach is a ram-lookup-table – especially when speed optimization is an issue. but this could also be used as a new feature to implement wave-table synthesis extension.

    1. There is the VICE emulator for almost everything Commodore, which uses the same base SID emulator code as this project, so if that’s available for Linux on the particular ARM architecture used in rPi’s, then it’d be easier than you’d expect.

  3. Aside from the video output, it really lacks the “look and feel” of the C64.
    It needs a similar looking enclosure, maybe a “hat/shield/bonnet/bone/”(or whetever [sic]we’re calling them)” that will slip over a keyboard.

  4. Back in the day I was doing Commodore 64 development, we had an IEEE bus adapter and a “professional grade” Commodore dual 1.2 Mbyte floppy setup. Those 1.2 Mbyte floppies were like solid state drives compared to the awful 1541 floppy drive, very fast, very reliable, very expensive. We had a hot office with no A/C and the 1541 drives would die all the time, even with fans attached to them. Also Commodore used some sort of shellac in the manufacturing process which was a terrific bug attraction, and our office was directly above a pizza restaurant, so my system had to be opened up and cleaned out on a regular basis to remove the accumulated dead cockroaches. The Commodore programming manual was very good but no match for the excellent “De Re Atari” documentation for the Atari 800.

  5. One of the first boards I ever made for my Apple //e was an card with the commodore SID chip on it. Thinking back probably could have made a mint if I would have sold them.

    1. Yay!
      I got one of those after reading about them in an article here on HaD, I hadn’t heard of them before then.
      There’s also the new C64 mini. Like the NES mini, SNES mini of recent years it’s also an emulator in a box, but it’s the first one I’ve been tempted to purchase.

    2. Because it is just one of many and because it’s not a good one. Bad SID (no filters! filters is what makes the SID special!) and a lot of quirks and flaws.

      There are several much better efforts out there, both in software and (programmable) hardware.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.