Skip to main content

InputDevice

Enum InputDevice 

Source
pub enum InputDevice {
    Zapper(ZapperState),
    Vaus(VausState),
    PowerPad(PowerPadState),
    SnesMouse(SnesMouseState),
    FamilyKeyboard(FamilyKeyboardState),
    FamilyTrainer(PowerPadState),
    SuborKeyboard(FamilyKeyboardState),
    KonamiHyperShot(KonamiHyperShotState),
    BandaiHyperShot(BandaiHyperShotState),
}
Expand description

An optional non-standard device overlaid on a controller port. When set, the bus’s $4016/$4017 read path returns this device’s byte instead of the standard controller / Four Score serial byte.

Variants§

§

Zapper(ZapperState)

NES Zapper light gun.

§

Vaus(VausState)

Arkanoid “Vaus” paddle.

§

PowerPad(PowerPadState)

NES Power Pad / Family Fun Fitness mat (12 buttons).

§

SnesMouse(SnesMouseState)

SNES-style serial mouse (Hyperkin / Nintendo), D0 serial-out.

§

FamilyKeyboard(FamilyKeyboardState)

Famicom Family BASIC keyboard (72-key matrix on $4017).

§

FamilyTrainer(PowerPadState)

Bandai Family Trainer mat (v1.3.0 Workstream F1). Layout-equivalent to the PowerPad: the Famicom mat reuses the exact 12-button parallel-in/serial-out scan (it differs only in the expansion- port wiring vs the NES controller-port Power Pad), so the same PowerPadState drives it.

§

SuborKeyboard(FamilyKeyboardState)

Subor keyboard (v1.3.0 Workstream F1). A Family BASIC keyboard work-alike (the Subor clone matrix), reusing the same FamilyKeyboardState 9 x 8 matrix scan.

§

KonamiHyperShot(KonamiHyperShotState)

Konami Hyper Shot (v1.3.0 Workstream F1): a 4-button (2-player Run/Jump) parallel-read expansion controller.

§

BandaiHyperShot(BandaiHyperShotState)

Bandai Hyper Shot / Exciting Boxing punching bag (v1.3.0 Workstream F1): an 8-sensor expansion controller multiplexed into two groups.

Implementations§

Source§

impl InputDevice

Source

pub const fn write_strobe(&mut self, value: u8)

Forward a $4016 strobe write to the device (only the Vaus latches on it; the Zapper ignores it).

Source

pub const fn read(&mut self) -> u8

Read the device byte (already bit-positioned), advancing any internal shift register.

Source

pub const fn peek(&self) -> u8

Side-effect-free sample of the device byte (debugger peek).

Trait Implementations§

Source§

impl Clone for InputDevice

Source§

fn clone(&self) -> InputDevice

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 InputDevice

Source§

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

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

impl Copy for InputDevice

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> Same for T

Source§

type Output = T

Should always be Self
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.