ControllerPort

Trait ControllerPort 

Source
pub trait ControllerPort: DeviceState {
    // Required methods
    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;

    // Provided method
    fn set_pressed(&mut self, port: usize, pressed: u16) { ... }
}
Expand description

What plugs into the pad port: a 2-button pad, a multitap, a 6-button pad, a mouse.

SEL and CLR are the two lines the console drives ($1000 D0 and D1); the device answers a 4-bit nibble on D3-D0. The SuperGrafx S-EXP port shares the nibble through a mux and exposes output bits 2-7 (add-on).

Required Methods§

Source

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

Source

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

Source

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

Provided Methods§

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.

Implementors§