Close

Keeping up with the Commodore

jb-langstonJ.B. Langston wrote 03/13/2021 at 04:55 • 9 min read • Like

Originally published in 2016.

The Commodore 64 was the first computer that really got me interested in programming. I first used one in my 6th grade classroom while pretending to be sick so I didn’t have to play dodgeball! I never had one of my own; when I asked my dad for one and he gave me his old Heathkit XT compatible instead. Thanks Dad, but CGA graphics and a PC speaker were not what I had in mind! Eventually, I upgraded from the XT to a 386SX with VGA and a SoundBlaster, and moved up from there. Instead of CBM BASIC, I learned to program in GW-BASIC and then QuickBASIC and eventually went on to a fruitful career in computers. But I have had a soft spot for C64 ever since and always wanted one of my own.

Isn’t She a Beaut?

I finally bought my first C64 for $40 earlier this year. Mint condition, it looks like it spent most of its life in the box in a closet. The keyboard is still matte and looks like it never really got typed on. The power supply was DOA with an open primary on the transformer. Luckily failing open meant it didn’t take the C64 with it. I ended up replacing it with separate 5VDC and a 9VAC wall warts that I wired up to the original 7 pin DIN connector. Eventually, I’d like to mount the guts of the wall warts inside the original power supply housing for a bit more authenticity, but I’m not sure how to mount them to ensure they won’t come loose and short out on each other.

Makeshift Power Adapter

Since they don’t tend to like sitting unpowered for years, I went ahead and replaced all the electrolytic caps as the next step in my restoration, but I’m not sure it was really necessary. My mind has probably been warped by all the old tube radios I’ve restored.

The RF modulator wasn’t working, and I had to desolder it in order to replace the caps. I decided not to put it back in yet since my C64 model doesn’t require the it to produce composite video. Instead, I built a my own video cable from a DIN connector and an old AV cable. Sadly, the 5-pin model doesn’t have an external chroma connection, so someday I may wire up one up, similar to this s-video mod, which would improve the picture quite a bit. I’m torn between wanting better video and wanting to preserve the C64 in as close to its original state as possible.

After hooking the C64 up to my LCD TV, it worked, although the video was awful. Initially, I thought something was wrong with it, but after some research, I’m beginning to realize that’s about as good as it gets with composite video and an LCD screen. I recently picked up two 1702 monitors off craigslist, and the video looks much better on them.

The same guy also sold me a couple joysticks, 4 game cartridges, 4 spare CIA chips and 2 spare SIDs. He was also the former editor of Twin Cities 128, a Commodore 128 newsletter, so he threw in three issues of that as well. At $45 for the whole lot, I feel like he gave me a great deal, and he was a really interesting guy to talk to.

The SIDs were rattling around in the bottom of a box without any static protection, so I’m just praying they still work. If they do, I’m going to hook them up to an Arduino and build my own stereo SID player.

Of the cartridge games, Star Post is pretty fun. Kickman is OK as long as you play it on mute; I didn’t know it was possible to make a SID sound that bad! And Tooth Invaders? Wellll, is certainly an interesting historical curiosity. The Epyx 500XJ is an excellent joystick — much better than the Atari 2600 trash I was using before!

Disk Drives: Takes One and Two

Next order of business: I didn’t have a disk drive or tape drive, so I decided to build one. I had an Arduino lying around so I built a 6-pin DIN serial connector and hooked it up to my PC using Uno2Iec. Initially it worked OK and allowed me to load up some basic software but most of the games hung half-way through, and eventually I couldn’t get the C64 to recognize it at all.

A more advanced solution is the sd2iec, which uses an Atmega1284p microcontroller to emulate a Commodore 1541 disk drive and serve disk images off of an SD card. It also supports many of the common fastloaders so it’s compatible with more software. I looked at the pre-made sd2iec drives online but $75 seems a little steep, even if it comes with a cute case made out of genuine recycled 1541 plastic. And besides, what fun is it to buy something pre-made when you can build your own? I built the circuit on a breadboard, and so far it’s working pretty well. Eventually I plan to install the completed circuit in this project box.

Project box prepped for SD2IEC

Another project I hope to complete in the future is wiring up the user port connector to an ESP8266 for use as an internet modem. That’s what the headers in the upper right of my perf board are for. This cheap $2.50 wi-fi enabled microcontroller comes with firmware to emulate classic Hayes AT commands to make TCP/IP connections. This should allow me to connect to the many of the still-active Commodore BBSes.

My biggest disappointment so far was learning that I can’t run most demos and a lot of games on a NTSC model. Sadly, the Europeans have done a much better job of keeping the C64 flame alive than the Americans have, and you need to have a European Commodore to play most of their productions. For those unfamiliar with the demoscene, to this day, coders, artists, musicians, and computer nerds of all stripes still get together for yearly competitions to show off their skills making the C64 do things it’s creators never imagined. Someday I hope to acquire a PAL model so I can watch demos on the real thing. One of my favorite demos of recent years is Uncensored by Booze Design.

Another great demo I just came across is Nothing but Petscii, which shows what a skilled artist can do with nothing but the basic shapes you can type directly from the C64 keyboard.

I’ve been teaching myself 6502 assembly in hopes of one day making my own demo, however rudimentary. I’ve been working my way through Machine Language for the Commodore 64, by the godfather of the C64, Jim Butterfield. I also managed to dig up the source code for his excellent machine code monitor, Supermon64. I’ve been slowly working my way through the code, trying to understand it, and writing comments as I go. It’s been an interesting archaeological dig, and a great learning experience!

I’ve found some great resources online about demo coding, but mostly they just make me realize I’ve got a long way to go before I can call myself a true demo coder, though.

Stay tuned for more about my projects as I continue my journey. I’m also compiling a list of the best C64 resources I’ve found on the web.

Like

Discussions