+\r
+\r
+;-------------------------------------------------------------------------------\r
+; get console input, echo it, and shift to upper case\r
+; save hl,de,bc\r
+\r
+uciecho:\r
+ push hl\r
+ push de\r
+ push bc\r
+u$c0:\r
+ call ?const\r
+ or a\r
+ jr z,u$c1 ; see if any char already struck\r
+ call ?conin\r
+ jr u$c0 ; yes, eat it and try again\r
+u$c1:\r
+ call ?conin\r
+ push af\r
+ ld c,a\r
+ cp ' '-1\r
+ call nc,?cono\r
+ pop af\r
+ pop bc\r
+ pop de\r
+ pop hl\r
+ cp 'a'\r
+ ret c\r
+ sub 'a'-'A' ; make upper case\r
+ ret\r
+\r
+;-------------------------------------------------------------------------------\r
+;\r
+\r
+pr.errors:\r
+\r
+ ; suppress error message if BDOS\r
+ ; is returning errors to application...\r
+\r
+ ld a,(@ermde)\r
+ inc a\r
+ jr nz,pre1\r
+ dec a ;return NZ, if @ermde == 0FFH\r
+ ret\r
+pre1:\r
+ push hl\r
+ ld hl,pre2\r
+ ex (sp),hl\r
+ push hl\r
+\r
+ ; Had permanent error, print message like:\r
+ ; BIOS Err on d: T-nn, S-mm, <operation> <type>, Retry ?\r
+\r
+ call ?pderr ; print message header\r
+\r
+ ld hl,op$msg\r
+ ld a,(@op)\r
+ jp pr.idx ; last function (read or write)\r
+\r
+pre2:\r
+ ; prompt for retry\r
+ call pr.inln\r
+ db ' Retry (Y/N) ? ',0\r
+\r
+ call uciecho ; get operator response\r
+ cp 'Y'\r
+ ret ; return Z-flag for yes\r
+\r
+\r
+op$msg:\r
+ db ', Unknown op, ',0\r
+ db ', Read, ',0\r
+ db ', Write, ',0\r
+ db 0\r
+\r
+ end\r