Expand description

A bus device for ZX Interface I.

I/O Port 0xe7.

Used to send or receive data to and from the microdrive.

Accessing this port will halt the Z80 until the Interface I has collected 8 bits from the microdrive head; therefore, if the microdrive motor isn’t running, or there is no formatted cartridge in the microdrive, the Spectrum hangs. This is the famous ‘IN 0 crash’.

I/O Port 0xef.

Bits DTR and CTS are used by the RS-232 interface.

The WAIT bit is used by the ZX Network to synchronize incoming bytes. It is being activated just before reading bits of each incoming byte.

GAP, SYNC, WR_PROT, ERASE, R/W, COMMS CLK, and COMMS DATA are used by the microdrive system.

       Bit    7   6    5    4    3    2    1     0
            +---------------------------------------+
        READ|   |   |    |busy| dtr |gap| sync|write|
            |   |   |    |    |     |   |     |prot.|
            |---+---+----+----+-----+---+-----+-----|
       WRITE|   |   |wait| cts|erase|r/w|comms|comms|
            |   |   |    |    |     |   | clk | data|
            +---------------------------------------+

I/O Port 0xf7.

If the microdrive is not being used, the COMMS DATA output selects the function of OUT bit 0 of 0xf7 port:

       Bit      7    6   5   4   3   2   1       0
            +------------------------------------------+
        READ|txdata|   |   |   |   |   |   |    net    |
            |      |   |   |   |   |   |   |   input   |
            |------+---+---+---+---+---+---+-----------|
       WRITE|      |   |   |   |   |   |   |net output/|
            |      |   |   |   |   |   |   |   rxdata  |
            +------------------------------------------+

If a 0 was written to COMMS DATA the lowest bit is written to the net output, if 1 was written to COMMS DATA the lowest written bit is rxdata. !

Structs

This struct represents an emulated Microdrive tape cartridge.
The RS-232 serial port remote device.
This struct represents a single MicroCartridge tape sector.
Connects the ZX Interface 1 I/O port emulator as a BusDevice.
Implementation of this type emulates ZX Microdrives.
Implementation of this struct decodes and encodes ZX-NET packets from Spectrum’s I/O port signals.
A helper struct for reading ZX-NET header information.
Implements ZxNetSocket sending ZX-NET packets using UDP datagrams in real-time.

Enums

A type representing a state on one of the CONTROL lines: CTS or DTR.
A type representing a state on one of the DATA lines: RxD or TxD.

Constants

Spectrum’s BAUD RATES.
The size of the sector data in bytes, excluding the 12 preamble bytes.
A default BAUD RATE used by Spectrum.
The number of T-states to signal to the control unit that the IF-1 has hanged the Spectrum indefinitely (IN 0 bug).
The size of the sector header in bytes, excluding the 12 preamble bytes.
The maximum number of drives that the ZX Interface 1 software can handle.
The maximum additional T-states the Interface 1 will halt Z80 during IN/OUT with DATA port.
The maximum number of emulated physical ZX Microdrive tape sectors.
The maximum number of usable ZX Microdrive tape sectors.

Traits

A trait for converting data to references of ZxNetHead.
An interface for emulating communication between a ZX Spectrum’s hardware port and remote devices.
This trait is being used by ZxNet to send and receive ZX-NET packets to and from remote parties.

Type Definitions

Sector reference iterator of the IntoIterator implementation for MicroCartridge.
Sector mutable reference iterator of the IntoIterator implementation for MicroCartridge.