I always wanted to play with the C64 CP/M cartridge, even knowing that it was a total flop and discontinued briefly after release. So I finally decided to try it and bought one from eBay. How bad could it be ?
You can watch the instructional here:
Booting the CP/M
Looks cool eh ? First problem: finding a compatible C64 for it. Yes you read it right: It’s not compatible with all C64’s out there, but only the early models sporting a 5-pin A/V port. Tried on my C64C and it was a roller coaster.
If you plug a slot expander like Xpander-3 and some other cartridges on it it might work on the C64C. But is try and error. Once it boots and shows the prompt screen and a DIR command works, it keeps stable until you reset the machine. Strange eh ?
I can’t explain the reason behind this but adding more hardware would add more parasitic capacitance and noise to the bus. The only thing I know is that it works. It would require a digital probe and record the entire boot to find out what is the real cause.
Since I got tired of trial and error, I just got a cheap 5-pin A/V C64 from eBay. I had to replace the VIC-II because it was dead. But now it works fine and the C64 is stable – if connected direct to the slot. Keep in mind if you replace the VIC-II it must be an early VIC-II chip. Newer ones are reported to not work with the CP/M cartridge. Also adding the Xpander-3 in the old C64 causes the same problems with the C64C. So my idea of using a 80-column expansion won’t be possible.
Expanding the user memory
The disk images I found online are for 44K user memory area. Looking the manual, it’s fairly easy to increase to 48K (the maximum allowed):
MOVCPM * 48 SYSGEN
when running SYSGEN, just skip the disk to load from, it will load from memory and write to the current logged disk. Reboot and you get whopping 48K! There is not much we can do about the RAM: it’s taking account for the Kernal, video + color buffer, the 6510 BIOS and the 8080 BIOS. They all add up to 16K of your precious memory.
But playing a little with it you figure out that there is no addressable cursor support, what means you cannot use full screen apps like Turbo Pascal IDE, VEdit Plus, SuperCalc, etc… and also WordStar needs at least 64 columns to work with.
But not everything is lost, if there is one thing Commodore did right was providing the source code with the disks, so we can modify it.
Software 80 column
Since the expansion issues made it impossible to use an external 80 column cartridge (if there is any besides the BI-80 which is incompatible with the CP/M cartridge anyway) it turns out there is an excellent software 80 column program made by Chris Lampton back in 1984.
And amazingly this program won’t take any byte out of the CP/M addressable memory, instead it installs itself in separate unused areas and the VIC-II graphics mode runs under the Kernal ROM. Pretty neat eh ?
Well almost, using it you find a strange issue: every time you type something you end up getting an echoed spacebar, although the text seems fine.
I dug into the source code and found the culprit. It is the CONIN routine that emulates a software cursor, for every typed character it will print a white space and then a backspace:
CONIN7: PUSH PSW ;SAVE CHARACTER MVI A,1 STA FLASH ;TURN OFF CURSOR MVI C,' ' ;GET SPACE CALL CONOUT ;PRINT SPACE MVI A,9DH ;CURSOR LEFT COMMAND CALL COUT5 ;BYPASS FILTER POP PSW ;RESTORE CHARACTER
Commenting this section out and then you get a functional SOFT80. This change will cause minor cursor issues when in 40 column mode, like the cursor not being deleted when pressing ENTER at the prompt, but you don’t want to use it in 40 columns mode anyway.
SOFT80 has its own ESC codes for cursor addressing which is not compatible with any CP/M machine and also the support for reverse characters is made through a direct memory access called IOBYTE that is not compatible with any CP/M program.
SOFT80 is great but I wish it had a more common terminal than its own and also that it would support reverse characters, insert and delete lines, erase to the end of screen, etc. These commands make the CP/M experience much more pleasant, so I modified and patched SOFT80 adding Kaypro 2X support and default white over black screen.
With this modified version you can grab any Kaypro 2 software and it will work out of the box, except for the half bright and blinking support. I also changed the CP/M boot up sequence to autoload SOFT80 at the boot.
You can get the .D64 files with CP/M, SOFT80 and several applications from here.
Finally running WordStar 3.0
Wordstar 3.0 with all his glory running on a C64:
I implemented all fast screen operations like insert and delete lines, clear to the end of the line. So the usability of the Wordstar here is pretty good. Only the disk access is really slow but this is a chronic C64 feature.
Running SOFT80 on MESS
MESS has support to CP/M cartridge. You just need to launch the mess with the command below:
mess64 -c64 -cart cpm -flop1 ws3.d64
Every disk I provided in my link comes with the CP/M boot and the SOFT80. So you can boot directly from them.
Don’t forget when changing floppies you need to press CTRL+C on prompt to allow CP/M to refresh the file entries. Otherwise the disk is deemed Read Only.
Enjoy your new C64 CP/M…