Home » Archimedes archive » Acorn User » AU 1995-10.adf » !Direct » Director/!Director/Menus/System/FindDrives

Director/!Director/Menus/System/FindDrives

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1995-10.adf » !Direct
Filename: Director/!Director/Menus/System/FindDrives
Read OK:
File size: 056B bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
    1REM >Director:Menus.System.FindDrives
    2SYS "OS_Module",18,"FileCore%Base" TO ,mod
    3DIM drive$(100)
    4n=0
    5PROCcode
    6ins=0
    7REPEAT
    8 SYS "OS_Module",12,mod,ins TO ,mod,ins,,,postfix
    9 IF ins<>0 THEN
   10  fs$=FN0(postfix)
   11  SYS "OS_FSControl",11,fs$+":"
   12  SYS "OS_FSControl",20 TO ,,pw
   13  H%=pw
   14  d=USR(filecore_drives)
   15  IF d=0 THEN
   16   drive$(n)=fs$+"!":n+=1
   17REM   SYS "Director_Option",fs$+" -grey -sub ?"
   18  ELSE
   19   flop=d MOD 256
   20   hard=d DIV 256
   21   PROCinfo(0,flop)
   22   PROCinfo(4,hard)
   23  ENDIF
   24 ENDIF
   25UNTIL ins=0
   26SYS "OS_FSControl",19
   27
   28*Menu Drives -temp
   29FOR i=0 TO n-1
   30 k=i
   31 FOR j=i TO n-1
   32  IF drive$(j)<drive$(k) k=j
   33 NEXT
   34 SWAP drive$(i),drive$(k)
   35 fs$=LEFT$(drive$(i))
   36 dn$=RIGHT$(drive$(i))
   37 IF dn$="!" THEN
   38  SYS "Director_Option",LEFT$(drive$(i))+" -grey -sub ?"
   39 ELSE
   40  SYS "Director_Option",fs$+"::"+dn$+" -sub ""Dynamic:Run Director:Menus.System.Drive "+fs$+" "+dn$+""""
   41  SYS "Director_Command","Filer_OpenDir "+fs$+"::"+dn$+".$"
   42 ENDIF
   43NEXT
   44*EndMenu
   45*Set Director$Menu Drives
   46END
   47:
   48DEF PROCinfo(base,num)
   49IF num=0 ENDPROC
   50FOR drive=base TO base+num-1
   51 drive$(n)=fs$+STR$drive:n+=1
   52NEXT
   53ENDPROC
   54:
   55
   56:
   57DEF PROCcode
   58DIM code 100
   59FOR pass=0 TO 2 STEP 2:P%=code
   60[OPT pass
   61.filecore_drives
   62 MOV r8,r7
   63 SWI "XFileCore_Drives"
   64 ADD r0,r1,r2,LSL #8
   65 MOV pc,r14
   66]NEXT
   67ENDPROC
   68:
   69DEF FN0(a)
   70s$=""
   71WHILE ?a<>0
   72 s$+=CHR$?a
   73 a+=1
   74ENDWHILE
   75=s$
'� >Director:Menus.System.FindDrives
,ș "OS_Module",18,"FileCore%Base" � ,mod
� drive$(100)
n=0
	�code
	ins=0
�
3 ș "OS_Module",12,mod,ins � ,mod,ins,,,postfix
	 � ins<>0 �

  fs$=�0(postfix)
"  ș "OS_FSControl",11,fs$+":"
!  ș "OS_FSControl",20 � ,,pw

  H%=pw
  d=�(filecore_drives)

  � d=0 �
   drive$(n)=fs$+"!":n+=1
1�   SYS "Director_Option",fs$+" -grey -sub ?"
  �
   flop=d � 256
   hard=d � 256
   �info(0,flop)
   �info(4,hard)
  �
 �
� ins=0
ș "OS_FSControl",19

*Menu Drives -temp
� i=0 � n-1
 k=i
 � j=i � n-1
   � drive$(j)<drive$(k) k=j
! �
" Ȕ drive$(i),drive$(k)
# fs$=�drive$(i))
$ dn$=�drive$(i))
% � dn$="!" �
&6  ș "Director_Option",�drive$(i))+" -grey -sub ?"
' �
(k  ș "Director_Option",fs$+"::"+dn$+" -sub ""Dynamic:Run Director:Menus.System.Drive "+fs$+" "+dn$+""""
)>  ș "Director_Command","Filer_OpenDir "+fs$+"::"+dn$+".$"
* �
+�
,*EndMenu
-*Set Director$Menu Drives
.�
/:
0� �info(base,num)
1
� num=0 �
2� drive=base � base+num-1
3 drive$(n)=fs$+�drive:n+=1
4�
5�
6:
7
8:
9� �code
:� code 100
;� pass=0 � 2 � 2:P%=code
<
[OPT pass
=.filecore_drives
> MOV r8,r7
? SWI "XFileCore_Drives"
@ ADD r0,r1,r2,LSL #8
A MOV pc,r14
B]�
C�
D:
E� �0(a)
F	s$=""
Gȕ ?a<>0
H s$+=�?a
I	 a+=1
J�
K=s$
�
00000000  0d 00 01 27 f4 20 3e 44  69 72 65 63 74 6f 72 3a  |...'. >Director:|
00000010  4d 65 6e 75 73 2e 53 79  73 74 65 6d 2e 46 69 6e  |Menus.System.Fin|
00000020  64 44 72 69 76 65 73 0d  00 02 2c c8 99 20 22 4f  |dDrives...,.. "O|
00000030  53 5f 4d 6f 64 75 6c 65  22 2c 31 38 2c 22 46 69  |S_Module",18,"Fi|
00000040  6c 65 43 6f 72 65 25 42  61 73 65 22 20 b8 20 2c  |leCore%Base" . ,|
00000050  6d 6f 64 0d 00 03 11 de  20 64 72 69 76 65 24 28  |mod..... drive$(|
00000060  31 30 30 29 0d 00 04 07  6e 3d 30 0d 00 05 09 f2  |100)....n=0.....|
00000070  63 6f 64 65 0d 00 06 09  69 6e 73 3d 30 0d 00 07  |code....ins=0...|
00000080  05 f5 0d 00 08 33 20 c8  99 20 22 4f 53 5f 4d 6f  |.....3 .. "OS_Mo|
00000090  64 75 6c 65 22 2c 31 32  2c 6d 6f 64 2c 69 6e 73  |dule",12,mod,ins|
000000a0  20 b8 20 2c 6d 6f 64 2c  69 6e 73 2c 2c 2c 70 6f  | . ,mod,ins,,,po|
000000b0  73 74 66 69 78 0d 00 09  0f 20 e7 20 69 6e 73 3c  |stfix.... . ins<|
000000c0  3e 30 20 8c 0d 00 0a 15  20 20 66 73 24 3d a4 30  |>0 .....  fs$=.0|
000000d0  28 70 6f 73 74 66 69 78  29 0d 00 0b 22 20 20 c8  |(postfix)..."  .|
000000e0  99 20 22 4f 53 5f 46 53  43 6f 6e 74 72 6f 6c 22  |. "OS_FSControl"|
000000f0  2c 31 31 2c 66 73 24 2b  22 3a 22 0d 00 0c 21 20  |,11,fs$+":"...! |
00000100  20 c8 99 20 22 4f 53 5f  46 53 43 6f 6e 74 72 6f  | .. "OS_FSContro|
00000110  6c 22 2c 32 30 20 b8 20  2c 2c 70 77 0d 00 0d 0b  |l",20 . ,,pw....|
00000120  20 20 48 25 3d 70 77 0d  00 0e 1a 20 20 64 3d ba  |  H%=pw....  d=.|
00000130  28 66 69 6c 65 63 6f 72  65 5f 64 72 69 76 65 73  |(filecore_drives|
00000140  29 0d 00 0f 0d 20 20 e7  20 64 3d 30 20 8c 0d 00  |)....  . d=0 ...|
00000150  10 1d 20 20 20 64 72 69  76 65 24 28 6e 29 3d 66  |..   drive$(n)=f|
00000160  73 24 2b 22 21 22 3a 6e  2b 3d 31 0d 00 11 31 f4  |s$+"!":n+=1...1.|
00000170  20 20 20 53 59 53 20 22  44 69 72 65 63 74 6f 72  |   SYS "Director|
00000180  5f 4f 70 74 69 6f 6e 22  2c 66 73 24 2b 22 20 2d  |_Option",fs$+" -|
00000190  67 72 65 79 20 2d 73 75  62 20 3f 22 0d 00 12 07  |grey -sub ?"....|
000001a0  20 20 cc 0d 00 13 13 20  20 20 66 6c 6f 70 3d 64  |  .....   flop=d|
000001b0  20 83 20 32 35 36 0d 00  14 13 20 20 20 68 61 72  | . 256....   har|
000001c0  64 3d 64 20 81 20 32 35  36 0d 00 15 14 20 20 20  |d=d . 256....   |
000001d0  f2 69 6e 66 6f 28 30 2c  66 6c 6f 70 29 0d 00 16  |.info(0,flop)...|
000001e0  14 20 20 20 f2 69 6e 66  6f 28 34 2c 68 61 72 64  |.   .info(4,hard|
000001f0  29 0d 00 17 07 20 20 cd  0d 00 18 06 20 cd 0d 00  |)....  ..... ...|
00000200  19 0b fd 20 69 6e 73 3d  30 0d 00 1a 18 c8 99 20  |... ins=0...... |
00000210  22 4f 53 5f 46 53 43 6f  6e 74 72 6f 6c 22 2c 31  |"OS_FSControl",1|
00000220  39 0d 00 1b 04 0d 00 1c  16 2a 4d 65 6e 75 20 44  |9........*Menu D|
00000230  72 69 76 65 73 20 2d 74  65 6d 70 0d 00 1d 0f e3  |rives -temp.....|
00000240  20 69 3d 30 20 b8 20 6e  2d 31 0d 00 1e 08 20 6b  | i=0 . n-1.... k|
00000250  3d 69 0d 00 1f 10 20 e3  20 6a 3d 69 20 b8 20 6e  |=i.... . j=i . n|
00000260  2d 31 0d 00 20 1f 20 20  e7 20 64 72 69 76 65 24  |-1.. .  . drive$|
00000270  28 6a 29 3c 64 72 69 76  65 24 28 6b 29 20 6b 3d  |(j)<drive$(k) k=|
00000280  6a 0d 00 21 06 20 ed 0d  00 22 1b 20 c8 94 20 64  |j..!. ...". .. d|
00000290  72 69 76 65 24 28 69 29  2c 64 72 69 76 65 24 28  |rive$(i),drive$(|
000002a0  6b 29 0d 00 23 14 20 66  73 24 3d c0 64 72 69 76  |k)..#. fs$=.driv|
000002b0  65 24 28 69 29 29 0d 00  24 14 20 64 6e 24 3d c2  |e$(i))..$. dn$=.|
000002c0  64 72 69 76 65 24 28 69  29 29 0d 00 25 10 20 e7  |drive$(i))..%. .|
000002d0  20 64 6e 24 3d 22 21 22  20 8c 0d 00 26 36 20 20  | dn$="!" ...&6  |
000002e0  c8 99 20 22 44 69 72 65  63 74 6f 72 5f 4f 70 74  |.. "Director_Opt|
000002f0  69 6f 6e 22 2c c0 64 72  69 76 65 24 28 69 29 29  |ion",.drive$(i))|
00000300  2b 22 20 2d 67 72 65 79  20 2d 73 75 62 20 3f 22  |+" -grey -sub ?"|
00000310  0d 00 27 06 20 cc 0d 00  28 6b 20 20 c8 99 20 22  |..'. ...(k  .. "|
00000320  44 69 72 65 63 74 6f 72  5f 4f 70 74 69 6f 6e 22  |Director_Option"|
00000330  2c 66 73 24 2b 22 3a 3a  22 2b 64 6e 24 2b 22 20  |,fs$+"::"+dn$+" |
00000340  2d 73 75 62 20 22 22 44  79 6e 61 6d 69 63 3a 52  |-sub ""Dynamic:R|
00000350  75 6e 20 44 69 72 65 63  74 6f 72 3a 4d 65 6e 75  |un Director:Menu|
00000360  73 2e 53 79 73 74 65 6d  2e 44 72 69 76 65 20 22  |s.System.Drive "|
00000370  2b 66 73 24 2b 22 20 22  2b 64 6e 24 2b 22 22 22  |+fs$+" "+dn$+"""|
00000380  22 0d 00 29 3e 20 20 c8  99 20 22 44 69 72 65 63  |"..)>  .. "Direc|
00000390  74 6f 72 5f 43 6f 6d 6d  61 6e 64 22 2c 22 46 69  |tor_Command","Fi|
000003a0  6c 65 72 5f 4f 70 65 6e  44 69 72 20 22 2b 66 73  |ler_OpenDir "+fs|
000003b0  24 2b 22 3a 3a 22 2b 64  6e 24 2b 22 2e 24 22 0d  |$+"::"+dn$+".$".|
000003c0  00 2a 06 20 cd 0d 00 2b  05 ed 0d 00 2c 0c 2a 45  |.*. ...+....,.*E|
000003d0  6e 64 4d 65 6e 75 0d 00  2d 1d 2a 53 65 74 20 44  |ndMenu..-.*Set D|
000003e0  69 72 65 63 74 6f 72 24  4d 65 6e 75 20 44 72 69  |irector$Menu Dri|
000003f0  76 65 73 0d 00 2e 05 e0  0d 00 2f 05 3a 0d 00 30  |ves......./.:..0|
00000400  15 dd 20 f2 69 6e 66 6f  28 62 61 73 65 2c 6e 75  |.. .info(base,nu|
00000410  6d 29 0d 00 31 0d e7 20  6e 75 6d 3d 30 20 e1 0d  |m)..1.. num=0 ..|
00000420  00 32 1d e3 20 64 72 69  76 65 3d 62 61 73 65 20  |.2.. drive=base |
00000430  b8 20 62 61 73 65 2b 6e  75 6d 2d 31 0d 00 33 1e  |. base+num-1..3.|
00000440  20 64 72 69 76 65 24 28  6e 29 3d 66 73 24 2b c3  | drive$(n)=fs$+.|
00000450  64 72 69 76 65 3a 6e 2b  3d 31 0d 00 34 05 ed 0d  |drive:n+=1..4...|
00000460  00 35 05 e1 0d 00 36 05  3a 0d 00 37 04 0d 00 38  |.5....6.:..7...8|
00000470  05 3a 0d 00 39 0b dd 20  f2 63 6f 64 65 0d 00 3a  |.:..9.. .code..:|
00000480  0e de 20 63 6f 64 65 20  31 30 30 0d 00 3b 1c e3  |.. code 100..;..|
00000490  20 70 61 73 73 3d 30 20  b8 20 32 20 88 20 32 3a  | pass=0 . 2 . 2:|
000004a0  50 25 3d 63 6f 64 65 0d  00 3c 0d 5b 4f 50 54 20  |P%=code..<.[OPT |
000004b0  70 61 73 73 0d 00 3d 14  2e 66 69 6c 65 63 6f 72  |pass..=..filecor|
000004c0  65 5f 64 72 69 76 65 73  0d 00 3e 0e 20 4d 4f 56  |e_drives..>. MOV|
000004d0  20 72 38 2c 72 37 0d 00  3f 1b 20 53 57 49 20 22  | r8,r7..?. SWI "|
000004e0  58 46 69 6c 65 43 6f 72  65 5f 44 72 69 76 65 73  |XFileCore_Drives|
000004f0  22 0d 00 40 18 20 41 44  44 20 72 30 2c 72 31 2c  |"..@. ADD r0,r1,|
00000500  72 32 2c 4c 53 4c 20 23  38 0d 00 41 0f 20 4d 4f  |r2,LSL #8..A. MO|
00000510  56 20 70 63 2c 72 31 34  0d 00 42 06 5d ed 0d 00  |V pc,r14..B.]...|
00000520  43 05 e1 0d 00 44 05 3a  0d 00 45 0b dd 20 a4 30  |C....D.:..E.. .0|
00000530  28 61 29 0d 00 46 09 73  24 3d 22 22 0d 00 47 0c  |(a)..F.s$=""..G.|
00000540  c8 95 20 3f 61 3c 3e 30  0d 00 48 0c 20 73 24 2b  |.. ?a<>0..H. s$+|
00000550  3d bd 3f 61 0d 00 49 09  20 61 2b 3d 31 0d 00 4a  |=.?a..I. a+=1..J|
00000560  05 ce 0d 00 4b 07 3d 73  24 0d ff                 |....K.=s$..|
0000056b