pub trait FrameState {
// Required methods
fn current_frame(&self) -> u64;
fn set_frame_counter(&mut self, fc: u64);
fn frame_tstate(&self) -> (u64, FTs);
fn current_tstate(&self) -> FTs;
fn set_frame_tstate(&mut self, ts: FTs);
fn is_frame_over(&self) -> bool;
}Expand description
The trait for reading and modifying the state of frame and cycle counters.
Required Methods§
Sourcefn current_frame(&self) -> u64
fn current_frame(&self) -> u64
Returns the value of the current execution frame counter. The FrameState implementation should count passing frames infinitely wrapping at 2^64.
Sourcefn set_frame_counter(&mut self, fc: u64)
fn set_frame_counter(&mut self, fc: u64)
Sets the frame counter to the specified value.
Sourcefn frame_tstate(&self) -> (u64, FTs)
fn frame_tstate(&self) -> (u64, FTs)
Returns a normalized frame counter and a T-state counter as a tuple.
T-states are counted from 0 at the start of each frame. This method never returns the T-state counter value below 0 or past the frame counter limit.
Sourcefn current_tstate(&self) -> FTs
fn current_tstate(&self) -> FTs
Returns the current value of the T-state counter.
Unlike in FrameState::frame_tstate, values return by this method can sometimes be negative as well as exceeding the maximum number of T-states per frame.
Sourcefn set_frame_tstate(&mut self, ts: FTs)
fn set_frame_tstate(&mut self, ts: FTs)
Sets the T-state counter to the specified value modulo <Self as Video>::FRAME_TSTATES_COUNT.
Sourcefn is_frame_over(&self) -> bool
fn is_frame_over(&self) -> bool
Returns true if the value of the current T-state counter has reached a certain arbitrary limit which
is very close to the maximum number of T-states per frame.