 #define buttonB      64
 #define buttonA      128
 
+/*
+ *  Loader protocol
+ */
+
 #define N 60 // Payload bytes per transmission frame
-
 byte checksum; // Global is simplest
 
+/*
+ *  PS/2 keyboard hookup to Arduino
+ */
+
+#include <PS2Keyboard.h> // Install from the Arduino IDE's Library Manager
+
+PS2Keyboard keyboard;
+
+// Pins for PS/2 keyboard (Arduino Uno)
+const int keyboardClockPin = 3;  // Pin 2 or 3 for IRQ
+const int keyboardDataPin  = 4;  // Any available free pin
+
+// Keyboard
+// Pin  4  PS/2 Data
+// Pin  3  PS/2 Clock
+
+/*
+ *  Setup runs once when the Arduino wakes up
+ */
 void setup()
 {
   // Enable output pin (pins are set to input by default)

// Pin 12  PORTB4 7 vSync  SER_LATCH  0 PAR/SER None
// Pin 11  PORTB3 6 hSync  SER_PULSE 10 CLOCK   11 SRCLK 12 RCLK

// Keyboard
// Pin  4  PS/2 Data
// Pin  3  PS/2 Clock

#include <PS2Keyboard.h> // Install from the Arduino IDE's Library Manager

// Pins for PS/2 keyboard (Arduino Uno)
const int keyboardClockPin = 3;  // Pin 2 or 3 for IRQ
const int keyboardDataPin  = 4;  // Any available free pin

PS2Keyboard keyboard;
#define buttonRight  1
#define buttonLeft   2
#define buttonDown   4

// For example:
//   python sendGt1.py life3.gt1

// Todo/idea list:
// XXX Try higher than 9600 transfer rates again
// XXX Wild idea: let the ROM communicate back by modulating vPulse
// XXX Hardware: Put reset line on the DB9 jack
