Skip to content

Commit 80d95f7

Browse files
Move TR-DOS .drives, .step-rates and .fda to the library.
FossilOrigin-Name: 1840ab22826e2522450da561f51a35110fbf13ff090b592032d1e24c2c9ba540
1 parent ea37782 commit 80d95f7

File tree

4 files changed

+123
-76
lines changed

4 files changed

+123
-76
lines changed

VERSIONS.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Solo Forth version history
22
:author: Marcos Cruz (programandala.net)
3-
:revdate: 2021-01-05
3+
:revdate: 2021-01-06
44
:toc:
55

66
// This file is part of Solo Forth
@@ -50,13 +50,15 @@ http://qbi2005.windows.cervantesvirtual.com/wfrmVistaImagen.aspx?imagen=00096057
5050
=== Improvements
5151

5252
- Improve the documentation.
53+
- Improve TR-DOS `.step-rates`.
5354

5455
// Other changes {{{2
5556
=== Other changes
5657

5758
- Deactivate assembler instructions `stpx,` and `ftpx,`, which need to
5859
be fixed.
5960
- Remove `transfer-bytes` from +3DOS.
61+
- Move TR-DOS `.drives`, `.step-rates` and `.fda` to the library.
6062

6163
// Version 0.14.0-rc.124 {{{1
6264
== Version 0.14.0-rc.124
@@ -381,7 +383,7 @@ http://qbi2005.windows.cervantesvirtual.com/wfrmVistaImagen.aspx?imagen=00096057
381383
- Make `order,`, `@order`, `wordlists,` and `@wordlists` independent
382384
from `marker`.
383385
- Move `0exit` to the kernel; no data/code space needed, because of
384-
the space saved by using this word instead of `0= ?exit` and `if`.
386+
the space saved by using this word instead of `0= ?exit` and `if`.
385387
- Make paren comments multiline in the Vim syntax file.
386388
- Make `do_create` and `do_variable` Z80 entries 8 T States faster, by
387389
moving them from the `noop` word to the `next` entry.
@@ -1359,7 +1361,7 @@ to use all the paged memory. It has been called "far memory".
13591361
`call,` in the `z80-asm,` assembler. So it has been renamed, moved
13601362
to the `assembler` word list and removed from the assembler.
13611363
- Move `8*` from the assemblers to the operators.
1362-
1364+
13631365
// Version 0.10.0 {{{1
13641366
== Version 0.10.0
13651367

src/kernel.trdos.z80s

Lines changed: 32 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
; This file is part of Solo Forth
44
; http://programandala.net/en.program.solo_forth.html
55

6-
; Last modified: 202101051821
7-
; See change log at the end of the file
6+
; Last modified: 202101061724.
7+
; See change log at the end of the file.
88

99
; ==============================================================
1010
; Description
@@ -14,7 +14,7 @@
1414
; ==============================================================
1515
; Author
1616

17-
; Marcos Cruz (programandala.net), 2016, 2017, 2018, 2020.
17+
; Marcos Cruz (programandala.net), 2016, 2017, 2018, 2020, 2021.
1818

1919
; ==============================================================
2020
; License
@@ -854,20 +854,13 @@ list_command:
854854
endif
855855

856856
; ----------------------------------------------
857-
_colon_header dot_drives_,'.drives'
858857

859-
; XXX TMP -- for debugging
860-
; XXX TODO -- Move to the library.
858+
if 0 ; debugging
861859

862-
; doc{
863-
;
864-
; .drives ( -- ) "dot-drives"
865-
;
866-
; Display TR-DOS variables related to disk drives.
867-
;
868-
; See also: `.step-rates`, `.fda`.
869-
;
870-
; }doc
860+
_colon_header dot_drives_,'.drives'
861+
862+
; XXX REMARK -- This word is in the library. This copy is
863+
; preserved to be activated for debugging.
871864

872865
dw cr_
873866
_literal trdos_variable.current_temporary_drive
@@ -892,92 +885,58 @@ endif
892885
dw cr_
893886
dw paren_dot_quote_
894887
_string "Drive modes"
895-
_literal 23756
896-
_literal 23752
888+
_literal trdos_variable.drive_d_mode+1
889+
_literal trdos_variable.drive_a_mode
897890
dw paren_do_,dot_drives.exit
898891
dw cr_,i_,dup_,u_dot_,c_fetch_,dot_
899892
dw paren_loop_
900893
dot_drives.exit
901894
dw exit_
902895

903-
; Value of some TR-DOS variables after changing the default drive with
904-
; command `*"a"`, `*"b"`, etc.
905-
;
906-
; A B C D
907-
;
908-
; 23798 0 1 2 3 = current drive
909-
; 23800 0 0 0 0 = two-files drive
910-
; 23801 0 0 0 0 = cat drive
911-
; 23833 0 1 2 3 = default drive
912-
913-
; After booting Solo Forth from drive A:
914-
915-
; 23798 0 = current drive
916-
; 23800 0 = two-files drive
917-
; 23801 0 = cat drive
918-
; 23833 0 = default drive
896+
endif
919897

920-
; After booting Solo Forth from drive B:
898+
; ----------------------------------------------
921899

922-
; 23798 1 = current drive
923-
; 23800 0 = two-files drive
924-
; 23801 0 = cat drive
925-
; 23833 1 = default drive
900+
if 0 ; debugging
926901

927-
; ----------------------------------------------
928902
_colon_header dot_step_rates_,'.step-rates'
929903

930-
; XXX TMP -- for debugging
931-
; XXX TODO -- Move to the library.
932-
933-
; doc{
934-
;
935-
; .step-rates ( -- ) "dot-step-rates"
936-
;
937-
; Display the configured step rates of the TR-DOS disk drives.
938-
;
939-
; See also: `.drives`, `.fda`.
940-
;
941-
; }doc
904+
; XXX REMARK -- This word is in the library. This copy is
905+
; preserved to be activated for debugging.
942906

943907
dw cr_
944908
dw paren_dot_quote_
945-
_string 'Drive A: '
909+
_string 'Drive 0/A: '
946910
_literal trdos_variable.drive_a_step_rate
947911
dw dup_,dot_,c_fetch_,dot_
948912
dw cr_
949913
dw paren_dot_quote_
950-
_string 'Drive B: '
914+
_string 'Drive 1/B: '
951915
_literal trdos_variable.drive_b_step_rate
952916
dw dup_,dot_,c_fetch_,dot_
953917
dw cr_
954918
dw paren_dot_quote_
955-
_string 'Drive C: '
919+
_string 'Drive 2/C: '
956920
_literal trdos_variable.drive_c_step_rate
957921
dw dup_,dot_,c_fetch_,dot_
958922
dw cr_
959923
dw paren_dot_quote_
960-
_string 'Drive D: '
924+
_string 'Drive 3/D: '
961925
_literal trdos_variable.drive_d_step_rate
962926
dw dup_,dot_,c_fetch_,dot_
963927
dw cr_
964928
dw exit_
965929

930+
endif
931+
966932
; ----------------------------------------------
967-
_colon_header dot_f_d_a_,'.fda'
968933

969-
; XXX TMP -- for debugging
970-
; XXX TODO -- Move to the library.
934+
if 0 ; debugging
971935

972-
; doc{
973-
;
974-
; .fda ( -- ) "dot-F-D-A"
975-
;
976-
; Display the contents of TR-DOS File Descriptor Area.
977-
;
978-
; See also: `.drives`, `.step-rates`.
979-
;
980-
; }doc
936+
_colon_header dot_f_d_a_,'.fda'
937+
938+
; XXX REMARK -- This word is in the library. This copy is
939+
; preserved to be activated for debugging.
981940

982941
dw cr_,paren_dot_quote_
983942
_string "Filename and type:"
@@ -1004,6 +963,8 @@ dot_drives.exit
1004963
dw c_fetch_,dot_
1005964
dw exit_
1006965

966+
endif
967+
1007968
; ----------------------------------------------
1008969
_colon_header sector_number_sign_,'sector#'
1009970

@@ -1125,5 +1086,9 @@ endif ; defined trdos
11251086
;
11261087
; 2021-01-05: Improve documentation of `transfer-block` and
11271088
; `set-drive`.
1089+
;
1090+
; 2021-01-06: Move `.drives`, `.step-rates` and `.fda` to the
1091+
; library, but keep deactivated copies to be used for debugging
1092+
; in case the disk access fails. Improve `.step-rates`.
11281093

11291094
; vim: filetype=z80:textwidth=64

src/lib/dos.trdos.fs

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
\ This file is part of Solo Forth
44
\ http://programandala.net/en.program.solo_forth.html
55

6-
\ Last modified: 202007282057
6+
\ Last modified: 202101061709
77
\ See change log at the end of the file
88

99
\ ===========================================================
@@ -242,7 +242,7 @@ unneeding /fda ?\ $10 cconstant /fda
242242
\
243243
\ }doc
244244

245-
( files/disk /filename -filename -fda-filename )
245+
( files/disk /filename -filename -fda-filename .fda )
246246

247247
unneeding files/disk ?\ 128 cconstant files/disk
248248

@@ -313,7 +313,26 @@ unneeding -fda-filename ?( need fda need -filename
313313
\
314314
\ }doc
315315

316-
( set-filename get-filename filename>filetype )
316+
unneeding .fda ?( need fda
317+
318+
: .fda ( -- )
319+
cr ." Filename and type:" fda-filename 8 type
320+
'<' emit fda-filetype c@ emit '>' emit
321+
cr ." Start address: " fda-filestart @ u.
322+
cr ." Lenght in bytes: " fda-filelength @ u.
323+
cr ." Lenght in sectors:" fda-filesectors c@ . ; ?)
324+
325+
\ doc{
326+
\
327+
\ .fda ( -- ) "dot-F-D-A"
328+
\
329+
\ Display the contents of TR-DOS File Descriptor Area.
330+
\
331+
\ See also: `.drives`, `.step-rates`.
332+
\
333+
\ }doc
334+
335+
( set-filename get-filename filename>filetype .drives )
317336

318337
unneeding set-filename ?(
319338

@@ -368,7 +387,48 @@ unneeding filename>filetype
368387
\
369388
\ }doc
370389

371-
( get-drive (acat acat )
390+
unneeding .drives ?(
391+
392+
: .drives ( -- ) cr 23798 dup . c@ . ." current"
393+
cr 23800 dup . c@ . ." two files"
394+
cr 27801 dup . c@ . ." cat"
395+
cr 23833 dup . c@ . ." default"
396+
cr ." Drive modes" 23756 23752 ?do cr i dup u. c@ . loop ; ?)
397+
398+
\ doc{
399+
\
400+
\ .drives ( -- ) "dot-drives"
401+
\
402+
\ Display TR-DOS variables related to disk drives.
403+
\
404+
\ See also: `.step-rates`, `.fda`.
405+
\
406+
\ }doc
407+
408+
\ XXX REMARK: Value of some TR-DOS variables after changing
409+
\ the default drive with command `*"a"`, `*"b"`, etc.:
410+
411+
\ A B C D
412+
\ 23798 0 1 2 3 = current drive
413+
\ 23800 0 0 0 0 = two-files drive
414+
\ 23801 0 0 0 0 = cat drive
415+
\ 23833 0 1 2 3 = default drive
416+
417+
\ After booting Solo Forth from drive A:
418+
419+
\ 23798 0 = current drive
420+
\ 23800 0 = two-files drive
421+
\ 23801 0 = cat drive
422+
\ 23833 0 = default drive
423+
424+
\ After booting Solo Forth from drive B:
425+
426+
\ 23798 1 = current drive
427+
\ 23800 0 = two-files drive
428+
\ 23801 0 = cat drive
429+
\ 23833 1 = default drive
430+
431+
( get-drive (acat acat .step-rates )
372432

373433
unneeding get-drive
374434

@@ -429,6 +489,23 @@ unneeding acat ?\ need (acat : acat ( -- ) (acat throw ;
429489
\
430490
\ }doc
431491

492+
unneeding .step-rates ?(
493+
494+
: .step-rates ( -- ) cr ." Drive 0/A: " 23802 dup . c@ .
495+
cr ." Drive 1/B: " 23803 dup . c@ .
496+
cr ." Drive 2/C: " 23804 dup . c@ .
497+
cr ." Drive 3/D: " 23805 dup . c@ . cr ;
498+
499+
\ doc{
500+
\
501+
\ .step-rates ( -- ) "dot-step-rates"
502+
\
503+
\ Display the configured step rates of the TR-DOS disk drives.
504+
\
505+
\ See also: `.drives`, `.fda`.
506+
\
507+
\ }doc
508+
432509
( 2-block-drives 3-block-drives 4-block-drives )
433510

434511
unneeding 2-block-drives ?( need set-block-drives
@@ -1424,5 +1501,8 @@ need read-file-descriptor need write-file-descriptor
14241501
\ 2020-07-11: Add title to tables.
14251502
\
14261503
\ 2020-07-28: Replace "Note:" with the "NOTE:" markup.
1504+
\
1505+
\ 2021-01-06: Move `.drives`, `.step-rates` and `.fda` from
1506+
\ the TR-DOS kernel.
14271507

14281508
\ vim: filetype=soloforth

src/version.z80s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version_patch: equ 0
1212
version_prerelease_id: equ 'r'
1313
; 'd' for "dev", 'p' for "pre", 'r' for "rc", zero if none
1414

15-
version_prerelease: equ 135
15+
version_prerelease: equ 136
1616

1717
version_build_high_part: equ $0134
18-
version_build_low_part: equ $61B9 ; build 20210105
18+
version_build_low_part: equ $61BA ; build 20210106

0 commit comments

Comments
 (0)