 
 // Concept tester for interfacing with the
 // Gigatron TTL microcomputer
-// Marcel van Kervinck / Chris Lord
-// May 2018
+
+// Select 1 of the platforms
+#define ArduinoUno   1
+#define ArduinoMicro 0
+#define ATtiny85     0
+
+// Select a built-in GT1 image
+const byte gt1File[] PROGMEM = {
+  //#include "Blinky.h" // Blink pixel in middle of screen
+  #include "Lines.h"    // Draw randomized lines (at67)
+};
 
 // The object file is embedded (in PROGMEM) in GT1 format. It would be
 // GREAT if we can find a way to receive the file over the Arduino's

  byte lastByte = -checksum;   // Checksum must come out as 0
  sendBits(lastByte, 8);
  checksum = lastByte;         // Concatenate checksums
  PORTB |= 1<<PORTB5;          // Send 1 when idle
}

void sendFirst(byte value, byte n)
{
  // Wait vertical sync NEGATIVE edge to sync with loader
  while (~PINB & (1<<PORTB4)) // Ensure vSync is HIGH first
    ;
  while (PINB & (1<<PORTB4)) // Then wait for vSync to drop
    ;
  sendBits(value, n);
}


  // Wait for vBlank to start so we're 100% sure to skip one frame and
  // the checksum resets on the other side. (This is a bit pedantic)
  while (PINB & (1<<SER_LATCH)) // ~160 us
    ;
}

