pub struct FakeController {
pub nibble: u8,
pub writes: Vec<(bool, bool)>,
}Expand description
Records SEL/CLR and answers a fixed nibble.
Fields§
§nibble: u8§writes: Vec<(bool, bool)>Implementations§
Source§impl FakeController
impl FakeController
pub fn new(nibble: u8) -> FakeController
Trait Implementations§
Source§impl ControllerPort for FakeController
impl ControllerPort for FakeController
fn write(&mut self, sel: bool, clr: bool)
fn read(&mut self, _sel: bool, _clr: bool) -> u8
fn as_any_mut(&mut self) -> &mut dyn Any
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.Source§impl DeviceState for FakeController
impl DeviceState for FakeController
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 FakeController
impl RefUnwindSafe for FakeController
impl Send for FakeController
impl Sync for FakeController
impl Unpin for FakeController
impl UnwindSafe for FakeController
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