(dos.tal) Added command documentation in ls cmd

This commit is contained in:
neauoire 2022-01-23 10:03:15 -08:00
parent edd05ed1d1
commit 97003d1ae2
1 changed files with 51 additions and 24 deletions

View File

@ -57,9 +57,9 @@
|0100 ( -> ) |0100 ( -> )
( theme ) ( theme )
#0f55 .System/r DEO2 #50f5 .System/r DEO2
#0fc5 .System/g DEO2 #c0f5 .System/g DEO2
#0fa5 .System/b DEO2 #a0f5 .System/b DEO2
( vectors ) ( vectors )
;on-button .Controller/vector DEO2 ;on-button .Controller/vector DEO2
@ -68,7 +68,7 @@
#00 WIDTH 8** PAD 2** ++ .Screen/width DEO2 #00 WIDTH 8** PAD 2** ++ .Screen/width DEO2
#00 HEIGHT 8** PAD 2** ++ .Screen/height DEO2 #00 HEIGHT 8** PAD 2** ++ .Screen/height DEO2
#08 ;draw-input JSR2 #04 ;draw-input JSR2
LIT '. .path STZ LIT '. .path STZ
@ -90,12 +90,12 @@ BRK
DUP #08 ! ,&no-backspace JCN DUP #08 ! ,&no-backspace JCN
#00 ;draw-input JSR2 #00 ;draw-input JSR2
;buffer ;spop JSR2 ;buffer ;spop JSR2
#08 ;draw-input JSR2 #04 ;draw-input JSR2
&no-backspace &no-backspace
DUP STHk #1f > STHr #7b < #0101 !! ,&no-valid JCN DUP STHk #1f > STHr #7b < #0101 !! ,&no-valid JCN
;buffer ;slen JSR2 #007f >> ,&no-valid JCN ;buffer ;slen JSR2 #007f >> ,&no-valid JCN
STHk ;buffer STHr ;sput JSR2 STHk ;buffer STHr ;sput JSR2
#08 ;draw-input JSR2 #04 ;draw-input JSR2
&no-valid &no-valid
POP POP
@ -126,7 +126,7 @@ RTN
@validate ( -- ) @validate ( -- )
;clear JSR2 ;clear JSR2
;get-cmd JSR2 #0003 ++ JSR2 ;get-cmd JSR2 ;commands-func ++ LDA2 JSR2
;buffer #0080 ;mclr JSR2 ;buffer #0080 ;mclr JSR2
JMP2r JMP2r
@ -136,49 +136,53 @@ JMP2r
;commands/end ;commands ;commands/end ;commands
&loop &loop
LDA2k ;buffer ;scmp-seg JSR2 #00 = ,&continue JCN LDA2k ;buffer ;scmp-seg JSR2 #00 = ,&continue JCN
NIP2 LDA2 RTN NIP2 ;commands -- RTN
&continue &continue
INC2 INC2 GTH2k ,&loop JCN INC2 INC2 GTH2k ,&loop JCN
&end &end
POP2 LDA2 POP2 ;commands --
RTN RTN
@cmd-ls @cmd-ls
&name "ls $1 &name "ls $1
&run &docs "list_folder_content $1
&func
;path .File/name DEO2 ;path .File/name DEO2
#8000 .File/length DEO2 #8000 .File/length DEO2
;view .File/read DEO2 ;view .File/read DEO2
PAD .Screen/x DEO2 PAD .Screen/x DEO2
PAD .Screen/y DEO2 PAD .Screen/y DEO2
;view #01 ;draw-tx JSR2 ;view #01 ;draw-tx JSR2
RTN RTN
@cmd-cp @cmd-cp
&name "cp $1 &name "cp $1
&run &docs "copy_file_to_name $1
&func
RTN RTN
@cmd-mv @cmd-mv
&name "mv $1 &name "mv $1
&run &docs "move_file_to_name $1
&func
RTN RTN
@cmd-rm @cmd-rm
&name "rm $1 &name "rm $1
&run &docs "remove_file $1
&func
RTN RTN
@cmd-tx @cmd-tx
&name "tx $1 ( print file text ) &name "tx $1 ( print file text )
&run &docs "display_file_as_text $1
&func
;buffer #0003 ++ .File/name DEO2 ;buffer #0003 ++ .File/name DEO2
#8000 .File/length DEO2 #8000 .File/length DEO2
@ -199,7 +203,8 @@ RTN
@cmd-hx @cmd-hx
&name "hx $1 ( print file hex ) &name "hx $1 ( print file hex )
&run &docs "display_file_as_hex $1
&func
;buffer #0003 ++ .File/name DEO2 ;buffer #0003 ++ .File/name DEO2
#8000 .File/length DEO2 #8000 .File/length DEO2
@ -229,7 +234,8 @@ RTN
@cmd-do @cmd-do
&name "do $1 ( print file hex ) &name "do $1 ( print file hex )
&run &docs "run_file_as_rom $1
&func
( release inputs ) ( release inputs )
#0000 .Controller/button DEO2 #0000 .Controller/button DEO2
@ -249,27 +255,39 @@ RTN
@cmd-?? @cmd-??
&name "-- $1 &name "-- $1
&run &docs "display_commands $1
&func
#aa DEBUG
PAD .Screen/x DEO2 PAD .Screen/x DEO2
PAD .Screen/y DEO2 PAD .Screen/y DEO2
;&help-txt #01 ;draw-tx JSR2 ;&help-txt #01 ;draw-tx JSR2
PAD #0020 ++ .Screen/y DEO2 PAD #0010 ++ .Screen/y DEO2
;commands/end ;commands ;commands/end ;commands
&loop &loop
PAD #0020 ++ .Screen/x DEO2 PAD #0008 ++ .Screen/x DEO2
LDA2k #02 ;draw-str JSR2 LDA2k #02 ;draw-str JSR2
PAD #0030 ++ .Screen/x DEO2
DUP2 ;commands -- ;commands-docs ++ LDA2 #01 ;draw-str JSR2
.Screen/y DEI2k #0010 ++ ROT DEO2 .Screen/y DEI2k #0010 ++ ROT DEO2
INC2 INC2 GTH2k ,&loop JCN INC2 INC2 GTH2k ,&loop JCN
&end &end
POP2 LDA2 POP2 POP2
RTN RTN
&help-txt "Available 20 "commands: $1 &help-txt "Commands: $1
@commands @commands
:cmd-ls :cmd-cp :cmd-mv :cmd-rm :cmd-ls :cmd-cp :cmd-mv :cmd-rm
:cmd-hx :cmd-tx :cmd-do :cmd-hx :cmd-tx :cmd-do
&end :cmd-?? &end :cmd-??
@commands-docs
:cmd-ls/docs :cmd-cp/docs :cmd-mv/docs :cmd-rm/docs
:cmd-hx/docs :cmd-tx/docs :cmd-do/docs
&end :cmd-??/docs
@commands-func
:cmd-ls/func :cmd-cp/func :cmd-mv/func :cmd-rm/func
:cmd-hx/func :cmd-tx/func :cmd-do/func
&end :cmd-??/func
@draw-input ( color -- ) @draw-input ( color -- )
@ -282,7 +300,12 @@ RTN
#20 #00 ;draw-char JSR2 #20 #00 ;draw-char JSR2
;buffer STHr ;draw-str JSR2 ;buffer STHkr ;draw-str JSR2
;cursor-icn .Screen/addr DEO2
STHr .Screen/sprite DEOk DEO
.Screen/y DEI2 #0010 -- .Screen/y DEO2
.Screen/x DEI2 #0008 ++ .Screen/x DEO2
JMP2r JMP2r
@ -444,6 +467,10 @@ JMP2r
@strings @strings
&you-said "You 20 "said 20 $1 &you-said "You 20 "said 20 $1
@cursor-icn
aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55
aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55
@font ( terminus01x02 ) @font ( terminus01x02 )
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 183c 3c3c 1818 1800 1818 0000 0000 0000 183c 3c3c 1818 1800 1818 0000 0000