Expand description
FCEUX .fm2 movie interop: import + export of FCEUX’s plain-text TAS
movie format to and from the native Movie type.
.fm2 is ASCII text (see ref-proj/fceux/documentation/fm2.txt): a block
of key value header lines (the first of which must be version 3),
followed by an input-log section whose every line begins and ends with a
| (pipe). The movie length is implicit – it is the number of input-log
lines (FCEUX .fm2 note A).
§Scope and deliberate limitations
- Standard gamepads only.
RustyNES’s input model here maps FCEUXSI_GAMEPADports ontoFrameInput. Aport0/port1declaring a zapper (SI_ZAPPER = 2) is rejected withFm2Error::Unsupportedrather than silently mis-mapped. - Power-on start only. A
savestate-anchored.fm2is rejected on import (cross-emulator save-state blobs are not portable), and aStartPoint::SaveStateMovieis rejected on export. Both surfaceFm2Error::Unsupported. - Two controllers stored.
FrameInputmodels players 1 and 2 only. Afourscore.fm2(four pads) is imported by keeping pads 1 and 2 and dropping pads 3 and 4; the fourscore flag is preserved inFm2Metaso the caller is not silently misled. (TODO: carry P3/P4 onceFrameInputgrows beyond two ports.) - Soft reset has no home on
FrameInput. The per-frame command field’sMOVIECMD_RESETbit (value 1) is parsed without error but is not applied to any frame today; seeimport_fm2.
§The RLDUTSBA pad order (a classic footgun)
Each gamepad field is exactly eight characters. Per FCEUX, the column
order is the deliberately-reversed RLDUTSBA = Right, Left, Down, Up,
sTart, Select, B, A (kept for back-compat with FCEUX’s first release). So
character index 0 is the Right button and index 7 is the A button. A
character of ' ' (space) or '.' means released; any other character
(conventionally the button’s own mnemonic letter) means pressed.
This module is no_std-clean: it uses only core + alloc.
Structs§
- Fm2Export
Opts - Options the caller supplies on export that the
Movieitself does not carry. Mirrors the extra header fields surfaced byFm2Metaon import. - Fm2Meta
- Header metadata parsed from an
.fm2that has no home onMovieyet.
Enums§
- Fm2Error
- Errors produced by
.fm2import / export.
Constants§
- FM2_
VERSION - The only FCEUX
.fm2format version this module understands.
Functions§
- export_
fm2 - Serialize a
Movieto.fm2text. - import_
fm2 - Parse
.fm2text into aMovieplus the leftover headerFm2Meta.