 #define INPUT_BUFFER_UPDATE_TIMEOUT 10 // 10 ms
 
 #define MICRO_CYCLES (F_CPU / 1000000)
+#define MICRO_BUS_CYCLES (F_BUS / 1000000ULL)
 
 #define MAX_CMD_LEN 4096
 #define MAX_LOOP_LEN 10240
+
+typedef enum Console {
+  N64 = 0,
+  NES = 1,
+  SNES = 2,
+} Console;
+
+static Console console = N64;
 
 static bool skippingInput = false;
 static String inputString;

 */
static void n64_send(unsigned char *buffer, char length, bool wide_stop)
{
  long target;
  LED_HIGH;
  N64_LOW;
  startTimer();

static unsigned long numFrames = 0, curFrame = 0;
static int edgesRead = 0;
static int incompleteCommand = 0;
static volatile unsigned long viCount = 0;

static SdFatSdioEX sd;

static uint16_t currentSnesFrame;

static uint32_t frameDuration = 0;

static uint64_t finalTime = 0;
static uint64_t lastFrameTime = 0;
static int doLoop = 0;

template<class T> void lockedPrintln(const T& input)
{
