     return;
   }
   dir.rewind();
-  while (tasFile.openNext(&dir)) {
+  FatFile listFile;
+  while (listFile.openNext(&dir)) {
     char name[256];
-    tasFile.getName(name, sizeof(name));
+    listFile.getName(name, sizeof(name));
     lockedPrintln("A:", name);
-    tasFile.close();
+    listFile.close();
   }
   dir.close();
 }

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

    interrupts();
}

static void snesWriteBit()
{
  digitalWrite(SNES_DATA_PIN, (currentSnesFrame & 0x8000) ? LOW : HIGH);
  if (currentSnesFrame & 0x8000)
    LED_HIGH;
  else
    LED_LOW;
  currentSnesFrame <<= 1;
  currentSnesFrame |= 1;
}

static void snesLatchInterrupt()
{
  noInterrupts();
  int haveFrame = (!finished && bufferHasData);
  int len = (console == SNES) ? 2 : 1;
  if (!haveFrame) {
    unsigned char logBuf[2] = {0, 0};
    currentSnesFrame = 0;
    logFrame(logBuf, len, curFrame + 1);
  } else {
    if (console == NES) {
      currentSnesFrame = (inputBuffer[bufferPos] << 8) | 0xFF;
    } else {
      currentSnesFrame = (inputBuffer[bufferPos] << 8) | inputBuffer[bufferPos + 1];
    }
    logFrame(inputBuffer + bufferPos, len, curFrame + 1);
  }
  snesWriteBit();
  if (readTimer() >= frameDuration) {
    startTimer();
    if (haveFrame)
      advanceBuffer(len);
  }
  interrupts();
}

static void snesClockInterrupt()
{
  noInterrupts();
  snesWriteBit();
  interrupts();
}

static void setEEPROM(const String& cmd)
{
  // Write terminator first, so we won't overread (by much) if we die early
  EEPROM.write(cmd.length(), 0);
  unsigned j = 0;
  for (unsigned i = 0; i < cmd.length(); i++, j++) {
    if (cmd[i] == '\\' && cmd[i + 1] == 'n') {
      EEPROM.write(j, '\n');
      i++;
    } else if (cmd[i] == '\\' && cmd[i + 1] == '\\') {
      EEPROM.write(j, '\\');
      i++;
    } else {
      EEPROM.write(j, cmd[i]);
    }
  }
  EEPROM.write(j, 0);
}

static void handleCommand(const String& cmd)
{
  if (cmd.startsWith("M:")) {
