pub struct Movie { /* private fields */ }Expand description
A recorded (or in-progress) TAS movie: a start point plus a per-frame input log.
Implementations§
Source§impl Movie
impl Movie
Sourcepub fn new_power_on(rom_tag: u64, region: MovieRegion, seed: u64) -> Self
pub fn new_power_on(rom_tag: u64, region: MovieRegion, seed: u64) -> Self
Begin a new movie from a fresh power-on.
Sourcepub fn new_branch(rom_tag: u64, region: MovieRegion, system: &System) -> Self
pub fn new_branch(rom_tag: u64, region: MovieRegion, system: &System) -> Self
Begin a new movie (a branch point) starting from system’s current
state, captured via SaveState::capture.
Sourcepub const fn region(&self) -> MovieRegion
pub const fn region(&self) -> MovieRegion
This movie’s recorded region.
Sourcepub const fn start(&self) -> &MovieStart
pub const fn start(&self) -> &MovieStart
This movie’s start point.
Sourcepub fn frames(&self) -> &[MovieFrame]
pub fn frames(&self) -> &[MovieFrame]
The recorded frames so far, in playback order.
Sourcepub fn record_frame(&mut self, frame: MovieFrame)
pub fn record_frame(&mut self, frame: MovieFrame)
Append one frame of input to the recording.
Sourcepub fn set_frame(&mut self, index: usize, frame: MovieFrame)
pub fn set_frame(&mut self, index: usize, frame: MovieFrame)
Overwrite an already-recorded frame (piano-roll editing). No-op if
index is out of bounds.
Sourcepub fn frame_at(&self, index: usize) -> Option<MovieFrame>
pub fn frame_at(&self, index: usize) -> Option<MovieFrame>
The frame at index, if recorded.
Sourcepub fn start_system(&self, rom_tag: u64) -> Result<System, MovieError>
pub fn start_system(&self, rom_tag: u64) -> Result<System, MovieError>
Rebuild the System this movie’s start point describes. For
MovieStart::PowerOn this is a fresh, deterministically-seeded
system; for MovieStart::FromSaveState this decodes the embedded
blob (validated against rom_tag).
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, MovieError>
pub fn decode(bytes: &[u8]) -> Result<Self, MovieError>
Decodes a movie from its binary wire format, without checking it
against any particular ROM yet (see Self::restore for that).