     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) {

            n64_send(n64_buffer, 3, 0);
            interrupts();
            screen.println(F("Controller identified"));
            break;
        case 0x01:
            // If the TAS is finished, there's nothing left to do.
            if (finished)
                break;
        
            // blast out the pre-assembled array in n64_buffer
            n64_send((byte *) (inputBuffer + bufferPos), 4, 0);
            interrupts();

            // update input buffer and make sure it doesn't take too long
            updateTime = micros();

            // Record if it took longer than expected
            updateTime = micros() - updateTime;
            if (updateTime > INPUT_BUFFER_UPDATE_TIMEOUT * 1000) {
                screen.print(F("Input buffer update took too long ("));
                screen.print(updateTime / 1000);
                screen.println(F(" ms)"));
            }

            curFrame++;

            if (curFrame == numFrames && !finished && 0) {
              screen.println(F("TAS finished playing"));
              Serial.println("C:");
              finished = true;
              Serial.flush();
            }

/*            if (!finished)
              curPos = (curFrame * screen.width()) / numFrames;
            screen.fill(255,0,0);
            while (progressPos < curPos) {
              screen.point(progressPos++, screen.height() - 1);
            }
            screen.fill(255,255,255);*/

            break;
        case 0x02:
            // A read. If the address is 0x8000, return 32 bytes of 0x80 bytes,
