After I had upgraded the Commodore 128 with JiffyDOS and made some tweaks, it was time to turn my attention to the Commodore 64c (the new slim version). This one desperately needed JiffyDOS as well, but I also had other, more sinister plans for it.
Back in the day you could get an official C64 with a Danish keyboard layout. I gather most countries had their own national version, but being Danish, obviously I was mostly interested in the Danish version.
The Danish C64 came with some stickers on the keys, had a different character generator ROM and also a different kernal that was modified to support the new keyboard layout.
So I had two ideas for this C64c - I wanted JiffyDOS, but I also wanted Danish characters. And it should ideally be possible to swap either of them out using two toggle switches.
Problem 1 - obtain the Danish character generator ROM and kernal. For once Google let me down. The Danish ROMs were not to be found anywhere, not on zimmers.net FTP mirror of the old FUNet archive, not anywhere.
Having obtained the ROM images, first point of order was to send them off to Bo Zimmerman, for inclusion in the CBM archive for future generations to enjoy. It pleases me immensely that they can now be found on the 'net, both the character generator and kernal.
Problem 2 - JiffyDOS is a kernal replacement and has the normal keyboard layout. Using the Danish character generator alone with JiffyDOS wouldn't be enough - I'd have Danish characters but they'd be hard to get at. So I had to modify JiffyDOS to get both JiffyDOS and a Danish layout at the same time. JiffyDOS works by replacing the tape and disk IO routines with new, faster disk IO and a useful DOS wedge, but the rest of the kernal is intact, so I figured the keyboard layout tables were probably in the same place.
Time to see if this theory held up.
Basically I wanted to transplant the changes made to the Danish kernal over to the JiffyDOS kernal. Some useful tools for this task are bsdiff and bspatch, available for most Linux distros and also in Cygwin for Windows. First I had to make a patch file that contained the diff between the regular C64 kernal and the Danish C64 kernal:
$ bsdiff kernal.901227-03.bin kernal.901227-03-DK.bin kernal.901227-03-DK.bin.patch
Now I had a very small file called kernal.901227-03-DK.bin.patch that contained the changes necessary to the C64 kernal to get a Danish keyboard layout.
Then I replayed those changes on top of the JiffyDOS C64 kernal and hoped for the best:
$ bspatch JiffyDOS_C64_6.01.bin JiffyDOS_C64_6.01-DK.bin kernal.901227-03-DK.bin.patch
No complaints from the tools at least. But did it work? Well, there's a couple of ways of finding out. You could load up the kernal and character generator in VICE. Or you could skip ahead and burn some EPROMs. I was feeling fairly confident this would work just fine, so I skipped checking things in VICE.
By now I had four different kernals - normal, Danish, JiffyDOS and Danish JiffyDOS. I had two different character ROMs - normal and Danish. I should be able to burn all these to two EPROMs, replace the originals and use two toggle switches - one for JiffyDOS and one for Danish.
The C64c ROM is 16 KiB and consists of the BASIC ROM followed by the kernal. I wanted to switch in four different kernals but I didn't want to replace the BASIC ROM. In order to achieve that, I was going to have to duplicate BASIC four times, like so:
$0000 - basic.901226-01.bin
$2000 - kernal.901227-03.bin
$4000 - basic.901226-01.bin
$6000 - kernal.901227-03-DK.bin
$8000 - basic.901226-01.bin
$A000 - JiffyDOS_C64_6.01.bin
$C000 - basic.901226-01.bin
$E000 - JiffyDOS_C64_6.01-DK.bin
With this layout, pulling A15 high switches in JiffyDOS and pulling A14 high switches in the national character layout.
I turned to the command line to create the 64KiB image for burning into the EPROM:
C:\>copy /b basic.901226-01.bin+kernal.901227-03.bin+basic.901226-01.bin+kernal.901227-03-DK.bin+basic.901226-01.bin+JiffyDOS_C64_6.01.bin+basic.901226-01.bin+JiffyDOS_C64_6.01-DK.bin c64c_64KiB.bin
And again to create the new character ROM:
C:\>copy /b characters.901225-01.bin+characters.901225-01-DK.bin chargen.bin
No turning back
The Commodore 64c appeared fairly late, well after the original C64's release, and as such all bugs had been ironed out and the production costs were reduced by removing all unnecessary parts. The case simply snaps together, no screws needed. I think that's pretty neat, especially when you like to tinker. What isn't so neat is that almost all IC sockets have also been removed. Only the SID retains a socket, presumably as it was still prone to failure.
But the ones I was interested in, the two ROMs, they were not socketed.
I have to admit I absolutely hate desoldering ICs with my limited equipment. The risk of damage to the board is simply too great. If it's something good, like RAM or custom ASICs, I'll probably give it a shot, but these guys? ROMs that are abundant and can easily be recreated using drop-in replacements? Sorry fellas, I'm going to cut you from your pins and desolder the pins one by one.
Having brutally and irreversibly removed the ROMs, it was time to install some IC sockets.
The kernal IC socket was easy, it's just a normal 28 pin, 27128 compatible IC. The character generator, however, was not as easy, it's a 24 pin, 2732 compatible IC. The 2732 is pretty difficult to come by (and with only 4 KiB it isn't capacious enough to hold two character ROMs anyway), but it is fairly easy to pose as one using a 2764 or larger, and that's what you generally do by building an adapter. I built such an adapter and installed it, now I could use a regular 28 pin EPROM for my character generator ROM.
The rest was easy and well-known. For the JiffyDOS switch, a 4.7k pull-up resistor is necessary between pin 28 (VCC) and pin 1 (A15) on the kernal EPROM, the switch goes between pin 1 and pin 14 (GND) and pulls A15 low when closed.
The character set switch requires a pull-up resistor between pin 28 (VCC) and pin 2 (A12) on the character EPROM. A wire should be soldered between the character EPROM's pin 2 (A12, controls character set) and the kernal EPROM's pin 27 (A14, controls keyboard layout), as these two address lines must be switched at the same time. The second switch goes between the character EPROM's pin 2 and pin 14.
When mounting the EPROMs in their sockets, the kernal EPROM's pin 1 and pin 27 should not make contact with the socket, ideally they should be bent out slightly and not cut off, so the EPROM can be reused another time. The same goes for the character EPROM's pin 2.
As I had the case open anyway, I also installed a reset button. All that remained was to drill some holes for the switches, fit them and close the case back up.