#[non_exhaustive]pub struct ExtraInput {
pub devices: [DeviceInput; 2],
pub microphone: bool,
pub vs_coin: u8,
pub vs_service: bool,
pub disk_side: Option<u8>,
pub barcode: Option<Barcode>,
}Expand description
Every non-controller input of one movie frame. See the module docs.
Default is the neutral machine: no device on either port, microphone
released, no coin, service released, disk ejected, no scan. It is the
baseline the on-disk changes are taken against, not “nothing recorded”
(that is crate::FrameInput::extra being None).
#[non_exhaustive]: build one with Self::capture or Default and
set fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.devices: [DeviceInput; 2]The expansion device on port 0 ($4016) and port 1 ($4017).
microphone: boolFamicom microphone asserted ($4016 bit 2).
vs_coin: u8Vs. System coin acceptors latched: bit 0 = #1, bit 1 = #2.
vs_service: boolVs. System service button held.
disk_side: Option<u8>The inserted FDS disk side (0-based), or None when ejected – and
always None on a cartridge, which has no disk. Side 255 cannot be
stored (its byte means “ejected”); no FDS image comes near it.
barcode: Option<Barcode>A Datach barcode swiped just before this frame (an event: set on the
one frame the scan was made before, None on every other).
Implementations§
Source§impl ExtraInput
impl ExtraInput
Sourcepub fn capture(nes: &Nes) -> Self
pub fn capture(nes: &Nes) -> Self
Read every non-controller input nes holds now. Called by
crate::FrameInput::held_on, after the host’s input calls and
before the frame.
A disk side beyond 254 cannot be stored; no FDS image has that many (a side is 65,500 bytes), and such a side records as ejected.
Sourcepub fn apply(&self, nes: &mut Nes)
pub fn apply(&self, nes: &mut Nes)
Drive nes to these inputs, before the frame runs.
Levels the host sets every frame (devices, microphone, coin, service) are written every frame, as the host wrote them. The disk is changed only when it differs, because inserting a side is an act with consequences (it resets the head and opens the drive’s not-ready window), and a host only does it once. A barcode is swiped when present.
A scan the machine cannot take (no reader) is ignored: the movie’s
board check (crate::Movie::seek_to_start) already refused a
machine without the cartridge it was recorded on.