add generic error in diskio.status() if drive status can't be read

This commit is contained in:
Irmen de Jong 2021-05-01 15:20:11 +02:00
parent 7bac7bdc3e
commit 1a59019fc8
3 changed files with 16 additions and 2 deletions

View File

@ -353,11 +353,15 @@ _end rts
messageptr++
}
io_error:
@(messageptr) = 0
done:
c64.CLRCHN() ; restore default i/o devices
c64.CLOSE(15)
return filename
io_error:
filename = "?disk error"
goto done
}

View File

@ -128,7 +128,7 @@ internal class AsmGen(private val program: Program,
out("* = ${program.actualLoadAddress.toHex()}")
val year = LocalDate.now().year
out(" .word (+), $year")
out(" .null $9e, format(' %d ', _prog8_entrypoint), $3a, $8f, ' prog8 by idj'")
out(" .null $9e, format(' %d ', _prog8_entrypoint), $3a, $8f, ' prog8'")
out("+\t.word 0")
out("_prog8_entrypoint\t; assembly code starts here\n")
if(!options.noSysInit)

View File

@ -1,10 +1,20 @@
%import textio
%import diskio
%zeropage basicsafe
main {
sub start() {
txt.print(diskio.status(8))
txt.nl()
txt.print(diskio.status(9))
txt.nl()
; txt.print(diskio.status(10))
; txt.nl()
; txt.print(diskio.status(11))
; txt.nl()
uword x=22
x*=320
txt.print_uw(x)