From a79564b37410c4aeadc2596c992d6e077214a05d Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Mon, 5 Aug 2019 18:22:31 +0200 Subject: [PATCH] drive led is now turned OFF after @$ --- c64/kernal/close.s | 27 ++++++++++++++++++++++++++- c64/kernal/load.s | 13 +------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/c64/kernal/close.s b/c64/kernal/close.s index fc8e0a8c..40c2f8c1 100644 --- a/c64/kernal/close.s +++ b/c64/kernal/close.s @@ -26,8 +26,13 @@ close: ;; IEC device jsr iec_tx_flush ; make sure no byte is awaiting -* lda SAT, y ; get secondary address + cmp #$60 + bne + + ;; workaround for using CLOSE on reading executable - XXX is this a proper way? + jsr close_load + jmp close_remove_from_table +* ora $E0 ; CLOSE command sta IEC_TMP2 jsr iec_tx_command @@ -57,3 +62,23 @@ close_error_not_found: sec ; report success - not sure if original CLOSE does this, but it's nevertheless a good practice rts + +close_load: ; entry also for LOAD routine + + tax + + ;; Command drive to stop talking and to close the file + jsr untlk + + txa + jsr listen + + lda #$E0 ; CLOSE command + sta IEC_TMP2 + jsr iec_tx_command + jsr iec_tx_command_finalize + + ;; Tell drive to unlisten + jsr unlsn + + rts diff --git a/c64/kernal/load.s b/c64/kernal/load.s index e845b546..ece03816 100644 --- a/c64/kernal/load.s +++ b/c64/kernal/load.s @@ -125,19 +125,8 @@ load_loop: ;; Close file on drive - ;; Command drive to stop talking and to close the file - jsr untlk - lda current_device_number - jsr listen - - lda #$E0 - sta IEC_TMP2 - jsr iec_tx_command - jsr iec_tx_command_finalize - - ;; Tell drive to unlisten - jsr unlsn + jsr close_load ;; Return last address jmp lvs_return_last_address