Apple IIgs Java
Posted: November 17, 2015
So Joe Davisson started extending Java Grinder to support the W65C816 as a CPU for with target platforms of first the W65C265SXB dev board, then Apple IIgs, and hopefully soon also Super Nintendo. I helped him out by writing some code using Google Go to create bootable Apple II disk images. The source code for Java Grinder, the demo below, and the Apple II disk image creator is all available on github.
Since Joe had already extended Java Grinder to create a Java demo on the Commodore 64 he already had a pretty good head start with the W65C816 (considering the W65C816 is a 6502 with 16 bit extensions).
Related Projects @mikekohn.net
Below is the demo compiled out of the samples/apple_iigs directory. The demo was written in Java and compiled using javac against a jar file filled with empty methods for all the API calls. The .class files that are generated are then run through Java Grinder which transforms the Java byte-code into a single native W65C816 source file which is then assembled with naken_asm.
Start of the demo running in the Mess emulator. https://youtu.be/kahpsCyrBwE
Years ago someone gave me an Apple IIgs that I had turned on once or twice and then put in storage in a closet. Never thought I'd find any real use for this thing. I set it back up so I could make this video of the demo running on a real Apple IIgs. https://youtu.be/3d7jONblTF4
To transfer the demo to the Apple IIgs, I bought a NULL modem cable from Retro Floppy. I wrote this small program in Apple BASIC:
10 D$ = CHR$(4)
On the Linux side, I wrote a small program that would take the .bin file produced by Java Grinder and send it over the serial port 300 baud by taking each byte, splitting into 4 bit nybbles, and sending each nybble added with 'A' so that it's always something ASCII being sent over the wire. I believe if it sends a 0, all kinds of awful stuff happens. On the Apple IIgs side, before I could run the program I have to press Ctrl-Apple-Esc and change the default baud rate to 300. I tried to change it programmatically with PR#2 (notice some missing line numbers above?), but it was doing weird things. I eventually got sick of doing that and switch the software to the default 1200 baud.
git clone https://github.com/mikeakohn/apple2_disk_utils.git
Copyright 1997-2023 - Michael Kohn