mirror of
https://github.com/irmen/prog8.git
synced 2024-07-13 12:29:05 +00:00
diskio status() now returns the status string instead of printing it
This commit is contained in:
parent
0d7a291b81
commit
08f0303178
@ -7,7 +7,7 @@ diskio {
|
|||||||
|
|
||||||
|
|
||||||
sub directory(ubyte drivenumber) -> ubyte {
|
sub directory(ubyte drivenumber) -> ubyte {
|
||||||
; -- Shows the directory contents of disk drive 8-11 (provide as argument). Returns success flag.
|
; -- Prints the directory contents of disk drive 8-11 to the screen. Returns success.
|
||||||
|
|
||||||
c64.SETNAM(1, "$")
|
c64.SETNAM(1, "$")
|
||||||
c64.SETLFS(1, drivenumber, 0)
|
c64.SETLFS(1, drivenumber, 0)
|
||||||
@ -61,11 +61,11 @@ io_error:
|
|||||||
|
|
||||||
; internal variables for the iterative file lister
|
; internal variables for the iterative file lister
|
||||||
ubyte list_suffixmatch
|
ubyte list_suffixmatch
|
||||||
ubyte list_in_progress = false
|
|
||||||
ubyte list_pattern_size
|
ubyte list_pattern_size
|
||||||
ubyte list_skip_disk_name
|
ubyte list_skip_disk_name
|
||||||
uword list_pattern
|
uword list_pattern
|
||||||
uword list_blocks
|
uword list_blocks
|
||||||
|
ubyte iteration_in_progress = false
|
||||||
str list_filename = "????????????????"
|
str list_filename = "????????????????"
|
||||||
|
|
||||||
sub lf_start_list(ubyte drivenumber, uword pattern, ubyte suffixmatch) -> ubyte {
|
sub lf_start_list(ubyte drivenumber, uword pattern, ubyte suffixmatch) -> ubyte {
|
||||||
@ -74,7 +74,7 @@ io_error:
|
|||||||
list_pattern = pattern
|
list_pattern = pattern
|
||||||
list_suffixmatch = suffixmatch
|
list_suffixmatch = suffixmatch
|
||||||
list_skip_disk_name = true
|
list_skip_disk_name = true
|
||||||
list_in_progress = true
|
iteration_in_progress = true
|
||||||
if pattern==0
|
if pattern==0
|
||||||
list_pattern_size = 0
|
list_pattern_size = 0
|
||||||
else
|
else
|
||||||
@ -106,7 +106,7 @@ io_error:
|
|||||||
; results will be found in list_blocks and list_filename.
|
; results will be found in list_blocks and list_filename.
|
||||||
; if it returns false though, there are no more entries (or an error occurred).
|
; if it returns false though, there are no more entries (or an error occurred).
|
||||||
|
|
||||||
if not list_in_progress
|
if not iteration_in_progress
|
||||||
return false
|
return false
|
||||||
|
|
||||||
while not c64.READST() {
|
while not c64.READST() {
|
||||||
@ -163,16 +163,17 @@ close_end:
|
|||||||
|
|
||||||
sub lf_end_list() {
|
sub lf_end_list() {
|
||||||
; -- end an iterative file listing session (close channels).
|
; -- end an iterative file listing session (close channels).
|
||||||
if list_in_progress {
|
if iteration_in_progress {
|
||||||
c64.CLRCHN()
|
c64.CLRCHN()
|
||||||
c64.CLOSE(1)
|
c64.CLOSE(1)
|
||||||
list_in_progress = false
|
iteration_in_progress = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub status(ubyte drivenumber) {
|
sub status(ubyte drivenumber) -> uword {
|
||||||
; -- display the disk drive's current status message
|
; -- retrieve the disk drive's current status message
|
||||||
|
uword messageptr = &filename
|
||||||
c64.SETNAM(0, filename)
|
c64.SETNAM(0, filename)
|
||||||
c64.SETLFS(15, drivenumber, 15)
|
c64.SETLFS(15, drivenumber, 15)
|
||||||
void c64.OPEN() ; open 15,8,15
|
void c64.OPEN() ; open 15,8,15
|
||||||
@ -182,12 +183,16 @@ close_end:
|
|||||||
if_cs
|
if_cs
|
||||||
goto io_error
|
goto io_error
|
||||||
|
|
||||||
while not c64.READST()
|
while not c64.READST() {
|
||||||
txt.chrout(c64.CHRIN())
|
@(messageptr) = c64.CHRIN()
|
||||||
|
messageptr++
|
||||||
|
}
|
||||||
|
|
||||||
io_error:
|
io_error:
|
||||||
|
@(messageptr) = 0
|
||||||
c64.CLRCHN() ; restore default i/o devices
|
c64.CLRCHN() ; restore default i/o devices
|
||||||
c64.CLOSE(15)
|
c64.CLOSE(15)
|
||||||
|
return filename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
5.3
|
5.4-SNAPSHOT
|
||||||
|
Loading…
Reference in New Issue
Block a user