So you decided to go retro and buy yourself a Commodore 64 and a disk drive. Welcome to the world of retro computing. But now what?
You start by searching the net for how to get software onto the c64. You quickly find out there’s an entire realm of ways to hook up the 1541 to your computer through a variety of cables. Some cables are newer and faster than others, and overall is a confusing mess of documentation.
The other route is to buy an extra piece of hardware that lets you use memory cards, or USB, or something else to replace the disk drive, This will work, but it costs money, and well, it removes the disk drive from the picture! You want to go full retro!
I decided to go a different route. I built a ‘modern’ serial port for the commodore, following the instructions http://biosrhythm.com/?p=1136#comment-35325. Its mentioned there that you don’t need to hook up the VCC line, but in my case, I needed to. Without that VCC line, I was not able to transmit.
Once I had that, I spent a better portion of a day writing a BASIC application to handle a simple file transfer. I probably made this overly complicated, but it does have simplistic error checking (not very good, but better than nothing), and its pretty slow. But it does fit onto a single 64 screen!
A few notes. First, the baud rate is set at 600. Not 300, not 1200. 600. This was the fastest baud I could go at, and reliably transfer files. If you want to try 1200, change the 7 in the first line to an 8. For 300 baud, change it to a 6.
To change the filename, edit line 1000.
In order to send the file from my desktop (A MacBookPro), I used a python application that looks like this:
#!/usr/bin/env python import serial s = serial.Serial("/dev/tty.usbserial-A100TLCU", baudrate=600) # send the command to open the file. s.write("\x01") byte=1 with open("Handyterm.prg", "r") as f: while f: ret = -1 data = f.read(1) if len(data) == 0: break s.write("\x02") # send data command while ret != data: print "sending byte: ", byte s.write(data) print "sedning: ", ord(data) ret = s.read(1) print "rec'ed: ", ord(ret) if ret != data: s.write("\x03") else: byte+=1 break s.write("\x04")
To change the serial port, edit the Serial() line. You’ll also need to change the open() to serve the file you want.
Start the c64 side first, then start the desktop side. The file will be written to disk on the c64 side. If it completes successfully, both sides will exit cleanly. When i was attempting things at 1200 baud, it seems the c64 side would miss a character and ‘lock up’.. At that point, I would have to stop both sides, and do the following on the C64 side:
That will close the file that was being written to, and then delete the incomplete file. You then need to start over.
I would transfer a decent terminal program over first. I tried CCGMS, but that seems to have a buggy Xmodem transfer. Novaterm is too many files to transfer to get working. So I settled on HandyTerm from http://www.zimmers.net/anonftp/pub/cbm/c64/comm/. HandyTerm’s Xmodem seems to work, at least at 300 baud for me (no choice for 600). 1200 failed. I suspect my serial cable is flakey.
Note that you need to transfer .prg files. Compressed files (.arc, zip) and .d64 won’t work.