pub trait AyPortDecode: Debug {
    const PORT_MASK: u16;
    const PORT_SELECT: u16;
    const PORT_DATA_READ: u16;
    const PORT_DATA_WRITE: u16;

    fn is_select(port: u16) -> bool { ... }
    fn is_data_read(port: u16) -> bool { ... }
    fn is_data_write(port: u16) -> bool { ... }
    fn write_ay_io<T, R, A, B>(
        ay_io: &mut Ay3_891xIo<T, R, A, B>,
        port: u16,
        data: u8,
        timestamp: T
    ) -> bool
    where
        A: AyIoPort<Timestamp = T>,
        B: AyIoPort<Timestamp = T>,
        R: AyRegRecorder<Timestamp = T>
, { ... } }
Expand description

A helper trait for matching I/O port addresses for AY-3-8910.

Required Associated Constants§

A mask of significant address bus bits for port decoding.

A mask of address bus bit values - for the register selection function.

A mask of address bus bit values - for the reading from the selected register function.

A mask of address bus bit values - for the writing to the selected register function.

Provided Methods§

Return true if the port matches the register selection function.

Return true if the port matches the register reading function.

Examples found in repository?
src/bus/ay.rs (line 273)
272
273
274
275
276
277
    fn read_io(&mut self, port: u16, timestamp: Self::Timestamp) -> Option<(u8, Option<NonZeroU16>)> {
        if P::is_data_read(port) {
            return Some((self.ay_io.data_port_read(port, timestamp), None))
        }
        self.bus.read_io(port, timestamp)
    }

Return true if the port matches the register writing function.

A helper for writing data to one of the functions decoded from port address.

Examples found in repository?
src/bus/ay.rs (line 281)
280
281
282
283
284
285
    fn write_io(&mut self, port: u16, data: u8, timestamp: Self::Timestamp) -> Option<u16> {
        if P::write_ay_io(&mut self.ay_io, port, data, timestamp) {
            return Some(0)
        }
        self.bus.write_io(port, data, timestamp)
    }

Implementors§