fix inverted sense of DATA line when writing bytes. We can now get a device to respond to an ATN byte.

This commit is contained in:
Paul Gardner-Stephen committed 2019-05-01 23:02:29 +09:30
1 parent e67eb37937
commit dcebe17e51
1 file changed
+6 -4
+6 -4
View File
@@ -33,7 +33,7 @@ iec_tx_byte:
jsr iec_wait60us jsr iec_wait60us
;; Do the actual transmission of 8 bits of data ;; Do the actual transmission of 8 bits of data
ldx #8 ldx #7
pla pla
@@ -44,11 +44,11 @@ iec_tx_byte_nextbit:
bcs + bcs +
;; Setup 0 ;; Setup 0
jsr iec_assert_clk_release_data jsr iec_assert_clk_and_data
jmp iec_tx_byte_l1 jmp iec_tx_byte_l1
* *
;; Setup 1 ;; Setup 1
jsr iec_assert_clk_and_data jsr iec_assert_clk_release_data
iec_tx_byte_l1: iec_tx_byte_l1:
;; Clock bit out ;; Clock bit out
jsr iec_wait20us jsr iec_wait20us
@@ -60,13 +60,15 @@ iec_tx_byte_l1:
;; More bits to send? ;; More bits to send?
pla pla
dex dex
bne iec_tx_byte_nextbit bpl iec_tx_byte_nextbit
;; Done sending bits. Assert CLK and wait for acknowledgement ;; Done sending bits. Assert CLK and wait for acknowledgement
jsr iec_assert_clk_release_data jsr iec_assert_clk_release_data
;; Acknowledgement must happen within 1ms, else it ;; Acknowledgement must happen within 1ms, else it
;; is DEVICE NOT PRESENT ;; is DEVICE NOT PRESENT
;; Acknowledgement consists of the DATA line being pulled
;; by the listener.
;; We can't easily count rasters here, so we just ;; We can't easily count rasters here, so we just
;; try a set number of times ;; try a set number of times
ldx #$ff ldx #$ff