             // blast out the pre-assembled array in output_buffer
             n64_send(output_buffer, 4, 1);
 
+            logFrame(output_buffer, 4, curFrame + 1);
+
             if (!haveFrame)
               break;
 
             curFrame++;
-
-            logFrame();
 
             // update input buffer and make sure it doesn't take too long
 

  return totalWritten;
}

static FatFile m64File;
static bool m64OpenSuccess = false;
static bool openM64(const String& path);

//static unsigned int progressPos = 0;
static unsigned long numFrames = 0, curFrame = 0;


  // Initialize SD card
  if (!sd.begin()) {
    Serial.println(F("E:SD initialization failed!"));
    return;
  }
