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: usizeno port selected until the first reset sequence
Implementations§
Trait Implementations§
Source§impl ControllerPort for MultiTap
impl ControllerPort for MultiTap
fn write(&mut self, sel: bool, clr: bool)
fn read(&mut self, sel: bool, clr: bool) -> u8
Source§fn set_pressed(&mut self, port: usize, pressed: u16)
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.fn as_any_mut(&mut self) -> &mut dyn Any
Source§impl DeviceState for MultiTap
impl DeviceState for MultiTap
Source§fn load_state(&mut self, data: &[u8]) -> Result<(), String>
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
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§
impl Freeze for MultiTap
impl !RefUnwindSafe for MultiTap
impl !Send for MultiTap
impl !Sync for MultiTap
impl Unpin for MultiTap
impl !UnwindSafe for MultiTap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more