diskio.status(): remove unreliable device not present error detection

This commit is contained in:
Irmen de Jong 2024-12-02 23:33:33 +01:00
parent 28cac291de
commit 8341f9c066
2 changed files with 17 additions and 12 deletions

View File

@ -531,12 +531,14 @@ no_mciout:
sub status() -> uword { sub status() -> uword {
; -- retrieve the disk drive's current status message ; -- retrieve the disk drive's current status message
str device_not_present_error = "device not present #xx"
if cbm.READST()==128 { ; TODO this doesn't seem to work reliably, sometimes READST returns 128 when the drive is just fine
device_not_present_error[len(device_not_present_error)-2] = 0 ; str device_not_present_error = "device not present #xx"
void strings.copy(conv.str_ub(drivenumber), &device_not_present_error+len(device_not_present_error)-2) ; if cbm.READST()==128 {
return device_not_present_error ; device_not_present_error[len(device_not_present_error)-2] = 0
} ; void strings.copy(conv.str_ub(drivenumber), &device_not_present_error+len(device_not_present_error)-2)
; return device_not_present_error
; }
uword messageptr = &list_filename uword messageptr = &list_filename
cbm.SETNAM(0, list_filename) cbm.SETNAM(0, list_filename)

View File

@ -456,12 +456,15 @@ _end jsr cbm.READST
sub status() -> uword { sub status() -> uword {
; -- retrieve the disk drive's current status message ; -- retrieve the disk drive's current status message
str device_not_present_error = "device not present #xx"
if cbm.READST()==128 { ; TODO this doesn't seem to work reliably, sometimes READST returns 128 when the drive is just fine
device_not_present_error[len(device_not_present_error)-2] = 0 ; str device_not_present_error = "device not present #xx"
void strings.copy(conv.str_ub(drivenumber), &device_not_present_error+len(device_not_present_error)-2) ; if cbm.READST()==128 {
return device_not_present_error ; device_not_present_error[len(device_not_present_error)-2] = 0
} ; void strings.copy(conv.str_ub(drivenumber), &device_not_present_error+len(device_not_present_error)-2)
; return device_not_present_error
; }
uword messageptr = &list_filename uword messageptr = &list_filename
cbm.SETNAM(0, list_filename) cbm.SETNAM(0, list_filename)
cbm.SETLFS(15, drivenumber, 15) cbm.SETLFS(15, drivenumber, 15)