     screen.println(version);
     
     screen.stroke(255,0,0);
+
+    m64File.seek(0x018);
+  
+    // Open header
+    if (m64File.read(&numFrames, 4) != 4) {
+        m64File.close();
+        screen.println(F("Failed to read frame count"));
+        return false;
+    }
   
     // Get header size
     switch(version) {

#define NEXT 2
#define SELECT 3

#define SERIAL_BAUD_RATE 9600

#define N64_PIN 8
#define N64_HIGH DDRB &= ~0x01


    m64OpenSuccess = true;

    numFrames = min(numFrames, (m64File.size() - m64File.position()) / 4);

    Serial.write("N:");
    Serial.println(numFrames);
 
    return true;
}
