This commit is contained in:
dschmenk 2013-05-27 15:27:40 -07:00
parent 5b488e2001
commit 06e4b5488a
1 changed files with 35 additions and 5 deletions

View File

@ -8,17 +8,47 @@ Apple II Pi works by connecting an Apple II to a Raspberry Pi using a RS232 seri
Installing and configuring the Apple II: You will need an Apple //c or Apple //e w/ SuperSerial Card. An Apple II Mouse is recommended for that full-on retro feel, but not required. Download and install the A2PI.DSK disk image onto a 5 1/4 floppy. ADTPro would be the recommended tool for that operation.
Installing and configuring the Raspberry Pi: Download the a2pid.c to your Raspberry Pi. Compile the daemon with 'cc a2pid.c -o a2pid' and copy the result with 'sudo cp a2pid /usr/bin'. You will need to disable the Raspbain serial login by editing /etc/inittab and commenting out the line (probably at the very bottom) that looks like:
"T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100".
Installing and configuring the Raspberry Pi: Download the a2pid.c to your Raspberry Pi. Compile the daemon with 'cc a2pid.c -o a2pid' and copy the result with 'sudo cp a2pid /usr/bin'. You will need to disable the Raspbain serial login by editing /etc/inittab and commenting out the line (probably at the very bottom) that looks like:<nl>
<code>
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
</code>
To adjust the NTSC output so it fits nicely on my //c monitor, I adjusted the setting in /boot/config.txt such that:
<code>
overscan_left=26
</code>
<code>
overscan_right=-8
</code>
<code>
overscan_top=-8
</code>
<code>
\#overscan_bottom=16<nl>
</code>
To run the a2pid daemon automatically at boot time, edit /etc/rc.local and add:
"a2pid --daemon"
<code>
a2pid --daemon
</code>
right beforw the line:
"exit 0"
<code>
exit 0
</code>
followed by rebooting the Raspberry Pi.
Reboot the Apple II with the newly created floppy in the start-up drive. If everything is configured correctly, you should be able to login to the Raspberry Pi with your Apple II keyboard. If you have an Apple II Mouse, that should control the cursor in X, or in the console if you have gdm installed.
Using a2pi: The Apple //c and //e keyboards are pretty minimal compared to modern keyboards, and the Apple II Mouse only has one button. In order to provide most of the funcitonality required of modern OSes, the Open-Apple and Closed-Apple keys are used as modifiers to enhance the keyboard and mouse. On the keyboard, Open-Apple acts just like the Alt key. The Closed-Apple key acts like a Fn key, changing the actual key codes. Currently, the Closed-Apple key will modify the number keys 1-0 as funciton keys F1-F10 and the arrow keys as Left-Arrow=Home, Right-Arrow=End, Up-Arrow=PgUp, Down-Arrow=PgDn. For the mouse, when you click the mouse button by itself, that is the left(default)-click. Open-Apple along with the mouse button will return the right-click, and Closed-Apple along with the mouse button will return the middle-click. If you should ever need to exit a2pi, press Closed-Apple ESC on the Apple II keyboard. This will exit both the code on the Apple II and the Raspberry Pi. This is useful when develping and debugging the drivers/daemons. a2pid can be run directly (not as a daemon) by leaving off the '--daemon' option. Enabling printf's in the code allows one to watch the packets arrive and get processed when run from a network ssh session.
Using a2pi: The Apple //c and //e keyboards are pretty minimal compared to modern keyboards, and the Apple II Mouse only has one button. In order to provide most of the funcitonality required of modern OSes, the Open-Apple and Closed-Apple keys are used as modifiers to enhance the keyboard and mouse. On the keyboard, Open-Apple acts just like the Alt key. The Closed-Apple key acts like a Fn key, changing the actual key codes. Currently, the Closed-Apple key will modify the number keys 1-0 as funciton keys F1-F10 and the arrow keys as Left-Arrow=Home, Right-Arrow=End, Up-Arrow=PgUp, Down-Arrow=PgDn. For the mouse, when you click the mouse button by itself, that is the left(default)-click. Open-Apple along with the mouse button will return the right-click, and Closed-Apple along with the mouse button will return the middle-click. If you should ever need to exit a2pi, press Closed-Apple ESC on the Apple II keyboard. This will exit both the code on the Apple II and the Raspberry Pi. This is useful when developing and debugging the drivers/daemons. a2pid can be run directly (not as a daemon) by leaving off the '--daemon' option. Enabling printf's in the code allows one to watch the packets arrive and get processed when run from a network ssh session.
Theory of operation: Apple II Pi works by running code on the Apple II and the Raspberry Pi, talking to each other with a simple protocol. The Apple II basically appears to the Raspberry Pi as an external peripheral, not unlike a USB keyboard and mouse. The Apple II floppy boots into ProDOS and runs a simple machine language program that scans the keyboard, and mouse if present, sending the events out the serial port to the Raspberry Pi. It is a very simple protocol and the serial port is running at 115.2K baud, so it is fast and low overhead. On the Raspberry Pi, a little daemon runs, waiting for packets on the serial port, converts the Apple II events into Linux compatible events, and inserts them into the input subsystem.