 #define LED_HIGH (CORE_PIN13_PORTSET = CORE_PIN13_BITMASK) //digitalWriteFast(STATUS_PIN, HIGH)
 #define LED_LOW (CORE_PIN13_PORTCLEAR = CORE_PIN13_BITMASK) //digitalWriteFast(STATUS_PIN, LOW)
 
-#define INPUT_BUFFER_SIZE 512 // This is ideal since it allows us to read 256*4/2 = 512 bytes
-// at once. 512 bytes is an optimization for reading the sd card and skips using another buffer.
+#define INPUT_BUFFER_SIZE 2048 // Multiples of 512 are ideal since we can read 256*4/2 = 512 bytes at once.
+// 512 bytes is an optimization for reading the sd card and skips using another buffer.
 
 #define INPUT_BUFFER_UPDATE_TIMEOUT 10 // 10 ms
+
+template<class T> void lockedPrintln(const T& input)
+{
+  noInterrupts();
+  Serial.println(input);
+  interrupts();
+}
+
+template<class A, class B> void lockedPrintln(const A& a, const B& b)
+{
+  noInterrupts();
+  Serial.print(a);
+  Serial.println(b);
+  interrupts();
+}
 
 static char n64_raw_dump[36]; // maximum recv is 1+2+32 bytes + 1 bit
 // n64_raw_dump does not include the command byte. That gets pushed into

  } \
}\

    for (int i = 1; i <= bitcount; i++) {
        while (!N64_QUERY)
          FAIL_TIMEOUT;
        long lowTime = readTimer();
        startTimer();
        while (N64_QUERY)
          FAIL_TIMEOUT;
        long highTime = readTimer();
        startTimer();
        char bit = (lowTime < highTime);
        newByte <<= 1;
        newByte |= bit;


    // Bail if file open failed
    if (!m64OpenSuccess)
        goto end;

    *config &= ~0x000F0000;

