My finest C64/128 setup so far

Posted on Feb 25, 2024

The C128 is a fascinating and unusual machine. It was the last 8-bit Commodore machine before the Amiga and co-existed with the C64 series for a while. They sold ~8 million units worldwide (vs ~17 million C64). I never owned one, but I fondly remember playing with one at my friend’s place and seeing them in computer shops.

It’s fully 99.8% backward compatible with its predecessor in C64 mode, but in native C128 mode it takes advantage of its 128 KB RAM, higher clocked 2 MHz 6510 variant (the 8502), and the improved VIC-IIe graphics chip.

But that’s not all; the C128 has a second CPU, a Zilog Z80, and a second graphics chip, the VDC (MOS 8563), capable of doing RGBi and 80 columns, enabling running CP/M on the machine.

If you want to know more about the story of how the C128 came out to be, which you should, please see this 8-Bit Guy interview with its hardware designer, Bill Herd; I guarantee it’s well worth the 30 minutes. One of the things worth spoiling from the interview is that Bill and the team were free to design the C128 according to their own ideas; they had no business requirements, so they deliberately made it “weird,” hobbyist-friendly, and hackable.

Anyway, you know where this is going.

I got a C128.

A few months ago, I found a good deal on a used and malfunctioning C128DCR on Amibay, a popular marketplace for Commodore hardware in the retro-computing community, and just couldn’t resist.

The DCR variant comes in a sturdy metal case with an integrated power supply, a 1571 internal drive, and has an external keyboard, mimicking the IBM PCs of the time.

Not so bad, but it needs cleaning. My Compucleaner air duster, a bottle of isopropyl spray, and a toothbrush will do the job.

Much better!

Good to know that the entity 39 tested it.

It turns out that when I turned it on, it worked, kind of.

The video was unstable. I’ve been around C64s long enough to narrow the problem to a faulty VIC-IIe chip. I looked up on eBay and found a replacement, which fixed the issue.

Here it is connected to my 1084S running Monty on the Run.

Upgrades

What comes next is a series of enhancements and upgrades that I did over months, to make this C128DCR the best and my primary C64/128 setup at home.

S-Video Bypass/RF replacement

Despite their unique features at the time, the VIC chips were never known for excellent quality video signals. Artifacts like the jail bars, color bleeding due to inadequate voltages, or noise interference injected by the onboard RF modulators, also not great, have always been issues across multiple machine models and chip revisions. The enhanced VIC-IIe in the C128 is notoriously better than the VIC-II in the C64s but is still not perfect.

One way to improve the video output is to completely bypass the onboard RF modulator by removing it and replacing it with a modern high-bandwidth amplifier circuit. This and using separated Luma and Chroma signals (also known as S-Video), provides noise reduction and a sharper picture.

Video Game Perfection sells a good S-Video Bypass/RF replacement kit that is compatible with the C128. I installed one. The downside of not having the original RF modulator is that you lose, well, the obsolete RF signal to use with very old television sets. Not a requirement I have, at all.

RGBtoHDMI, LumaCode, VICIIdizer

Bear with me; this combination is art.

RGBtoHDMI is a very cool open source and hardware project from David Banks and Ian Bradbury that uses a Raspberry Pi Zero running bare-metal code and a CPLD to convert analog RGB/YUV signals from vintage computers to pixel-perfect HDMI signal with extremely low-latency (~4ms.)

But if latency alone doesn’t blow other scalers like the GBS-8220 out of the water, RGBtoHDMI outputs really sharp edged pixels. From the project wiki:

RGBtoHDMI integer scaling output:

Typical output from other scalers:

In Ian’s words, “it re-samples and re-quantises the incoming video and effectively reconstructs exactly the original bit image present in the RAM of the source computer, it then rescales the image using integer nearest neighbour scaling and applies its own machine specific palette to that image and the end result is noise free and sharp and it makes the output of real hardware look like it’s coming from an emulator.” Here’s a great video where Ian presents the project.

The second part of this combo is LumaCode, an open single-wire protocol created by Reinhard Grafl (aka c0pperdragon) whose goal is to transport video data in a semi-digital form from computers that “do not already expose the video signal in a digitally usable form,” like the C64, and many others from the 70s and 80s.

Reinhard designed multiple boards for different 8-bit computers that sit passively between the computer and their video chips, “sniff” the relevant signals directly from the IC pins and encode the video signal to LumaCode. By interpreting the signals directly from the video chip source and not further down the chain, these boards are more immune to the noise and artifacts introduced by amplifier or modulator circuits. One of those boards is the VICIIdizer128 for the C128.

Finally, you guessed it, at some point in time, the RGBtoHDMI project started supporting Reinhard’s LumaCode input in the firmware. In fact, c0pperdragon now sells a version of the RGBtoHDMI hat that has a ready to use LumaCode cable (or you can just buy this cable too).

Long story short, I bought a VICIIdizer128 and RGBtoHDMI hat, installed it, and now I have super-low-latency crysp HDMI video from my C128 that looks like it’s coming from an emulator.

The other great thing about the VICIIdizer is that it’s a passive board, which means that I can either use the S-Video, LumaCode + HDMI, or both. I assembled and installed everything, here it is in action:

Checkout the c0pperdragon store on Tindie.

MOS 8701 clock generator

The original C64 and C128 clock generator chip, the MOS 8701, I also something I had problems with in the past. The 8701 divides the crystal oscillator frequency and creates the color and dot clock signals, which govern the rest of the system.

TOLB (The Other Little Board) is a low-power, independent (doesn’t need the crystal, has its own oscillator) direct replacement that works both in the C64 and the C128. You can buy them at Amibay. The 8701 usually sits on a socket and replacing it takes seconds.

PLAster128

PLAs (Programmable Logic Arrays) are very sensitive and are one of the first chips to go when things age, so it’s generally a good idea to replace them. Johan Grip has reverse engineered the C128 PLA (MOS 8721) chip a few years ago and published the verilog code in a github repo.

I bought the PLAster128 (now open sourced) from Backbit because initially I wanted to use the BackBit cartridge with the C128 (I changed my mind later, I’ll explain below.)

I had to desolder the original PLA, then added a socket just in case, and finally installed the PLAster128. I don’t need its extra features for the BackBit, so I have them disabled. It just works.

Drive ID switch

C64/128 floppy disk drives are connected through the serial IEC bus. Devices that are connected to the IEC bus are assigned with identification numbers. A lot of software, especially old titles, expects the primary floppy drive to have id #8 and will not boot or work from any other id. Everyone who owned a C64 remembers LOAD “*",8,1 they even have a t-shirt.

The C128DCR comes with an internal 1571 drive in the box that is fixed to id #8. While this is fine for a single disk drive system, it might not be ideal if you are going to use the internal drive in combination with other external drives and want one of those to be the primary drive.

There are ways to reassign the drive numbers using software device managers, but I ended up going for the physical switch mod option.

The solution was simple, I cut one of the jumpers that ground the pins 15 and 16 of the U106 6522 in the PCB, and soldered the pads to two wires and a switch in the back of the C128DCR. I can use that switch to select the id #10 or #8 for the internal drive.

The back now has one switch for the PLAster128 “kernel override” feature (which I don’t need anymore), one switch for the drive id, and a LumaCode out RCA connector.

Expansion port cartridge

The final puzzle piece is adding a cartridge that helps me load software into the computer. Of course, I could use 5 1/4 floppy disks, but it wouldn’t be convenient.

The C64 scene has many expansion port cartridge options, commercial and open source, and most are compatible with the C128 in C64 mode, but I wanted to take advantage of the C128 advanced features, so I tried these three:

Idun for the Commodore 128

“The idun-cartridge uses a Propeller 1 micro-controller to provide a fast hardware interface between the C128 and a Raspberry Pi (“RPi”) that runs a customized Linux OS.”

A came across Idun in a hackaday blog post. Some of its features are:

  • You can use it in C64 mode to load games. It has a nice Arcade app that you can trigger from a switch and lets you select and run games from the Raspberry Pi filesystem, in (almost) any format, instantly.
  • It also supports loading C128 specific applications and games.
  • It has a bunch of tools to run specifically with the Z80 and the VDC, in 40 or 80 columns. It even has a Z80 compiler/assembler if you want to build your own software.
  • It has networking, APIs, you can write applications in Lua that run in Linux and interface with the C128, providing coprocessing functionality.

It comes in the form of a kit that you buy on Tindie. So yes, I bought and assembled one.

I then hooked it up to the C128 and started playing with it. I found an out-of-sync video timing bug in 80 column mode using the VDC which was promptly fixed. The author is very responsive and puts a lot of time into the project, there are regular releases and the Github repos are very active.

Here it is running in C128 80-column mode with the Z80 and VDC.

Overall, the Idun is a versatile cartridge with regular firmware and tool upgrades; it is worth having around and playing with if you own a C128.

BackBit cartridge

BackBit’s advantage is that the cartridge supports 12+ vintage systems out of the box using expansion port adapters; the list includes pearls like the Atari 2600, ZX Spectrum, or Sinclair 1000. Evie Salomon single-handedly founded Backbit and developed all its products.

The reason why I got one is that I can use it not only with the C64/128, but also with all the other 8-bit computers I own. The cartridge is very easy to set up on the C64/C128. It boots instantly, reads your files from the SD card, supports multiple image formats, and is somewhat compatible with the popular EasyFlash cartridge files. Evie publishes regular firmware updates, including bug fixes or new features, and runs an active forum where you can ask questions and get support. Not everything or every game works, but overall, it’s a powerful and convenient C64 companion. I’m pretty sure I’ll be using it with my other 8-bit machines.

Ultimate-II+L

The Ultimate-II+ is my favorite C64/C128 cartridge and the one that is permanently fitted in my C128DCR.

Unlike other cartridges that just load software directly into memory (DMA), the Ultimate-II+ plugs into the expansion port, where it gets its power from and gets access to the system bus, and then connects a cable to the IEC port, just like a regular external 1541 would do. The disk images are still files in the SD card, but from the C64/C128 perspective, the system sees a regular 1541/71 drive connected and regular floppy disks inserted. The cartridge even has a small built-in speaker that emits the real disk drive sounds when it’s operating.

From the documentation, “The main feature of the Ultimate-II+ is a cycle accurate implementation of the Commodore 1541 Floppy Disk Drive. This part of the Ultimate-II+ cartridge thus acts exactly like a real drive. It is not any faster or any slower than a real floppy disk drive.”

As such, this is one of the few systems, if not the only one, that can run games or software that use and abuse the hardware capabilities and specificities and expect a real disk drive. You can’t just run demos like the Wonderland XIV or any software that uses custom or fast loaders without an actual physical drive. But you can, with the Ultimate-II+!

But this is not all. Gideon Zweijtzer, the author, is quite a genius. Since the cartridge also has access to the bus lines, it can do DMA and interrupts, and its FPGA and firmware provides an impressive list of additional features, like:

  • Multiple configurable drive types and ID devices.
  • Real time clock.
  • Stereo SID emulation.
  • 3rd party cartridge emulation support if you want to run an Action Replay. The list is huge.
  • Tape emulation.
  • Modem support, using the ethernet port and emulating a MOS 6551 ACIA chip and a serial port, compatible with terminals like CCGMS.
  • Virtual printer, compatible with most software.
  • It has a REST API that you can use the control your C64/128.
  • Integration with the Assembly64 online database, so that you can find, donwload and run titles directly from the menu, online.
  • And it works great with the C128 in both modes, 64 and in 128.

And finally, the Ultimate can also emulate a REU (RAM Expansion Unit). REUs like the Commodore 1750/1764s used clever primitives to transfer data between their own memory and the C64/128 host system main memory, thus expanding it from 64 or 128K to up to 512KB, kind of. These units are quite rare and expensive.

REUs were popular if you wanted to run productivity software like the GEOS operating system, or CP/M in the C128’s Z80.

Sonic, the Ultimate ultimate test

Yes, Sonic, you read it well. Believe it or not, in 2021 Sonic the Hedgehog was ported for Commodore 64/128. Interestingly, this port requires a RAM Expansion Unit with at least 256KB to deliver all the game graphics, fast scrolling, and non-stop action. Moreover, if the game detects that it’s running on a C128, it will use CPU acceleration for even smoother and faster animations. Truly a work of art and superb engineering.

So Sonic is indeed the ideal candidate to show off my finest C64/128 setup so far. I’m going to boot my C128DCR, download the game from the Assembly64 online database, directly from the Ultimate-II+L menus and run it as if it was on a floppy disk. The game will detect and take advantage of both the Ultimate REU emulation and C128 mode. Here goes, unedited:

Notice the disk drive sounds? They’re coming from the Ultimate-II+ speaker.

Final remarks

I’m very happy with this configuration. It is a beautiful and powerful machine; it works well, it can run every C64 and C128 title I can think of, and the Ultimate-II+ companion cartridge adds an extra layer of features and convenience that are unmatchable.

I hope you enjoyed this blog. There are two things that I want to do now: the first is to explore the GEOS operating system. I remember running GEOS in my old C64 system back then, but the C128 version with REU support should take things to another level. The second thing is running CP/M and CP/M software in Z80 mode. I remember learning Wordstar word processing in a computer class when I was a kid, and I’m pretty sure I can also make it run in this setup.

Expect follow-up blogs.