pub trait ParallelPortDevice {
    type Timestamp: Sized;

    fn write_data(&mut self, data: u8, timestamp: Self::Timestamp);
    fn write_strobe(&mut self, strobe: bool, timestamp: Self::Timestamp) -> bool;
    fn poll_busy(&mut self) -> bool;
    fn next_frame(&mut self, eof_timestamp: Self::Timestamp);
}
Expand description

An interface for emulating communication between a Spectrum’s or other peripherals’ hardware port and remote parallel devices.

Emulators of peripheral devices should implement this trait.

Methods of this trait are being called by bus devices implementing parallel port communication.

Required Associated Types§

Required Methods§

A device receives a byte written to the parallel data port.

A device receives a changed STROBE bit status. strobe is true if the STROBE went high, false when it went low.

Should return the BUSY status signal:

  • true if the BUSY signal is high,
  • false when it’s low.

This method is being called once every frame, near the end of it, and should return a BUSY signal state. Returns true if the BUSY signal is high, and false when it’s low.

Called when the current frame ends to allow emulators to wrap stored timestamps.

Implementors§