MultiTap

Struct MultiTap 

Source
pub struct MultiTap {
    pub pads: Vec<Option<Box<dyn ControllerPort>>>,
    pub clr_high_reads_pad: bool,
    pub counter: usize,
    /* private fields */
}
Expand description

The Turbo Tap: a counter picks which of five ports answers.

[hw: pcetech 4] The counter increments on each SEL 0 -> 1 transition while CLR is low and resets on a CLR 0 -> 1 transition with SEL high; after the fifth it answers $0 until reset; an empty port answers $F.

C10: pcetech says that right after the reset write ($03: SEL and CLR high) D3-D0 already show pad 1’s directions; the pce-devel table puts CLR high on every port at that moment, which would read 0. clr_high_reads_pad selects pcetech’s reading (tier 2, the default).

Fields§

§pads: Vec<Option<Box<dyn ControllerPort>>>§clr_high_reads_pad: bool§counter: usize

no port selected until the first reset sequence

Implementations§

Trait Implementations§

Source§

impl ControllerPort for MultiTap

Source§

fn write(&mut self, sel: bool, clr: bool)

Source§

fn read(&mut self, sel: bool, clr: bool) -> u8

Source§

fn set_pressed(&mut self, port: usize, pressed: u16)

The host’s side: the buttons held on pad port (0 for a pad plugged straight in, 0-4 behind a multitap), as the bit mask of pads.rs.
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

impl DeviceState for MultiTap

Source§

fn save_state(&self) -> Vec<u8> ⓘ

Everything of the device that changes as the console runs.
Source§

fn load_state(&mut self, data: &[u8]) -> Result<(), String>

Put the device in a saved state. A device without state accepts only an empty one.
Source§

fn state_identity(&self) -> String

What the device is and which media it holds (a card’s ROM by its SHA-1, a disc by its table of contents): a state is refused by a system whose device answers otherwise.

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> 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, 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.