fix some bugs in IEC ATN turnaround

This commit is contained in:
Paul Gardner-Stephen committed 2019-05-04 16:59:37 +09:30
1 parent cc92b7d7e0
commit 49d5733246
1 file changed
+27 -2
+27 -2
View File
@@ -2,6 +2,10 @@
;; pages 7--8.
iec_turnaround_to_listen:
jsr printf
.byte "DOING TURNAROUND",$0d,0
;; Assert data and release clock
lda $dd00
sta $0420
@@ -12,8 +16,29 @@ iec_turnaround_to_listen:
;; Wait for clock line to be asserted by the drive
* lda $dd00
sta $0421
and #$80
and #$40
bne -
;; Wait for clk to be released by the drive to mark ready to talk
ldx #$ff
* lda $dd00
and #$40
beq +
dex
bne -
jsr printf
.byte "TURNAROUND FAILED - FILE NOT FOUND?",$0d,$00
;; Timeout = file not found error
;; (https://www.pagetable.com/?p=1023)
lda #5
sec
rts
*
jsr printf
.byte "TURNAROUND SUCEEDED",$0d,$00
;; ATN turn around successful
cli
rts