FRS fileformat
--------------

frs is the movie capture format used by FBA shuffle.

It is almost identical to the earlier fr format used by blip's rerecording build.
FRS file format description FRS file consists of a header, followed by an optional save state chunk,
followed by a frame data chunk, then a metadata chunk.

File Header format:
000 4-byte signature: 46 42 31 20 "FB1 "
004 1-byte int: movie flag (1 = record from start)
005 4-byte little-endian unsigned int: major revision of libburn
00D 4-byte little-endian unsigned int: minor revision of libburn

Save State Chunk format:
000 4-byte chunk identifier: 46 53 31 20 "FS1 "
004 4-byte little-endian unsigned int: size of this save state chunk in bytes, not including the chunk identifier
008 4-byte little-endian unsigned int: version of FB this was saved from
00C 4-byte little-endian unsigned int: minimum FBA version required to load NV data
010 4-byte little-endian unsigned int: minimum FBA version required to load All data
014 4-byte little-endian unsigned int: size of the compressed saved data (not including header size or padding)
018 32-byte possibly-unterminated ASCII string: Name of the game
038 4-byte little-endian unsigned int: number of frames that have already been emulated before recording started
03C 12 bytes: reserved, set to 0
048: the compressed save data

Frame Data Chunk format:
000 4-byte chunk identifier: 46 52 31 20 "FR1 "
004 32-byte possibly-unterminated ASCII string: Name of the game
004 32-byte null-terminated ASCII string: Application version
024 4-byte little-endian unsigned int: size of this frame data chunk in bytes, not including the chunk identifier
028 4-byte little-endian unsigned int: number of recorded frames
02A 4-byte little-endian unsigned int: rerecord count
02E 8 bytes: reserved, set to 0
036: frame input data. The format varies depending on which inputs the game supports and may be compressed (unknown).
Reset is always a possible input, although the value that means Reset will be different depending on the game.

Meta Data Chunk format:
000 4-byte chunk identifier: 46 52 31 20 "FRM1"
004 4-byte little-endian unsigned int: size of the metadata in bytes, not including the chunk identifier or this integer
008 string of little-endian 2-byte wide characters of locale-dependant encoding: author information

Notes The format does not indicate a framerate, but it is assumed to always be 60 frames per second.



Cheat file format
-----------------

Cheat files must be placed in the cheats subdirectory (or the directory which you configured in path dialog),
and named according to the sort name file containing the ROMs, with the extension being .xml (e.g. dino.xml).
FBA shuffle will present a warning and some additional info whenever it encounters
an error in a cheat file, and will stop processing the file at that point.

Root element:
<shufflecheat></shufflecheat>

Include another cheat file:
<include>filename</include>

Define a cheat:
<cheat desc="description" type="n" default="n">
	<option desc="option1"/>
	<option desc="option2">
		<parameter cpu="n" address="0xff0000" value="0x01"/>
		<parameter cpu="n" address="0xff0001" value="0x02"/>
	</option>
</cheat>

desc="description": Text displayed in the cheat dialog.

type="n": Specify cheat type (optional, defaults to 0)
type 0 = apply each frame, save original value and remain active;
1 = one-shot, fire and forget;
2 = one-shot, save original value and remain active.

default="n": Set default option to n (0 <= n <= 95).

<option desc="option1"/>: Add an option, called "option1".

<parameter cpu="n" address="0xff0000" value="0x01"/>
Store byte value "0x01" at address "0xff0000" in the address space of CPU "n".
(Only M68K CPUs are supported ATM.)
