From 49536d8378782f790e1970d1b7096fefac7f89a1 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sun, 5 May 2019 02:15:46 +0930 Subject: [PATCH] fix handling of EOI marker so we can load more than one program in life of system --- c64/kernal/iec_release_atn.s | 6 ++++++ c64/kernal/load.s | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/c64/kernal/iec_release_atn.s b/c64/kernal/iec_release_atn.s index 56644746..12c63d02 100644 --- a/c64/kernal/iec_release_atn.s +++ b/c64/kernal/iec_release_atn.s @@ -2,4 +2,10 @@ iec_release_atn: lda $dd00 and #$f7 sta $dd00 + + ;; Also clear EOI marker + lda IOSTATUS + and #$bf + sta IOSTATUS + rts diff --git a/c64/kernal/load.s b/c64/kernal/load.s index 059245e4..4a2ca7c8 100644 --- a/c64/kernal/load.s +++ b/c64/kernal/load.s @@ -142,7 +142,7 @@ sent_filename: jsr printf .byte "LOADING",$0d,0 - + load_loop: ;; We are now ready to receive bytes jsr iec_rx_byte @@ -177,16 +177,15 @@ load_loop: load_done: ;; Close file on drive - ;; Command drive to listen and to close the file + ;; Command drive to stop talking and to close the file jsr iec_assert_atn + lda #$5f + jsr iec_tx_byte lda #$28 jsr iec_tx_byte lda #$e0 jsr iec_tx_byte - jsr iec_release_atn - ;; Tell drive to unlisten - jsr iec_assert_atn lda #$3f jsr iec_tx_byte jsr iec_release_atn