home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-02-21 | 11.7 KB | 414 lines |
- '-----------------------------------------
- ' RAMOS 1.3 Installer, By Francois Lionet
- ' (c) 1992 Europress Software Ltd.
- '-----------------------------------------
- Set Buffer 40
- '
- Global CPTFILE,QUIT,VER$,VACT$
- Global HD$,ND$,DT$
- Global PAR,PAR$,HD$,USER$,DISKET
- Global MXSIZE,UBANK,AKEY
- Global XDI,XDIV,YDI,C1,C2,C3,DITOT,OXDI
- Global C0,C1,C2,C3,C4,C5
- Global S_NAME$,D_NAME$,S_DISK$,D_DISK$,SDRV,DDRV
- '
- C0=0 : C1=5 : C2=1 : C3=10 : C4=11 : C5=12
- UBANK=7 : MXSIZE=125000 : Reserve As Work UBANK,MXSIZE
- VER$="1.33a"
- Set Dir ,""
- '
- _GET_DRIVES
- '
- Set Sprite Buffer 40
- Screen Open 0,640,200,4,Hires
- Curs Off : Flash Off : Palette 0,0,0,0
- '
- Do
- '
- E=0
- _SETUP_MENU[1]
- Exit If QUIT
- '
- _SETUP_MENU[2]
- Exit If QUIT
- Exit If PAR=1
- '
- '_SETUP_MENU[3]
- _MAKE_SETUP_SCREEN
- _GET_DISC[D_DISK$,"AMOS:","the copy of your AMOS Programs Disc"]
- Exit If QUIT
- '
- _SETUP_MENU[4]
- Exit If QUIT
- '
- _SETUP_MENU[5]
- _DELETE_OLD_FILES[D_DISK$]
- '
- _FILE_COPY["RAMOS1.3","RAMOS1.3"]
- E=Param : Exit If E
- _FILE_COPY["AMOS_System/RAMOS1_3.Env","AMOS_System/RAMOS1_3.Env"]
- E=Param : Exit If E
- '
- Open Out 1,D_DISK$+"s/startup-sequence"
- Print #1,"Run >NIL: RAMOS1.3";Chr$(10);
- Print #1,"EndCli";Chr$(10);
- Close 1
- '
- _SETUP_MENU[7]
- _SETUP_MENU[8]
- '
- E=0 : Exit
- '
- Loop
- '
- If E
- _SETUP_MENU[6]
- End If
- '
- Screen Close 0
- Edit
- '
- Procedure _SETUP_MENU[PAGE]
- Shared XX,YY
- Dim JMP$(64),ZIT(64),ITZ(64),ZBASE(64)
- QUIT=0
- _MAKE_SETUP_SCREEN
- ' Handle menu
- MK_MENU:
- Curs Off : Gosub DR_MENU
- If EX : Pop Proc : End If
- NOZ=1
- Do
- Repeat
- Multi Wait
- Z=Mouse Zone : K=Mouse Key
- If Z<>OLDZ
- If OLDZ>0 : ACT=-1 : IT=ZIT(OLDZ) : OLDZ=-1 : Gosub DR_ITEM : End If
- If Z>0 : OLDZ=Z : ACT=Z : IT=ZIT(Z) : ZNE=ZBASE(IT) : Gosub DR_ITEM : End If
- End If
- Until Z<>0 and K<>0
- If JMP$(Z)<>"" : Gosub JMP$(Z) : End If
- ACT=Z : ZNE=ZBASE(IT) : Gosub DR_ITEM
- If K=1 : Repeat : Multi Wait : Until Mouse Key=0 : End If
- Loop
- '
- '
- ST_FLAG: V=1-V : Gosub "POK"+VTYPE$ : Return
- ' Draw menu page
- DR_MENU:
- Reserve Zone 64
- IT=0 : ZNE=1 : NOZ=0 : ACT=-1 : OLDPAR=-1
- Repeat
- Inc IT : ZBASE(IT)=ZNE : Gosub DR_ITEM
- Until FLAG=False
- Return
- ' Draw one menu item
- DR_ITEM:
- LAB$="L"+(Str$(PAGE)-" ")+"_"+(Str$(IT)-" ")
- On Error Goto NO_IT
- Restore LAB$ : Read IT$
- M=0 : XX=-1
- Repeat
- NEND=Instr(IT$,"|",M+1)
- ENC=0 : LBL$="" : FL=0 : ZZ=0 : NB=0
- Repeat
- N=M+1
- M=Instr(IT$,",",N) : M2=Instr(IT$,":",N) : If M>M2 : M=0 : End If
- If M=0 or(NEND<>0 and M1>NEND) : M=M2 : FL=1 : End If
- A$=Upper$(Mid$(IT$,N,1)) : Inc N
- If A$="E" : ENC=1 : End If
- If A$="L" : Gosub GT_STR : LBL$=A$ : Inc ZZ : End If
- If A$="C" : CNT=1 : End If
- If A$="X" : Gosub GT_STR : XX=Val(A$) : End If
- If A$="Y" : Gosub GT_STR : YY=Val(A$) : End If
- If A$="V" : Gosub GT_STR : PAR=Val(A$) : End If
- If A$="W" : Gosub GT_STR : PAR$=A$ : End If
- If A$="Q" : EX=1 : Error 32 : End If
- Until FL
- If NEND
- A$=Mid$(IT$,M+1,NEND-M-1)
- Else
- A$=Mid$(IT$,M+1)
- End If
- Gosub DR_WORD
- M=NEND
- Until NEND=0
- On Error
- FLAG=True
- Return
- '
- DR_WORD:
- If XX<0 : XX=40-Len(A$)/2 : End If
- Locate XX,YY
- '
- FST=0
- '
- If Left$(A$,1)="&"
- A$=Mid$(A$,2,1)
- If A$="R"
- A$=Upper$(Left$(NAMES$,3)) : A$=A$+Space$(3-Len(A$))
- A$=A$+REG$
- End If
- End If
- '
- X1=X Graphic(XX)-3 : Y1=Y Graphic(YY)-2 : X2=X Graphic(XX+Len(A$))+2 : Y2=Y1+11
- '
- If ZZ<>0 or NOZ=0 or FST<>0
- Inverse Off : If ZZ<>0 and ACT=ZNE : Inverse On : End If
- Print A$;
- If ENC<>0 and NOZ=0 : Box X1,Y1 To X2,Y2 : End If
- End If
- If ZZ<>0
- If NOZ=0
- Set Zone ZNE,X1,Y1 To X2,Y2
- ZIT(ZNE)=IT : ITZ(IT)=ZNE
- If LBL$<>""
- JMP$(ZNE)=LBL$
- End If
- End If
- Inc ZNE
- End If
- XX=XX+(X2-X1)/8+1
- Return
- '
- NO_IT: Resume NO_IT2
- NO_IT2: FLAG=False
- Return
- '
- GT_STR:
- A$=Mid$(IT$,N,M-N)
- Return
- '
- MN_QUIT:
- QUIT=-1 : PAR=0
- MN_OUT:
- Pop : Flash Off : Fade 1 : Wait 16 : Goto _END
- MN_QUIT2:
- QUIT=-1 : PAR=0
- MN_OUT2:
- Pop : Goto _END
- '
- ' Data page 1
- L1_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L1_2: Data "C,Y05:by Fran�ois Lionet"
- L1_3: Data "C,Y07:(c) 1992 Europress Software Ltd."
- L1_4: Data "C,Y12:Welcome to this program. To successfully create a bootable"
- L1_5: Data "C,Y13:version of the Run-Only version of AMOS follow carefully"
- L1_6: Data "C,Y14:all the prompts."
- L1_7: Data "C,Y18:The whole process will take about 15 minutes."
- L1_8: Data "E,X71,Y23,LMn_Quit: Abort "
- L1_9: Data "E,X61,Y23,LMn_Out2: Go On "
- '
- ' Data page 2
- L2_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L2_2: Data "C,Y05:The first thing to do, is a disk-copy of your AMOS Programs Disc."
- L2_3: Data "C,Y07:This copy will be modified by the RAMOS Bootable Disc creator. Doing this"
- L2_4: Data "C,Y08:ensures that all the system files are properly installed."
- L2_5: Data "C,Y10:You *MUST NOT* use your original AMOS Programs Disc, because the"
- L2_6: Data "C,Y11:RAMOS Creator removes the majority of the files from it!"
- L2_7: Data "C,Y13:To do the copy, either use a third party disc-copy program,"
- L2_8: Data "C,Y14:or boot with your original Workbench Disc, and use the 'Disk-Copy'"
- L2_9: Data "C,Y15:option from the Workbench menu, and copy the disc according"
- L2_10: Data "C,Y16:to the Workbench prompts."
- L2_11: Data "C,Y18,E,V1,LMn_Out2: Click here to quit AMOS and do a disc-copy of the AMOS Programs disc "
- L2_12: Data "C,Y20,E,V2,LMn_Out2: Your copy is ready, click here to create the RAMOS Bootable disc "
- L2_13: Data "E,X71,Y23,LMn_Quit: Abort "
- '
- ' Data page 4
- L4_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L4_2: Data "C,Y07,E:"+Pen$(3)+" This is your last WARNING! "+Pen$(1)
- L4_3: Data "C,Y12:Are you sure that the disc in drive "+D_DISK$
- L4_4: Data "C,Y13:is a copy of your AMOS Program Disc,"
- L4_5: Data "C,Y14:and NOT the original master?"
- L4_6: Data "C,Y20,E,V1,LMn_Out2: Click here if you are absolutly sure! "
- L4_7: Data "C,Y22,E,V2,LMn_Quit: Click here to abort RAMOS Creation. "
- '
- ' Data page 5
- L5_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L5_2: Data "C,Y07,E:"+Pen$(3)+" Creating your RAMOS disc "+Pen$(1)
- L5_3: Data "Q"
- '
- ' Data page 6
- L6_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L6_2: Data "C,Y10,E:"+Pen$(3)+" Error during creation process! "+Pen$(1)
- L6_3: Data "C,Y13:Please check your drives and discs."
- L6_4: Data "E,X71,Y23,LMn_Quit: Abort "
- '
- ' Data page 7
- L7_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L7_2: Data "C,Y10,E:"+Pen$(3)+" Your RAMOS Disc is ready! "+Pen$(1)
- L7_3: Data "C,Y13:All you have to do now, is save your AMOS program on this"
- L7_4: Data "C,Y14:floppy, and call it :"
- L7_5: Data "C,Y16,E: AUTOEXEC.AMOS "
- L7_6: Data "C,Y18:RAMOS will automaticaly load and run it upon booting."
- L7_7: Data "E,X71,Y23,LMn_Out2: Go On "
- '
- ' Data page 8
- L8_1: Data "C,Y2,E: RAMOS Bootable Disc Creator "
- L8_2: Data "C,Y04:Read this carefully:"
- L8_3: Data "C,Y06:If your program uses instructions from any extension other than the"
- L8_4: Data "C,Y07:Screen Compactor or the Music Extension, you *must* do the following :"
- L8_5: Data "Y09,X00:(1) Under AMOS, run CONFIG1_3.AMOS, the configuration program."
- L8_6: Data "Y11,X00:(2) Load the RAMOS1_3.Env environment file from your RAMOS Bootable disc,"
- L8_7: Data "Y12,X00: this file can be found in the AMOS_System folder."
- L8_8: Data "Y14,X00:(3) From the menu, select the option 'Loaded Extensions'."
- L8_9: Data "Y16,X00:(4) Add the extra extension name in the list, at the correct location"
- L8_10: Data "Y17,X00: as you did when you installed them to the interpretor."
- L8_11: Data "Y19,X00:(5) Save the new RAMOS1_3.Env configuration to its original place."
- L8_12: Data "C,Y21,E: RAMOS will fail if your program calls an extension that is not loaded! "
- L8_13: Data "E,X71,Y23,LMn_Out2: Go On "
- _END:
- End Proc[PAR]
- Procedure _DELETE_OLD_FILES[PATH$]
- '
- CPTFILE=0
- INFO["Making room on the disc."]
- '
- _DELETE_FILES[PATH$,"*.AMOS"]
- _DELETE_FILES[PATH$,"*.ACC"]
- _DELETE_FILES[PATH$,"AM**"]
- _DELETE_FILES[PATH$,"*.info"]
- _DELETE_FILES[PATH$+"AMOS_System/","De*.info"]
- _DELETE_ALL[PATH$+"Manual"]
- _DELETE_ALL[PATH$+"Help"]
- _DELETE_ALL[PATH$+"Keyboards"]
- '
- End Proc
- Procedure _DELETE_FILES[P$,F$]
- Dim FILE$(64)
- X=Free
- '
- On Error Proc _SKIP
- Resume Label _NOFIL
- A$=Dir First$(P$+F$)
- While A$<>""
- If Left$(A$,1)<>"*"
- FILE$(N)=Left$(A$,30)-" " : Inc N
- End If
- A$=Dir Next$
- Wend
- '
- _NOFIL:
- On Error Proc _SKIP
- Resume Label _NOKIL0
- If N
- For NN=0 To N-1
- _INFO_DELETE
- Kill P$+FILE$(NN)
- _NOKIL0:
- Next
- End If
- '
- End Proc
- Procedure _INFO_DELETE
- Inc CPTFILE : INFO["Deleting file number"+Str$(CPTFILE)+"."]
- End Proc
- Procedure _DELETE_ALL[S$]
- Dim FILE$(64)
- X=Free
- '
- C$="/" : If Right$(S$,1)=":" : C$="" : End If
- '
- On Error Proc _SKIP
- Resume Label _NOFILE
- A$=Dir First$(S$+C$+"**")
- While A$<>""
- FILE$(N)=Left$(A$,30)-" " : Inc N
- A$=Dir Next$
- Wend
- _NOFILE:
- '
- On Error Proc _SKIP
- If N
- For NN=0 To N-1
- If Left$(FILE$(NN),1)="*"
- FILE$(NN)=Mid$(FILE$(NN),2)
- A$=S$+C$+FILE$(NN)
- _DELETE_ALL[A$]
- Else
- Resume Label _NOKIL1
- _INFO_DELETE
- Kill S$+C$+FILE$(NN)
- _NOKIL1:
- End If
- Next
- End If
- '
- Resume Label _NOKIL2
- Kill S$
- _INFO_DELETE
- _NOKIL2:
- '
- End Proc
- Procedure _SKIP
- Resume Label
- End Proc
- Procedure _MAKE_SETUP_SCREEN
- Flash Off
- Fade 1,0,0,0,0 : Wait 16
- Paper 0 : Pen 1 : Clw : Curs Off
- Flash 3,"(000,5)(0FF,5)"
- Fade 1,$0,$EEE,$FF0,
- End Proc
- Procedure _GET_DRIVES
- For DDRV=4 To 0 Step -1
- D_DISK$="Df"+Chr$(48+DDRV)+":"
- Exit If Drive(D_DISK$)
- Next
- SDRV=0 : S_DISK$="Df0:"
- End Proc
- Procedure INFO[A$]
- Centre At(,20)+Space$(75)
- Centre At(,20)+A$
- End Proc
- Procedure NOINFO
- INFO[""]
- End Proc
- Procedure _GET_DISC[D$,N$,AL$]
- Request Off
- _FIND_DISC[D$,N$]
- If Param=0
- Bell 61
- INFO[">>> Please insert "+AL$+" into drive "+Pen$(3)+D$+Pen$(1)+" <<<"]
- Repeat
- _FIND_DISC[D$,N$]
- If Inkey$=Chr$(27) : QUIT=-1 : Exit : End If
- Until Param
- INFO[""]
- Wait 50
- End If
- Request On
- End Proc
- Procedure _FIND_DISC[D$,N$]
- N$=Upper$(N$) : L=Len(N$)
- On Error Goto _NO
- For T=0 To 4 : Multi Wait : Next
- A$=Upper$(Disc Info$(D$))
- If Left$(A$,L)=N$ Then F=-1
- Goto _QUIT
- '
- _NO: F=0 : Resume _QUIT
- _QUIT:
- End Proc[F]
- Procedure _FILE_COPY[S$,D$]
- '
- On Error Goto _ERR
- '
- _GET_DISC[S_DISK$,"Extras:","your AMOS Extras Disc"]
- INFO["Loading "+S_DISK$+S$]
- Open In 1,S_DISK$+S$ : S=Lof(1) : Close
- If S>MXSIZE : Stop : End If
- '
- Bload S_DISK$+S$,Start(UBANK)
- '
- _GET_DISC[D_DISK$,"AMOS:","the copy of your AMOS Programs Disc"]
- INFO["Saving "+D_DISK$+D$]
- Bsave D_DISK$+D$,Start(UBANK) To Start(UBANK)+S
- '
- INFO[""]
- '
- Goto _END
- '
- _ERR: E=-1 : Resume _END
- _END:
- End Proc[E]