From aa39286d9d677b6ba7654ed66342d36f42d4c55b Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Sun, 18 Oct 2026 07:27:18 +0200 Subject: [PATCH] fix(wedge): print a DOS command's status, not the OK after closing it @ closed every file before it read the status, and a drive says 00, OK once its command channel closes, so @S: never showed FILES SCRATCHED. It now reads the status through the channel it sent the command on. --- src/basic/wedge/wedge_dos.s | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/basic/wedge/wedge_dos.s b/src/basic/wedge/wedge_dos.s index 77449da0..c225dee2 100644 --- a/src/basic/wedge/wedge_dos.s +++ b/src/basic/wedge/wedge_dos.s @@ -152,10 +152,11 @@ wedge_dos_command_confirmed: jsr JOPEN +bcs wedge_dos_basic_error - ; Retrieve status, print it if not OK + ; Retrieve status through the channel just opened, print it if not OK. Closing it + ; first would reset the status to OK: CLALL closes every file, and a drive's DOS + ; says OK once its command channel closes - jsr JCLALL - jsr wedge_dos_status_get + jsr wedge_dos_status_get_opened lda BUF+0 cmp #$30 ; '0' @@ -217,6 +218,10 @@ wedge_dos_status_get: jsr JOPEN +bcs wedge_dos_basic_error + ; FALLTROUGH + +wedge_dos_status_get_opened: + ; Set channel for input ldx #$0F