1 REMark menuboot (c) Timo Salmi
2 REMark Tue 1992 Oct 20 06:48:07
3 REMark version 1.45
4 :
100 DIM vr$(3):vr$=VER$:IF vr$="JM":progs%=8:ELSE :progs%=10:END IF 
110 maxprogs%=10:DIM prog$(maxprogs%,21),valinta(maxprogs%),v$(19)
120 alku%=12:vali%=14:p_programs:ptr%=7:prev_ptr%=ptr%
130 reset(4)
140 PRINT"           MENUBOOT by Timo Salmi 25-Mar-91":INK#0,0:STRIP#0,2
150 INK 4:LINE 0,95 TO 168,95:v$=DATE$:v$=v$(1 TO 4):PRINT#0,™DAY$!DATE$
160 IF v$<>1992 THEN 
170  PRINT"DATE ERROR"!DAY$!DATE$™"SDATE AND RUN":STOP:END IF 
180 FOR i=1 TO progs%:valinta(i)=1:END FOR i
190 FOR i=4,10:valinta(i)=0:END FOR i
200 FOR i=1 TO progs%:p_show_prog(i),(valinta(i)):END FOR i
210 p_show_ptr(ptr%),(1)
220 INK 4:LINE 0,10 TO 168,10:PAPER 0:INK 7:AT 18,2
230 PRINT" and  to point; space to toggle; CTRL Y to quit"
240 AT 19,20:PRINT"F2 to execute":IF NOT f_choice THEN STOP
250 reset(8)
260 IF valinta(1):a=RESPR(43*512):LBYTES fdk1_lng_TEXT_ext,a:CALL a:END IF 
270 IF valinta(1):a=RESPR(14*512):LBYTES fdk1_lng_MATH_ext,a:CALL a:END IF 
280 IF valinta(1):a=RESPR(9*512):LBYTES fdk1_lng_GRAF_ext,a:CALL a:END IF 
290 IF valinta(2):a=RESPR(2118):LBYTES fdk1_cst_ram_bin,a:CALL a:END IF 
300 IF valinta(3) AND valinta(2):FORMAT ram1_256:DIR ram1_:END IF 
310 IF valinta(4) AND valinta(2):FORMAT ram1_512:DIR ram1_:END IF 
320 IF valinta(5):a=RESPR(6144):LBYTES fdk1_turbo_tk_code,a:CALL a
330 REMark IF valinta(6):FLP_EXT:END IF
340 IF valinta(6):a=RESPR(9216):LBYTES fdk1_exten_bin,a:CALL a:END IF 
350 IF valinta(7):PAUSE 100:EXEC fdk1_gback_exe:END IF 
360 IF valinta(8) AND valinta(6) THEN 
370  IF vr$="JM" THEN LRUN fdk1_exeboot
380  PAUSE 100:EXEC fdk1_paivays2_exe:END IF 
390 IF valinta(9) AND valinta(6) THEN 
400  PAUSE 100:EXEC fdk1_memory2_exe:END IF 
410 IF valinta(10) AND valinta(5) THEN 
420  PAUSE 100:EXEC fdk1_trace_exe:END IF 
430 reset(8):clb=KEYROW(0):NEW
440 :
2000 DEFine PROCedure p_programs
2010  prog$(1)="fdk1_lightning"
2020  prog$(2)="fdk1_cst_ram_bin"
2030  prog$(3)="FORMAT ram 1x256"
2040  prog$(4)="FORMAT ram 1x512"
2050  prog$(5)="fdk1_turbo_tk_code"
2060  prog$(6)="fdk1_exten_bin"
2070  prog$(7)="fdk1_gback_exe"
2080  IF vr$="JM" THEN 
2090   prog$(8)="fdk1_exeboot"
2100  ELSE 
2110   prog$(8)="fdk1_paivays2_exe"
2120   prog$(9)="fdk1_memory2_exe"
2130   prog$(10)="fdk1_trace_exe"
2140  END IF 
2150 END DEFine p_programs
2160 :
3000 DEFine PROCedure p_show_prog(prog_nro%,rvson%)
3010  INK 7:CURSOR 40,vali%*prog_nro%+alku%:PRINT prog_nro%;".";
3020  IF rvson%:STRIP 4:INK 0:ELSE :PAPER 0:INK 7:END IF 
3030  CURSOR 70,vali%*prog_nro%+alku%
3040  PRINT prog$(prog_nro%);:INK 7:PAPER 0
3050 END DEFine p_show_prog
3060 :
3070 DEFine PROCedure p_show_ptr(prog_nro%,show%)
3080  CURSOR 10,vali%*prog_nro%+alku%
3090  IF show%:PRINT"->":ELSE :PRINT"  ":END IF 
3100 END DEFine p_show_ptr
3110 :
3120 DEFine PROCedure p_vapauta
3130  LOCal key,loop
3140  clb=KEYROW(0)
3150  REPeat loop:IF CODE(INKEY$(0))=0:RETurn :END IF :END REPeat loop
3160 END DEFine p_vapauta
3170 :
4000 DEFine FuNction f_choice
4010  LOCal key,loop
4020  clb%=KEYROW(0):REMark to empty buffer
4030  REPeat loop
4040   key=CODE(INKEY$(-1))
4050   SELect ON key
4060   =208
4070    IF ptr%>1 THEN 
4080     prev_ptr%=ptr%:ptr%=ptr%-1
4090     p_show_ptr(prev_ptr%),(0):p_show_ptr(ptr%),(1)
4100    END IF 
4110    NEXT loop
4120   =216
4130    IF ptr%<progs% THEN 
4140     prev_ptr%=ptr%:ptr%=ptr%+1
4150     p_show_ptr(prev_ptr%),(0):p_show_ptr(ptr%),(1)
4160    END IF 
4170    NEXT loop
4180   =32
4190    p_vapauta
4200    IF valinta(ptr%) THEN 
4210      valinta(ptr%)=0:p_show_prog(ptr%),(0)
4220     ELSE 
4230      valinta(ptr%)=1:p_show_prog(ptr%),(1)
4240    END IF 
4250   =236:RETurn 1
4260   =25,185:RETurn 0
4270   END SELect 
4280  END REPeat loop
4290 END DEFine f_choice
4300 :
31000 DEFine PROCedure reset(i)
31010  LOCal il:MODE i
31020  FOR il=1,2:OPEN#il,con_:END FOR il
31030  WINDOW 512,256,0,0:PAPER 0:CLS
31040  WINDOW#0,448,40-(i=4),32,216+(i=4)
31050  WINDOW#2,448,200,32,16:PAPER#2,1:INK#2,7
31060  WINDOW 448+8*(i=4),200+2*(i=4),32-4*(i=4),16-(i=4)
31070  PAPER 2*(i=8):BORDER (i=4),4*(i=4)
31080  FOR il=0,1,2:CSIZE#il,(i=4)+2*(i=8),0:END FOR il
31090  PAPER#0,0:INK#0,7-3*(i=0):INK 7:CLS
31100  SCALE 100,0,0:FILL 0
31110 END DEFine reset
31120 :
31990 STOP
32000 vsave 1:STOP
32010 vsave 2:STOP
32020 vsave 3:STOP
32030 vsave 4:STOP
32040 vsave 5:STOP
32050 vsave 6:STOP
32060 DEFine PROCedure vsave(dr)
32070  LOCal avl$(42),bvl$(42),dvl$(6,5):avl$="menuboot"
32080  bvl$=DATE$:bvl$=bvl$(1 TO 4)
32090  IF bvl$<>1992 THEN 
32100   PRINT#0,DAY$!DATE$!"Not saved, set SDATE"
32110   BEEP 4000,12:STOP:END IF 
32120  ver1%=1:ver2%=45
32130  dvl$(1)="mdv1_":dvl$(2)="mdv2_"
32140  dvl$(3)="fdk1_":dvl$(4)="fdk2_"
32150  dvl$(5)="ram1_":dvl$(6)="ram2_"
32160  bvl$=dvl$(dr)&avl$
32170  DELETE bvl$:OPEN_NEW#3,bvl$:ver%=ver2%+1
32180  PRINT#3,"1 REMark ";avl$!"(c) Timo Salmi"
32190  PRINT#3,"2 REMark ";DAY$!DATE$
32200  PRINT#3,"3 REMark version"!ver1%;".";ver%
32210  PRINT#3,"4 :"
32220  LIST#3,100 TO 32110
32230  PRINT#3,"32120  ver1%=";ver1%;":ver2%=";ver%
32240  LIST#3,32130 TO:CLOSE#3
32250  PRINT#0,"Saved"!bvl$!"version"!ver1%;".";ver%
32260 END DEFine vsave
