diff --git a/src/kernal/iec/close_iec.s b/src/kernal/iec/close_iec.s index 3e5c02dc..366abd10 100644 --- a/src/kernal/iec/close_iec.s +++ b/src/kernal/iec/close_iec.s @@ -26,14 +26,20 @@ close_iec: ; LISTEN, CLOSE, UNLISTEN - see https://www.pagetable.com/?p=1031 lda FAT, y jsr LISTEN - bcs close_iec_end + bcs close_iec_not_present lda SAT, y ora #$E0 ; CLOSE command sta TBTCNT jsr iec_tx_command - bcs close_iec_end + bcs close_iec_not_present jsr iec_tx_command_finalize jsr UNLSN + jmp close_remove_from_table + +close_iec_not_present: + + ; The file is closed all the same; READST says device not present + jsr kernalstatus_DEVICE_NOT_FOUND ; FALLTROUGH