C64 Video Decoding: Intro
| 4 minutes

Some time ago, the power switch of my vintage Ancona CL 861/80 monitor broke. The monitor would only stay on for as long as the power switch was being kept pressed down. Needless to say, this was quite annoying. The monitor is already way past its expiration date and I know it’s CRT and associated high voltage electronics won’t last forever. That the power switch would prove to be the weakest link did come as something of a surprise, though.

The venerable Ancona CL 861/80. The cover for its picture controls went AWOL in the ’80s.

The venerable Ancona CL 861/80. The cover for its picture controls went AWOL in the ’80s.

A replacement for the original switch was nowhere to be found online. What did turn up were some brand new power switches for CRT television sets. These looked similar enough to be useful, except that the holes for the mounting screws were positioned differently. Luckily, a friend of mine happened to have a 3-D printer. After a day or so of design iterations and test prints, we came up with a custom bracket and push rod to fit the new switch into the monitor. Worked like a charm!

With its new switch, the monitor will have a few good years ahead of it yet. However, it was clear that it was time to start looking for an alternative. I wanted to use my desktop LCD monitor with my C64, which meant I had to find a way to convert the video signal of the C64 to HDMI somehow.

The signal found on the 8-pin DIN video output connector of the C64 is similar to S-video, although the C64 pre-dates the S-video standard by 5 years. In fact, people have been able to connect their C64 to an LCD TV with an S-video input using a simple adapter cable.

This suggests it may be possible to convert the C64 video signal to HMDI by using an S-video to HDMI converter. Assuming these actually exist. Google showed Chinese-made S-video to HDMI converters could be purchased online for about $100,-. While not exactly cheap, I was tempted, because these looked to be a plug-and-play solution. They could even sample the audio output and incorporate it into HDMI signal!

So, I went ahead and bought a composite / S-video to HDMI converter manufactured by the Chinese company HD video processing. The device looked well engineered and came in a sturdy metal casing. And it almost worked. Unfortunately, about once a second the LCD monitor would lose sync. It would go dark, and then it would almost immediately regain sync and come back on again. Which meant that although it came very close to being an ideal solution, the converter was basically completely unusable for the purpose.

Composite / S-video to HDMI converter.

Composite / S-video to HDMI converter.

It wouldn’t be fair to put the blame on the converter, though. The C64 outputs something that is almost an S-video signal carrying an approximately standard PAL video stream. I simply hoped neither the converter nor the monitor would notice. But as they say, hope is nothing more than delayed disappointment.

Of course, the only reasonable way forward was to figure out the details of the C64 video signal and attempt to build a better-suited converter from scratch. This quickly escalated into a multi-year adventure that involves PAL video decoding, Rigol oscilloscope automation, PCB design using KiCad, hand-soldering SMD components, VHDL coding, generating HDMI on an FPGA, Dear ImGUI, and more. So don’t touch that dial folks, we’ll be right back…

This post is the first in a series about C64 video decoding. Posts will be linked here as they become available.

Posts in this series:

  • Introduction (this post)
  • Signal acquisition
  • Decoding luma
  • Decoding chroma
  • The 1-Hz prototype
  • Custom video ADC board (luma only)
  • Video decoding in C++
  • Decoding luma on the FPGA with HDMI output (640x480p @ 59.94 Hz)
  • Custom video ADC board – Mark II (luma and chroma)
  • Faster software decoding
  • Decoding luma and chroma on the FPGA

We will be developing a custom video ADC add-on for the QMTech Artix-7 Wukong Board. This FPGA development board is well suited to the topic of this series. It features a Xilinx Artix-7 XC7A100T FPGA (-2 speed grade), plenty of GPIO pins, and an HDMI port. That being said, it is certainly possible to modify the designs to work with other FPGA development boards. All source code, schematics and PCB designs will be open-sourced.

Custom video ADC board (Mk II) installed on the QMTech Wukong board.

Custom video ADC board (Mk II) installed on the QMTech Wukong board.