10REM"
20REM"
40REM"
60REM" This program will save
a
70REM" routine to an ADFS disc whic
h
80REM" when *RUN will catalogue
a
90REM" directory. Use the symbol nex
t
100REM" to the name of the program t
o
110REM" run the program or move int
o
120REM" that directory. Use $ to MOUN
T
130REM" another disc or move back t
o
140REM" the root directory.
150REM" This program also builds
a
155REM" !BOOT file and sets OPT 4 3
.
160REM" -----------------------------
-
170REM" This program is Public domain
.
180REM" Please do not alter it in an
y
190REM" way. If you use any of th
e
200REM" routines, please mention m
e
210REM" in the titles. Thanks, CJR
.
220REM" -----------------------------
-
230DEFFNS="ADFSMEN"
240MODE7:PRINT':PROCd("ADFS auto menu.
By C.J.Richardson.")
250PRINT':PROCd("Insert an ADFS disc i
nto drive 0")
260PRINT':PROCd("Then press a key to s
ave")
270PRINT':PROCd("the code and !BOOT fi
le")
280REPEATUNTILGET
290*ADFS
300*MOUNT
310PROCass
320OSCLI"SA. "+"mcmenu "+STR$÷M%+" "+S
TR$÷P%+" "+STR$÷T%
330OSCLI"SPOOL !BOOT":PRINT"*B."'"*DIR
$"'"*/mcmenu":OSCLI"SPOOL"
340*OPT 4 3
350PROCd("Shift + break to run")
360END
370DEFPROCd(A$):PRINTTAB(18-LENA$/2)"
380DEFPROCass:M%=&921:REM CODE CAN BE
ANYWHERE AS LONG AS NOT OVER THIS PROGRA
M!
390FORL%=0TO2STEP2
400P%=M%
410[:OPTL%:.A%:LDA#22:JSR&FFEE:LDA#&7:
JSR&FFEE:LDA#0:STA&70:LDA#13:STA&81
420.J%:JSRC%:BCS N% ½ SETUP
430JSRX%:CMP#2:BNEY%:LDA#129:BNEZ%
440.Y%:LDA#131:.Z%:JSR&FFEE ½ NOT A D
IRECTORY 131 IS 129
450LDA&70:ADC#48:JSR&FFEE:LDA#134:JSR&
FFEE:LDY#1:.I%:LDA&76,Y:JSR&FFEE:INY:CPY
#11:BNEI%:LDY#7:LDA#32:.E%:JSR&FFEE:DEY:
BNE E% ½ PRINT COLOURS AND NAMES
460INC&70:JMP J% ½ PRINT FILES
470.C%:LDY#&20:LDA#0:.B%:STA&900,Y:DEY
:BNEB%:.F% ½ BLANK OUT
480LDA#&76:STA&901 ½ READ TO &76
490LDA#1:STA&905 ½ READ ONE FILE
500LDA&70:STA&909 ½ NEXT FILE TO READ
510LDX#&00:LDY#&09:LDA#08:JMP&FFD1 ½ R
EAD FILES
520.N%:JSR&FFE7:LDY#0:.Q%:LDA O%,Y:INY
:JSR&FFEE:CMP#13:BNEQ% ½ PRINT INFO
530.D%:LDX#0:LDA#&15:JSR&FFF4 ½ FLUSH
BUFFER
540.G%:LDX#0:LDA#&91:JSR&FFF4:TYA:CMP#
36:BEQ T%:SBC#48:STA&70:TYA:BEQ G% ½ GE
T KEY
550JSR C%:BCS D%:JSRX% ½ GET SELECTION
NAME. IS IT A DIRECTORY?
560CMP#2:BNEnotdir:LDA#68:STA&73:LDA#7
3:STA&74:LDA#82:STA&75:LDA#32:STA&76:LDX
#&73:LDY#0:JSR&FFF7:JMPA% ½ IT'S A DIREC
TORY
570.T%:LDA#&77:JSR&FFF4:LDX#S% MOD 256
:LDY#S% DIV 256:JSR&FFF7:LDX#(S%+3)MOD25
6:LDY#(S%+3)DIV256:JSR&FFF7 ½ DISMOUNT T
HEN MOUNT
580JMPA%
590.X%:LDA#&77:STA&90D:LDA#0:STA&90E:L
DX#&D:LDY#&9:LDA#&5:JMP&FFDD ½ IS IT A D
IRECTORY?
600.notdir:JSRbasch%:BNEnobas%
610LDA#75:STA&70:LDA#46:STA&71:LDA#48:
STA&72:LDA#67:STA&73:LDA#72:STA&74:LDA#4
6:STA&75:LDA#34:STA&76:LDA#34:STA&81:LDA
#124:STA&82:LDA#77:STA&83:LDA#13:STA&84
½ PROGRAM F0 WITH CHAIN
620LDX#&70:LDY#0:JSR&FFF7
630LDX#0:LDA#&15:JSR&FFF4
640LDX#0:LDY#128:LDA#138:JMP&FFF4 ½ PR
ESS F0
650.nobas%:LDX#&77:LDY#0:JMP&FFF7 ½ *R
UN THE PROGRAM
660.basch%:LDA#&40:LDX#&77:LDY#0:JSR&F
FCE ½ CHECKS FOR BASIC. OPEN PROG NAME
670STA&74:TAY:JSR&FFD7:CMP#&D:BEQl1%:L
DA#1:RTS ½ 1st byte &D? No RTS yes cont
inue
680.l1%:LDA&917:STA&70:DEC&70:DEC&70:L
DA&918:STA&71:LDA#0:STA&72:STA&73:LDY&74
:LDX#&70:LDA#1:JSR&FFDA ½ WRITE POINTER
TO NEXT TO EOF
690LDY&74:JSR&FFD7:CMP#&D:BEQl2:LDA#1:
RTS ½ IS IT &D?
700.l2:LDY&74:JSR&FFD7:CMP#&FF:BEQl3:L
DA#1:RTS ½ IS LAST &FF?
710.l3:LDA#0:RTS ½ IT'S BASIC
720.S%:EQUS"DISMOUNT":EQUB13
730.O%:EQUS"CJR. Choose. Directory. Pr
ogram. Or $.":EQUB13
740]:NEXT:ENDPROC