<p>Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text.<br>
Value text is always terminated by a newline, which the value text does not include.<br>
The value text is parsed differently depending on the type of the key.<br>
The key-value pairs may be in any order, except that the first key must be version.</p>
<p>Integer keys (also used for booleans, with a 1 for true and 0 for false) must have a value that can be stored as int32:</p>
<ul>
<li><b>version</b> (required) - the version of the movie file format; for now it is always 3</li>
<li><b>emuVersion</b> (required) - the version of the emulator used to produce the movie</li>
<li><b>rerecordCount</b> (optional) - the rerecord count</li>
<li><b>palFlag</b> (bool) (optional) - true if the movie uses PAL timing</li>
<li><b>NewPPU</b> (bool) (optional) - true if the movie uses New PPU</li>
<li><b>FDS</b> (bool) (optional) - true if the movie was recorded on a Famicom Disk System (FDS) game</li>
<li><b>fourscore</b> (bool) true if a fourscore was used. If fourscore is not used, then port0 and port1 are required</li>
<li><b>port0</b> - indicates the type of input device attached to the port 0. Supported values are:
<ul>
<li>SI_NONE = 0</li>
<li>SI_GAMEPAD = 1</li>
<li>SI_ZAPPER = 2</li>
</ul>
</li>
<li><b>port1</b> - indicates the type of input device attached to the port 1. Supported values are:
<ul>
<li>SI_NONE = 0</li>
<li>SI_GAMEPAD = 1</li>
<li>SI_ZAPPER = 2</li>
</ul>
</li>
<li><b>port2</b> (required) - indicates the type of the FCExp port device which was attached. Supported values are:
<ul>
<li>SIFC_NONE = 0</li>
</ul>
</li>
<li><b>binary</b> (bool) (optional) - true if input log is stored in binary format</li>
<li><b>length</b> (optional) - movie size (number of frames in the input log). If this key is specified and the number is >= 0, the input log ends after specified number of records, and any remaining data should not be parsed. This key is used in fm3 format to allow storing extra data after the end of input log</li>
</ul>
<p>String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.</p>
<li>by convention, the first token in the comment value is the subject of the comment</li>
<li>by convention, subsequent comments with the same subject should have their ordering preserved and may be used to approximate multi-line comments</li>
<li>by convention, the author of the movie should be stored in comment(s) with a subject of: <b>author</b></li>
<li><b>subtitle</b> (optional) - a message that will be displayed on screen when movie is played back (unless Subtitles are turned off, see Movie options)
<li><b>guid</b> (required) - a unique identifier for a movie, generated when the movie is created, which is used when loading a savestate to make sure it belongs to the current movie</li>
GUID keys have a value which is in the standard GUID format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B
<p>Field <b>commands</b> is a variable length decimal integer which is interpreted as a bit field corresponding to miscellaneous input states which are valid at the start of the frame. Current values for this are:</p>
Every frame of the movie is represented by a record of a fixed length which can be determined by the devices on port0 and port1.<p>
<p>The first byte of each record stores "commands" bit field.</p>
<ul>
<li>bit 0 = Soft Reset</li>
<li>bit 1 = Hard Reset (Power)</li>
<li>bit 2 = FDS Disk Insert</li>
<li>bit 3 = FDS Disk Select</li>
</ul>
<p>The remaining bytes in the record depend on which types of devices are attached to port0 and port1.</p>
<h4>SI_GAMEPAD</h4>
<ul>
<li>1 byte added to the size of record</li>
<li>bits of the byte represent the state of buttons (bit0 = A, bit1 = B, bit2 = Select, bit3 = sTart, bit4 = Up, bit5 = Down, bit6 = Left, bit7 = Right). If the bit is set, respective button is considered to be pressed, if the bit is clear, the button is not pressed</li>
</ul>
<h4>SI_ZAPPER</h4>
<ul>
<li>12 bytes added to the size of record</li>
<li>1st byte - the x position of the mouse</li>
<li>2nd byte - the y position of the mouse</li>
<li>3rd byte - 1 if the mouse button is pressed; 0 if not</li>
<li>4th byte - an internal value used by the emulator's zapper code</li>
<li>bytes 5-12 (uint64) - an internal value used by the emulator's zapper code</li>
</ul>
<h4>SIFC_NONE</h4>
<ul>
<li>0 bytes added to the size of record</li>
</ul>
<p>If a <b>fourscore</b> is used, then port0 and port1 are irrelevant and ignored. 4 bytes are added to the size of record. The bits of the 1st byte represent the state of buttons of the 1st joypad (bit0 = A, bit1 = B, bit2 = Select, bit3 = sTart, bit4 = Up, bit5 = Down, bit6 = Left, bit7 = Right); bits of the 2nd byte represent the state of buttons of the 2nd joypad, and so on.</p>
<h2>Notes</h2>
<p>All movies start from power-on, unless a savestate key-value is present</p>
<p>The emulator uses these framerate constants:</p>