diff --git a/FM2.html b/FM2.html index b3630092..385b4f25 100644 --- a/FM2.html +++ b/FM2.html @@ -41,123 +41,181 @@

FCEUX uses a new movie file format - .fm2

This differs from the previous FCE Ultra movie format (.fcm) in the following ways:

Format

-

FM2 is ASCII plain text. It consists of several key-value pairs followed by an inputlog section.

-

The inputlog section can be identified by its starting with a | (pipe). The inputlog section terminates at eof. Newlines may be \r\n or \n

-

Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text. Value text is always terminated by a newline, which the value text will not include. The value text is parsed differently depending on the type of the key. The key-value pairs may be in any order, except that the first key must be version.

-

Integer keys (also used for Booleans, with a 1 or 0) will have a value that is a simple integer not to exceed 32bits

- +

FM2 consists of two parts: Header and Input Log.
+ The header is always in ASCII plain text format. It consists of several key-value pairs.
+ The input log section can be identified by it starting with a | (pipe).
+ The input log section can be either in ASCII plain text format or in binary format.
+ The input log section terminates at EOF, unless the length key is specified in header.
+ Newlines may be \r\n or \n.

Header

-

String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.

+

Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text.
+ Value text is always terminated by a newline, which the value text does not include.
+ The value text is parsed differently depending on the type of the key.
+ The key-value pairs may be in any order, except that the first key must be version.

+

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:

+

String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.

+ -

Hex string keys (used for binary blobs) will have a value that is like 0x0123456789ABCDEF...

- -

GUID keys have a value which is in the standard GUID format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B

-

Inputlog

-

The inputlog section consists of lines beginning and ending with a | (pipe). The fields are as follows, except as noted in note C.

+

The input log section consists of movie records either in the form of text lines or in the form of binary data.

+

Text format (default format):

+

Every frame of the movie is represented by line of text beginning and ending with a | (pipe).
+ The fields in the line are as follows, except when fourscore is used.

- - - - + + + +
cport0port1port2commandsport0port1port2
-

Field c is a variable length decimal integer which is a bitfield corresponding to miscellaneous input states which are valid at the start of the frame. Current values for this are

- - - - +

Field commands 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:

+

The format of port0, port1, port2 depends on which types of devices were attached.

SI_GAMEPAD

SI_ZAPPER

SIFC_NONE

- -

Notes

-

There is no key-value pair that indicates the length of the movie. This must be read by scanning the inputlog and counting the number of lines.

-

All movies start from power-on, unless a savestate key-value is present

-

If a fourscore is used, then port0 and port1 are irrelevant and ignored

-

If fourscore, the input types must all be gamepads -

{player1 player2 player3 player4}
+ +

If a fourscore is used, then port0 and port1 are irrelevant and ignored.

+

The input types must all be gamepads, and each input log record must be in the following format:

- - - - - - + + + + + +
cRLDUTSBARLDUTSBARLDUTSBARLDUTSBAport2commandsRLDUTSBARLDUTSBARLDUTSBARLDUTSBAport2
+
{commands, player1, player2, player3, player4, port2}

-

If fourscore is not used, then port0 and port1 are required

-

Emulator framerate constants

-

FCEUX uses these framerate constants:

+

Binary format:

+

Input log section starts with a | (pipe).
+ 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.

+

The first byte of each record stores "commands" bit field.

+ +

The remaining bytes in the record depend on which types of devices are attached to port0 and port1.

+

SI_GAMEPAD

+ +

SI_ZAPPER

+ +

SIFC_NONE

+ +

If a fourscore 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.

+

Notes

+

All movies start from power-on, unless a savestate key-value is present

+

The emulator uses these framerate constants:


-

- subtitle (optional) - a message that will be displayed on screen when movie is played back (unless Subtitles are turned off, see Movie options).

+

- subtitle (optional) - a message that will be displayed on screen when movie is played back (unless Subtitles are turned off, see Movie options)

At frame 1000 the words "Level Two" will be displayed on the screen


-

- guid (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.

+

- guid (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

GUID keys have a value which is in the standard guide format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B


- romChecksum (required) - the MD5 hash of the ROM which was used to record the movie

@@ -152,7 +152,7 @@


Every frame of the movie is represented by line of text beginning and ending with a | (pipe).

The fields in the line are as follows, except when fourscore is used.

-

|commands|port0|port1|port2|

+

|commands|port0|port1|port2|


Field commands 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: