From c6fa15797141c957dff6863f3bb212966f1a27fa Mon Sep 17 00:00:00 2001 From: Leo C Date: Tue, 31 May 2016 12:45:58 +0200 Subject: [PATCH] Support new error codes/messages: 'Write protected', 'No media', 'Access beyond disk size' --- cbios/sdio.180 | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/cbios/sdio.180 b/cbios/sdio.180 index 783e681..37b7276 100644 --- a/cbios/sdio.180 +++ b/cbios/sdio.180 @@ -322,21 +322,24 @@ prompt: call u$conin$echo ; get operator response cp 'Y' - jr z,retry ; Yes, then retry 10 more times + jr z,retry ; Yes, then retry once more hard$error: ; otherwise, xor a ld (residual),a - - ld a,1 ; return hard error to BDOS + ld a,(recv_msg_rc) ; return hard error to BDOS + ld c,0ffh + cp 6 ; media changed? + jr z,e_exit + ld c,2 + cp 5 ; disk read only? + jr z,e_exit + dec c +e_exit: + ld a,c ret -cancel: ; here to abort job - jp ?wboot ; leap directly to warmstart vector - - - ; Print message to error code in A ; @@ -426,15 +429,19 @@ read$msg: write$msg: db ', Write, ',0 + ; general driver errors + drvmsg0: db 'Unknown Error, ',0 drvmsg1: db 'Invalid Parameter(s), ',0 drvmsg2: db 'Invalid Drive, ',0 drvmsg3: db 'Bus Timeout, ',0 +drvmsg4: db 'Access beyond disk size, ',0 +drvmsg5: db 'Write protected, ',0 +drvmsg6: db 'No media, ',0 drvmsg_size equ $ - drvmsg0 -drvmsg_count equ 3 - +drvmsg_count equ 7 -; table of pointers to error message strings + ; fat file system errors fr$msg0: db 'Unknown Error,',0 fr$msg1: db 'DISK_ERR,',0 @@ -458,6 +465,6 @@ fr$msg18: db 'TOO_MANY_OPEN_FILES,',0 fr$msg19: db 'FR_INVALID_PARAMETER,',0 fr$msg20: db 'short read/write,',0 fr$msg$size equ $ - fr$msg0 -fr$msg$count equ 20 +fr$msg$count equ 21 end -- 2.39.2