diff --git a/src/kernal/iec/iec_tx_byte.s b/src/kernal/iec/iec_tx_byte.s index 93c42625..014dca9e 100644 --- a/src/kernal/iec/iec_tx_byte.s +++ b/src/kernal/iec/iec_tx_byte.s @@ -51,6 +51,17 @@ iec_tx_byte: +phx_trash_a +phy_trash_a + ; A listener holds DATA until we release CLK; if nobody pulls it + ; within 256us, no device is present - see https://www.pagetable.com/?p=1135 + ldx #$18 +@0: + lda CIA2_PRA + bpl @1 ; branch if DATA is pulled + dex + bne @0 + jsr kernalstatus_DEVICE_NOT_FOUND + jmp iec_return_DEVICE_NOT_FOUND +@1: ; Notify all devices that we are going to send a byte ; and it is going to be a data byte (released ATN) jsr iec_release_atn_clk_data