diff --git a/bin/basic b/bin/basic index 2de26fca..2f38515c 100644 Binary files a/bin/basic and b/bin/basic differ diff --git a/bin/kernal b/bin/kernal index 16a9a00b..e5ac6f3d 100644 Binary files a/bin/kernal and b/bin/kernal differ diff --git a/c64/kernal/iec_rx_byte.s b/c64/kernal/iec_rx_byte.s index 8ffcf3f7..2d28465f 100644 --- a/c64/kernal/iec_rx_byte.s +++ b/c64/kernal/iec_rx_byte.s @@ -32,23 +32,15 @@ iec_rx_clk_wait: jsr iec_wait60us lda CI2PRA rol - bmi iec_rx_no_eoi_confirmation + bmi iec_rx_set_eoi + + jsr iec_rx_set_eoi ;; Pull data for 60 usec to confirm jsr iec_release_clk_pull_data jsr iec_wait60us jsr iec_release_clk_data -iec_rx_no_eoi_confirmation: - - ;; Store EOI information in IOSTATUS - XXX this should be done by the caller! - lda IOSTATUS - ora #$40 - sta IOSTATUS - - sec - rts - iec_rx_not_eoi: ;; Latch input bits in on rising edge of CLK, eight times for eight bits. @@ -84,6 +76,7 @@ iec_rx_bit_loop: ;; Move data bit into C flag, and loop until bit 6 clears ;; i.e., the clock has been released. + * lda CI2PRA rol bpl - @@ -113,3 +106,12 @@ iec_rx_bit_loop: clc rts +iec_rx_set_eoi: + + ;; Store EOI information in IOSTATUS + lda IOSTATUS + ora #$40 + sta IOSTATUS + + clc + rts diff --git a/c64/kernal/load.s b/c64/kernal/load.s index b7d68db9..d6e9b631 100644 --- a/c64/kernal/load.s +++ b/c64/kernal/load.s @@ -158,7 +158,7 @@ load_loop: bne + inc load_save_start_ptr+1 ;; If we wrap around to $0000, then this is bad. - beq load_error + beq load_error * ;; Check for EOI -- if so, read one last byte lda IOSTATUS @@ -167,13 +167,21 @@ load_loop: load_done: ;; Close file on drive - + ;; Command drive to stop talking and to close the file jsr untlk + + ;; XXX XXX code below runs into infinite loop - so for now just quit + clc + cli + rts + lda current_device_number jsr listen + lda #$e0 jsr iec_tx_command + ;; Tell drive to unlisten jsr unlsn