Skip to main content

MovieFrame

Struct MovieFrame 

Source
pub struct MovieFrame {
    pub swcha: u8,
    pub joy_fire: u8,
    pub swchb: u8,
    pub paddle_pos: [u8; 4],
    pub paddle_fire: u8,
}
Expand description

One frame’s worth of host input — everything a 2600 controller/console panel can drive. Console switches are per-frame fields (not header-level constants) because Select/Reset/Color/Difficulty can all change mid-run on real hardware, unlike a fixed NES controller.

Packed to mirror the RIOT/TIA port-byte conventions rusty2600-frontend::input already established, so the frontend’s InputState -> MovieFrame conversion is a direct reuse of that existing packing logic, not a re-derivation of it.

Fields§

§swcha: u8

Packed joystick directions for both ports, same nibble layout as the RIOT’s SWCHA (rusty2600-frontend::input::Joystick::swcha_nibble): bits 7-4 = port 0 up/down/left/right, bits 3-0 = port 1. Active-low.

§joy_fire: u8

The two joystick fire buttons (TIA INPT4/INPT5, not part of SWCHA): bit 0 = port 0 fire pressed, bit 1 = port 1 fire pressed.

§swchb: u8

Packed console switches, same layout as the RIOT’s SWCHB (rusty2600-frontend::input::ConsoleSwitches::swchb).

§paddle_pos: [u8; 4]

The four paddles’ pot positions (0 full clockwise ..= 255 full counter-clockwise, the TIA INPTx dump-capacitor value).

§paddle_fire: u8

The four paddles’ fire buttons, one bit each (bit N = paddle N).

Trait Implementations§

Source§

impl Clone for MovieFrame

Source§

fn clone(&self) -> MovieFrame

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MovieFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MovieFrame

Source§

fn default() -> Self

The idle frame: no direction/fire/switch pressed. swcha/swchb default HIGH (0xFF), matching real hardware’s active-low pull-ups — a naive all-zero default would instead mean “every direction and switch held down simultaneously,” the opposite of idle.

Source§

impl<'de> Deserialize<'de> for MovieFrame

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MovieFrame

Source§

fn eq(&self, other: &MovieFrame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MovieFrame

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for MovieFrame

Source§

impl Eq for MovieFrame

Source§

impl StructuralPartialEq for MovieFrame

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,