A Complete C64 System, Emulated on an STM32

The Commodore 64 is the worlds bestselling computer, and we’re pretty sure most programmers and engineers above a certain age owe at least some of their career to this brown/beige keyboard that’s also a computer. These engineers are all grown up now, and it’s about time for a few remakes. [Jeri Ellisworth] owes her success to her version, there are innumerable pieces of the C64 circuit floating around for various microcontrollers, and now [Mathias] has emulated everything (except the SID, that’s still black magic) in a single ARM microcontroller.

On the project page, [Mathais] goes over the capabilities of his board. It uses the STM32F4, overclocked to 235 MHz. There’s a display controller for a 7″ 800×480 TFT, and 4GB of memory for a library of C64 games. Without the display, the entire project is just a bit bigger than a business card. With the display, it’s effectively a C64 tablet, keyboard not included.

This is a direct emulation of the C64, down to individual opcodes in the 6510 CPU of the original. Everything in the original system is emulated, from the VIC, CIAs and VIAs, serial ports, and even the CPU of the 1541 disk drive. The only thing not emulated is the SID chip. That cherished chip sits on a ZIF socket for the amazement of onlookers.

You can check out some images of the build here, or the video demo below.

41 thoughts on “A Complete C64 System, Emulated on an STM32

  1. Good on him for leaving the SID alone.

    Even if you could emulate it (which you can), I don’t know why you’d want to. This is actually a really nice build, therefore, cue the “but that’s too professional to be a hack!” crowd.

  2. Didn’t somebody create the C64 SID in an FPGA a while back? Imagine running an ARM softcore + display controller + SID all in one FPGA, now that would be compact! ;)

  3. Nice emulator but Commodore 64 is the worlds bestselling computer, really? Maybe woulds best selling 1980s home computer. And outside America it was nowhere near as influential as it was in the USA.

        1. Ok… I’ll give you the refinement gravitarnonsense originally stated: “best selling 1980s era computer”

          But still.. its all in how you define things. Many people still hold distinctions which, no matter how illogical, make some sort of sense. If you consider the ipad a “personal computer” then so is your cell phone. Tech types recognize that on the inside its all the same, and that these days, a cell phone, a tablet, a laptop and a desktop pc are all pretty much the same (and thus all ‘true personal computing devices’) but others think what a thing ‘is’ based on how and what you use it for. A computer (desktop/laptop) is a computer, a tablet is a tablet, and a phone is a phone. And an ipod is a music player. Not a computing device. Semantics.

          And I define an ipad as a POS so.. yeah.. C64 still the best selling computer of all time!!!
          (fanboy nostalgia trolling)

    1. influential outside US…err… Europe? In Europe, the C64 was EVERYWHERE. And still has the largest Demoscene. And its official software lifecycle ended in 1993. Not bad for something incompatible to anything else on the market, but well… you wouldn’t wanna buy anything else back then anyway.

  4. Growing up in England mid 80’s, there were really two competitors for best home computer after discounting the Amstrad CPC464. The Sinclair Spectrum 48K and Commodore C64. I owned both and although in some ways the C64 was better than the Spectrum, it was not as popular. I only ended up keeping it to play Pitstop II, the spectrum was simply better for mucking around with (and if a game did not load, you could try it from a different cassette recorder).
    If I look back at what my schoolmates had at the same time, only two others had a C64, one had a C16 and 6 had ’48K Speccys’.
    The local watch and clock repair shop also sold games and had in excess of double the games available for the Speccy than the C64 because he sold more.
    So although interesting, I found Ben Hecks ‘Zee Ex’ build more interesting.

    1. Well England had its own thing going on.. sort of.. ya know.. an island. ;)
      BBC really pushed for the home grown national computer.
      England and Japan were very much similar in that regard.
      England does not equal Europe though… where the C= pretty well dominated.

  5. The SID isn’t black magic, it’s just analog oscillators. Now what we need is a crowd sourced fab run, of course it still would not be the same (woefully dated) process, and I’m sure the original was run on a few fabs.

          1. Well another chip thath will sell well if manufactured again will be the spectrum ULA’s, maybe whit the ULA+ (enached color) opition build in ! For 10/15$ i will buy it.

        1. SID probably made in NMOS technology not even sure if you can replicate that on the fab that do CMOS. What about your CAD files, test plan? Another question is how good is your design skill? Do you stuff works first time as making chip is as expensive as it can get and you don’t get too many chances to redo and have to have long waits?

          If you want more accurate sound, throw enough horse power at emulation with a modern ARM or DSP and call it a day.

    1. Well – the SID had digital oszillators inside. So the waveform generation was completely digital. This is very easy to replicate. But there where also analog parts in it. The designer of that chip had no time to build a better analop opamp in it and this is the reason why the analog filters are different from chip to chip. they wanted to improve that from version to version but the original designer left MOS and founded his on company (ensoniq – i think).
      and the other designers had obviously not a clue how to fix that (with a few exceptions).
      thats the reason why the comodore amiga did not have a sid or advanced sid in it – only sampling – which was also nice.
      making digital circuits and oszillators and adsr-curves is not difficult but understanding analog filters – measuring their behavour and transposing it in a digital filter (fir or iir) is not a task that everyone can do.
      i think this is something that i should give a look :-)
      then we could make the sid completely digital with an i2s-interface for a good DAC and S/P-DIF-out.

  6. So why is the SID so hard to reproduce? You’d think, given the niche yet relatively strong demand for SIDs, someone would have decapped it, reverse-engineered it and reproduced it 1:1. Commodore ain’t around to enforce copyright, either – and many fabs wouldn’t care anyway.

    1. Indeed – there are die shots on this page: http://sid.kubarth.com/

      The chip’s characteristic sound is a result of the analog components in the package. No two SID chips sound 100% identical as a result. Getting a fab to make a modern replacement is not going to match the same methods used in the 1980s – and it’d be an expensive journey, too! Not saying it’s not doable – but even between “identical” revisions of SID (6581, 8580) MOS couldn’t get the two to sound alike, so a hobbyist on the side is going to be having a tough struggle.

      IMO it’s getting well into audiophile territory here, but that’s the way it is. People are so picky about it that they actually got Rob Hubbard’s original C64 to record some of his tunes for a CD, as they would sound different than having your own C64 play back the .sid tunes.

      And then there’s SOASC, if you hate emulation and gotta have the original tunes played on original hardware. http://www.6581-8580.com/

    2. I wondered the same. Rather than asking in this case, I thought it would be more fun to do a little Googling. (At least for me, it was.)

      The Cliff’s Notes version: The early SIDs were a rushed design, and had some flaws in the analog parts of the chip, that would become noticeable when the chip was used in very specific ways. Rather than hating the flaws, programmers embraced and intentionally exploited them, using some like a guitar player uses distortion effects. Another was found to allow playing low-fidelity sampled audio, though the SID didn’t officially support that. And so on.

      Because these flaws were analog, they’re hard to convincingly simulate digitally. Do it wrong, and it’s more obvious than the difference between a transistor and tube amp, or anything audiophiles might argue over. Sampled audio that might have been tweaked carefully in an old game to be at the right volume relative to music, might be almost inaudible in less than a perfect emulation; so much so, that even later official hardware revisions of the SID suffered this issue.

      (Disclaimer: I’ve never owned a C64, and have no personal experience to draw on. Please correct me if I’ve made any serious errors.)

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s