Skip to main content

import_fcm

Function import_fcm 

Source
pub fn import_fcm(
    bytes: &[u8],
    rom_sha256: [u8; 32],
) -> Result<(Movie, LegacyMeta), LegacyMovieError>
Expand description

Import an FCEUX / FCE Ultra legacy .fcm movie.

.fcm is a sparse toggle/delta stream: each record advances some number of frames (emitting the current held controller state for each), then either toggles one button on one controller or issues a console command (Reset / Power / FDS / VS). RustyNES’s FrameInput has no console-command representation, so commands are decoded (so the stream stays in sync) but only affect the frame count, exactly as the .fm2 importer treats MOVIECMD_RESET.

The returned Movie always uses StartPoint::PowerOn; rom_sha256 is the authoritative ROM identity (the .fcm’s embedded MD5 is not validated here).

§Errors

LegacyMovieError for a bad magic / version, a save-state-anchored start, a four-score (>2-controller) update, or a truncated stream. Never panics.