Apple IIc Workflow
I recently bought an Apple IIc off of ebay to convert into a USB keyboard. If you didn’t know, model A2S4100 Apple IIc’s have a special keyswitch that only came in that model. It’s like a Cherry MX blue, but much heavier. Anyway, I started thinking about it and I realized that it would be a pretty impractical keyboard, and that it would actually be more fun just to use the computer. My Commodore 64 never really worked right, so this would be the first 6502 computer that I could really use. After working on designing a 6502 based computer, I became somewhat familiar with 6502 assembly, so after the obligatory “Hello, World!” in BASIC, I got to work writing in assembly.
The Apple IIc (and IIe, same thing) have a lot of pre-written subroutines stored in ROM, so you don’t have to program everything by yourself like you might think. A list of all of these, and examples of their use, can be found in this book: Assembly Cookbook for the Apple II/IIe . Look at page 216 for an example program which lists all of them and their addresses.
The machine I bought on ebay came with the keyboard, psu, monitor, and an external disk drive. The IIc also has a disk drive built in. The problem with this is that they are all 5.25” drives, and I do not have any disks of that size. I also bought a classic macintosh a few years ago, and to interface with that I bought a device called the Floppy Emu, which uses SD cards to hold disk images. This also works for the Apple II, and uses the same connector. One fancy feature is that it can emulate Smartport hard drives, which can go all the way up to 32MB! The regular disks would normally be 140k, so that is a major upgrade. Even cooler is the fact that these can be daisy chained together. With one SD card, I can have 3 32MB images that I can switch between from the computer, no need to push any buttons on the emulator. To get the software, I downloaded some images from the apple II vintage download section of apple-2.com. I got the Merlin Assembler image and the 32MB image.
With those loaded onto the SD card, the computer boots up and I can run the Merlin assembler to write my own programs in assembly! I used this for a little bit, but it can get kind of annoying with how slow the machine is, and it would be nice to be able to write and test programs on my laptop. With two more pieces of software, this is easily done.
The first program is called Apple Commander. This program can read almost any disk image file, including the weird *.2MG files that are the Hard Drives. You can import, export, and read files from the disk image. One thing to note is that if you export text files from the disk to a windows computer, which I am using, the line endings will all become CR LF, which messes everything up. I use Notepad++ to go in and change them back to CR, or “Macintosh”. The other software that I’m using is AppleWin, an Apple II emulator for windows. It doesn’t support the Apple IIc, but the IIe is essentially the same thing. You can have 2 floppy disks and 2 hard drives with this emulator. I set the hard drive files to be the ones on the SD card, so now once I insert the card, I can load up the emulator and it boots up just like the real machine. It is much faster than the real hardware, and is also in color.
Once in the emulator, I can write and run software just like I am using the real machine. Once I am done, I can quit the emulator and it saves the disk images back to the SD card. From there I can eject it and throw it back into the machine and make sure it works there too. The emulator and hardware are almost identical, but there are a few subtle differences. One that I have noticed is in the KEYSTROBE memory location. This location holds the value of the last key pressed in ASCII. When a key is pressed down, it holds that ASCII value plus 128. In the emulator, this works just like you would think. When using the real hardware though, if a key is pressed down, it will briefly show the value of the last key pressed plus 128 before quickly showing the value of the new key plus 128. This means that when I want to change direction in a game for example, the first time I hit the new key it will not move. I haven’t noticed anything other than that so far.
Well that is it so far! I have been having a lot of fun pretending I’m back in 1986 learning how computers work. This is the kind of stuff that got me interested in Electrical Engineering to begin with, so it’s awesome to finally be able to experience it for myself.