Tuesday, June 17, 2014

First words and a new skin

With Max the work experience student we pushed ahead today and got the C65GS living inside the case of a dead C64C, and added a few missing features, most notably $D418 now works for digital audio (still no SID voices for now).

I had previously tried using a Keyrah v2 with the C65GS, but the keyboard layout was completely bananas.  It turns out I must have mis-read the instructions, and had one of the jumpers wrong.  With that fixed, we were able to use the keyrah with the FPGA board.

From there it was fairly easy sailing to get the board sitting inside a C64 case, although there are cables coming out of all sorts of holes, and in some cases going back into other holes.  USB goes from the keyrah in the C64 power socket location to the FPGA's USB port to connect them together.  Actual power comes in via a USB cable in the cassette port.  Audio comes out via the RF hole using a 3.5mm audio jack.  micro-SD card is accessible via the cassette port.  VGA lead snakes out of the expansion port.  Clearly this will all need to be tidied up over time.

With all of that together, it was mostly working.  The Keyrah uses a different keyboard layout from my rather arbitrarily chosen one, so I needed to fix the usb keyboard decoder in the C65GS.  Getting a Mac or Linux box to actually tell me the right scan codes for each key proved tricky.  So instead I modified the FPGA config so that $D6F6 and $D6F7 contain the full 12-bit scan code for the last key pressed or released.  With that I was able to walk through each key and get the right scan codes.  I am now compiling those into the FPGA config.

But even with the slightly wonky keyboard layout in the meantime, it is possible to drive the machine to do simple things.  So we wrote a little program that plays some digital audio out through the newly implemented interface.  In the following video you can see the C65GS in its shell, including loading and playing the digital audio:

Because we are using the keyrah interface (for now), there is no convenient way to reset the machine.  So I am also rebuilding the FPGA config with logic that interprets a long press on RESTORE to cause a reset, similar to some other C64 mods and replacement main-boards that are available.  We will see how that works tomorrow, all going well.

1 comment: