home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd562
/
fontute.amos
/
fontute.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1990-10-20
|
31KB
|
1,410 lines
'----------------------------------------------------------------------------
' FONT DEMONSTRATOR by Gary O'Connor
' AMOS Basic (c) Mandarin / Jawx 1990
'----------------------------------------------------------------------------
'This programme requires the CLI to be left open on startup.
'
Dim AB$(24),DD(24),CLD(24),AA$(24),MENYU$(59),ADVICE$(9),ABC$(25)
Dim INF$(24),USE$(24),DR$(24),DRN$(24),DSKNAME$(24)
Global FC,FS,MENYU$(),ADVICE$(),D$,LIM,DR$(),DRN$(),DSKNAME$(),DFAIL
Global AA$(),ABC$(),CD$,MC2,SELF$,SELD$,CURD$,DFS,DCH,FTD,FTR,RTD,DNEED
DFS=0 : DCH=0 : FTD=0 : FTR=0 : RTD=0
For X=0 To 58
MENYU$(X)=""
Next X
For X=0 To 7
Read ADVICE$(X)
Next X
For X=0 To 19
INF$(X)=""
USE$(X)=""
DR$(X)=""
DRN$(X)=""
DSKNAME$(X)=""
Next X
Unpack 6 To 0
'Load Iff "df0:FontScreen.IFF",0
'Spack 0 To 6
Flash Off : Curs Off
SCR1OP
Screen 0
Limit Mouse 128,42 To 447,297
GZONES
'Erase 7
Bank To Menu 7
For X=0 To 15
CLD(X)=Colour(X)
Next X
CM=1 : Rem Colour Mode
IC=5 : Rem Ink Colour
PC=1 : Rem paper colour
SF=0 : Rem LowRes Screen
BUILDMENU2
'BUILDMENUS
'Menu To Bank 7
'-----------------
' TEST loop
'-----------------
STBG
Pen 2 : Paper 0
SPECCURCOLS
Wait 100
ALERT[" Select a Drive with menu!"]
FLAG=1
On Error Proc ERRFIX
Resume Label MAIN
MAIN:
Do
If FLAG=0
ALERT[" Choose Font or Drive with menu!"]
End If
Repeat
Curs Off
YM=Y Mouse
If YM<62 and SF=1 Then Screen Hide 1 : SF=0
M=Mouse Click
If M=1
CHKMOUS
End If
If M=2
If SF=1
Screen Hide 1
SF=0
End If
End If
Until Choice
On Choice(1) Proc HELP,GRABFONTS,MAKEFONT,MAKEFONT,MAKEFONT,CHMEN6
Loop
'
Data " "
Data "For all sizes of this font click `ALL' or click `ONE' then `OK'"
Data "No disc font has been selected!"
Data "Insert destination disc in df0: then click `OK'"
Data "Creating `ram:fonts' directory!"
Data "Insufficient Disc space to create `fonts' directory!"
Data "Insufficient Disc space to continue!"
Data "All done! - Click on `EXIT' to finish!"
'
Procedure ERRFIX
EN=Errn
If EN=20
REDALERT["Division by zero!"]
Wait 100
FLAG=0
End If
If EN=88
MYALERT["Disc FULL!!! Aborting operation!"]
Wait 100
Dir$=SD$
BUILDMENU2
AD$=ADVICE$(7)
MYALERT[AD$]
CMZ=0
While CMZ<>1
If Mouse Click=1
COPMOUS
End If
Wend
Screen Close 1
SCR1OP
Screen 0
MAKEFONT
End If
Resume Label
End Proc
'
Procedure SCR1OP
Screen Open 1,640,110,16,Hires
Get Palette 0
Curs Off : Flash Off : Screen 1
Screen Display 1,132,68,640,105
Screen Hide 1
End Proc
'
Procedure COPREQ
Shared CMZ,S$,KK$,SD$,F$,FS$,CD$,DD$,DIOK,DSKFR,R,CH,COPEASY,MENYU$(),ADVICE$(),NU,AD$,SELFT$,DR$(),DRN$(),LIM,DSKNAME$(),CMZ
Reserve Zone 4
Set Zone 1,36,50 To 90,60 : Set Zone 2,536,46 To 566,56
Set Zone 3,536,58 To 566,68 : Set Zone 4,572,46 To 600,68
'Load "FontDisc:CopyReq.abk"
Paste Bob 1,8,1
Ink 11
Paint 538,48,1
Screen Show 1
Pen 8 : Paper 0
COPEASY=0
SD$=SELD$
F$="Topaz" : FS$="8"
If MENYU$(CH)>""
Q=Instr(Font$(CH)," ",2)
F$=Left$(Font$(CH),(Q-1))
FS$=Mid$(Font$(CH),30,3)
End If
K=Val(FS$)
FS$=Str$(K)
LK=Len(FS$)
FS$=Right$(FS$,(LK-1))
Locate 17,4 : Print SD$
Locate 19,6 : Print F$
Locate 59,6 : Print FS$
Locate 64,4 : Print Dfree
LF=Len(F$)
FT$=Left$(Font$(CH),(LF-5))
Locate ,9
Volume 30
AD$=ADVICE$(1)
GC:
MYALERT[AD$]
CMZ=0 : NU=0
DCOPMOUS
If CMZ=2 Then NU=1
If CMZ=3 Then NU=2
If CMZ=1 Then Pop Proc
If NU=0 Then Goto GC
WUNMORE:
CHCOPY
If COPEASY=1
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
Goto GDR
End If
CHM=Chip Free : FAM=Fast Free
If CHM>50000 or FAM>50000
AD$=ADVICE$(4)
MYALERT[AD$]
CD$="ram:c/makedir ram:fonts"+Chr$(0)
DDOS
CD$="ram:c/makedir ram:fonts/"+FT$+Chr$(0)
AD$="Creating `ram:fonts/"+FT$+"' directory!"
MYALERT[AD$]
DDOS
If NU=1
CD$="ram:c/copy "+SD$+"fonts/"+FT$+"/"+FS$+" to ram:fonts/"+FT$+Chr$(0)
AD$="Copying "+SD$+"fonts/"+FT$+"/"+FS$+" to ram:fonts/"+FT$
MYALERT[AD$]
DDOS
End If
If NU=2
CD$="ram:c/copy "+SD$+"fonts/"+FT$+" to ram:fonts/"+FT$+Chr$(0)
AD$="Copying "+SD$+"fonts/"+FT$+" to ram:fonts/"+FT$
MYALERT[AD$]
DDOS
End If
CD$="ram:c/copy "+SD$+"fonts/"+F$+" to ram:fonts"+Chr$(0)
AD$="Copying "+SD$+"fonts/"+F$+" to ram:fonts"
MYALERT[AD$]
DDOS
CHCOPY
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
End If
GDR:
AD$="Checking memory requirements for transfer!"
MYALERT[AD$]
SIZES
MENINF
For X=1 To LIM
If Upper$(KK$)=Upper$(DR$(X))
Dir$=DRN$(X)
DD$=DRN$(X)
End If
Next X
Wait 20
If DD$=SD$
Wait 50
Goto GDR
End If
Pen 8 : Paper 0
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
XX=Dfree
XXX=XX-DNEED
If XXX<0
AD$="Insufficient space for transfer. "+Str$(DNEED)+" bytes needed. Click `OK'"
MYALERT[AD$]
AGIN=1
Else
AD$=Str$(DNEED)+" bytes required for transfer. Click `OK'"
MYALERT[AD$]
AGIN=0
End If
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
If AGIN=1
Locate 17,11 : Print Space$(20)
Locate 64,11 : Print Space$(6)
Goto WUNMORE
End If
AD$="Do you wish to proceed? Click `EXIT' or `OK'"
MYALERT[AD$]
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
E=Exist(DD$+"fonts")
If E<>-1
AD$="Creating `fonts' directory on your disc!"
MYALERT[AD$]
CD$="ram:c/makedir "+DD$+"fonts"+Chr$(0)
DDOS
Wait 50
End If
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
E=Exist(DD$+"fonts/"+FT$)
If E<>-1
If COPEASY=1
AD$="Creating fonts/"+FT$+" on your disc!"
MYALERT[AD$]
CD$="ram:c/makedir "+DD$+"fonts/"+FT$+Chr$(0)
DDOS
Wait 50
End If
End If
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
AD$="Saving chosen font/s to your disc!"
MYALERT[AD$]
If COPEASY=1
If NU=1
CD$="ram:c/copy "+SD$+"fonts/"+FT$+"/"+FS$+" to "+DD$+"fonts/"+FT$+Chr$(0)
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
End If
If NU=2
CD$="ram:c/copy "+SD$+"fonts/"+FT$+" to "+DD$+"fonts/"+FT$+" all"+Chr$(0)
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
End If
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
CD$="ram:c/copy "+SD$+"fonts/"+F$+" to "+DD$+"fonts"+Chr$(0)
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
End If
If COPEASY=0
CD$="ram:c/copy ram:fonts to "+DD$+"fonts all"+Chr$(0)
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
End If
Pen 8 : Paper 0
Locate 64,11 : Print Space$(6)
Locate 64,11 : Print Dfree
Dir$=SD$
BUILDMENU2
AD$=ADVICE$(7)
MYALERT[AD$]
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
While CMZ<>1
If Mouse Click=1 Then COPMOUS
Wend
End Proc
'
Procedure FTRREQ
Shared CMZ,S$,KK$,F$,FS$,CD$,R,CH,COPEASY,MENYU$(),ADVICE$(),NU,AD$,SELFT$,DR$(),DRN$(),LIM,DSKNAME$()
Reserve Zone 4
Set Zone 1,36,50 To 90,60 : Set Zone 2,536,46 To 566,56
Set Zone 3,536,58 To 566,68 : Set Zone 4,572,46 To 600,68
'Load "FontDisc:CopyReq.abk"
Paste Bob 1,8,1
Ink 11
Paint 538,48,1
Screen Show 1
Pen 8 : Paper 0
COPEASY=0
SD$=SELD$
F$="Topaz" : FS$="8"
If MENYU$(CH)>""
Q=Instr(Font$(CH)," ",2)
F$=Left$(Font$(CH),(Q-1))
FS$=Mid$(Font$(CH),30,3)
End If
K=Val(FS$)
FS$=Str$(K)
LK=Len(FS$)
FS$=Right$(FS$,(LK-1))
Locate 17,4 : Print SD$
Locate 19,6 : Print F$
Locate 59,6 : Print FS$
Locate 64,4 : Print Dfree
LF=Len(F$)
FT$=Left$(Font$(CH),(LF-5))
Locate ,9
Volume 30
AD$=ADVICE$(1)
AGC:
MYALERT[AD$]
CMZ=0 : NU=0
DCOPMOUS
If CMZ=2 Then NU=1
If CMZ=3 Then NU=2
If CMZ=1 Then Pop Proc
If NU=0 Then Goto AGC
CHM=Chip Free : FAM=Fast Free
RAVAIL=CHM+FAM
AD$="Checking memory requirements for transfer!"
MYALERT[AD$]
SIZES
XX=RAVAIL
Pen 8 : Paper 0
Locate 17,11 : Print "RAM Disk:"
Locate 64,11 : Print RAVAIL
XXX=XX-DNEED
If XXX<0
AD$="Insufficient space for transfer. "+Str$(DNEED)+" bytes needed. Click `OK'"
MYALERT[AD$]
AGIN=1
Else
AD$=Str$(DNEED)+" bytes required for transfer. Click `OK'"
MYALERT[AD$]
AGIN=0
End If
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
If AGIN=1
Locate 17,11 : Print Space$(20)
Locate 64,11 : Print Space$(6)
Pop Proc
End If
E=Exist("Ram:fonts")
If E<>-1
AD$=ADVICE$(4)
MYALERT[AD$]
CD$="ram:c/makedir ram:fonts"+Chr$(0)
DDOS
Wait 50
End If
E=Exist("Ram:fonts/"+FT$)
If E<>-1
AD$="Creating fonts/"+FT$+" in Ram:!"
MYALERT[AD$]
CD$="ram:c/makedir Ram:fonts/"+FT$+Chr$(0)
DDOS
Wait 50
End If
AD$="Saving chosen font/s to Ram:!"
MYALERT[AD$]
If NU=1
CD$="ram:c/copy "+SD$+"fonts/"+FT$+"/"+FS$+" to Ram:fonts/"+FT$+Chr$(0)
End If
If NU=2
CD$="ram:c/copy "+SD$+"fonts/"+FT$+" to ram:fonts/"+FT$+" all"+Chr$(0)
End If
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
CD$="ram:c/copy "+SD$+"fonts/"+F$+" to ram:fonts"+Chr$(0)
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
Pen 8 : Paper 0
Dir$=SD$
CHM=Chip Free : FAM=Fast Free
RAVAIL=CHM+FAM
Locate 64,11 : Print Space$(7)
Locate 64,11 : Print RAVAIL
BUILDMENU2
AD$=ADVICE$(7)
MYALERT[AD$]
COPEASY=1
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
While CMZ<>1
If Mouse Click=1 Then COPMOUS
Wend
End Proc
'
Procedure RTDREQ
Shared CMZ,S$,KK$,F$,FS$,CD$,RTDSK,R,CH,COPEASY,MENYU$(),ADVICE$(),NU,AD$,SELFT$,DR$(),DRN$(),LIM,DSKNAME$()
Reserve Zone 4
Set Zone 1,36,50 To 90,60 : Set Zone 2,536,46 To 566,56
Set Zone 3,536,58 To 566,68 : Set Zone 4,572,46 To 600,68
'Load "FontDisc:CopyReq.abk"
Paste Bob 1,8,1
Ink 11
Paint 538,48,1
Screen Show 1
Pen 8 : Paper 0
COPEASY=0
SD$="Ram:"
F$="Fonts"
FS$=""
K=Val(FS$)
FS$=Str$(K)
LK=Len(FS$)
FS$=Right$(FS$,(LK-1))
Locate 17,4 : Print SD$
Locate 19,6 : Print F$
Locate 59,6 : Print FS$
Locate 64,4 : Print Dfree
Locate ,9
Volume 30
WUNMORETIME:
CHCOPY
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
AGDR:
RTDSK=1
Wait 50
AD$="Checking memory requirements for transfer!"
MYALERT[AD$]
SIZES
RTDSK=0
MENINF
For X=1 To LIM
If Upper$(KK$)=Upper$(DR$(X))
Dir$=DRN$(X)
DD$=DRN$(X)
End If
Next X
Wait 20
If DD$=SD$
Wait 50
Goto AGDR
End If
Pen 8 : Paper 0
Locate 17,11 : Print DD$
Locate 64,11 : Print Dfree
XX=Dfree
XXX=XX-DNEED
If XXX<0
AD$="Insufficient space for transfer. "+Str$(DNEED)+" bytes needed. Click `OK'"
MYALERT[AD$]
AGIN=1
Else
AD$=Str$(DNEED)+" bytes required for transfer. Click `OK'"
MYALERT[AD$]
AGIN=0
End If
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
If AGIN=1
Locate 17,11 : Print Space$(20)
Locate 64,11 : Print Space$(6)
Goto WUNMORETIME
End If
AD$="Do you wish to proceed? Click `EXIT' or `OK'"
MYALERT[AD$]
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
E=Exist(DD$+"fonts")
If E<>-1
AD$="Creating `fonts' directory on your disc!"
MYALERT[AD$]
CD$="ram:c/makedir "+DD$+"fonts"+Chr$(0)
DDOS
Wait 50
End If
CD$="ram:c/copy ram:fonts to "+DD$+"fonts all quiet"+Chr$(0)
AD$=CD$
MYALERT[AD$]
DDOS
Wait 50
Pen 8 : Paper 0
Locate 64,11 : Print Space$(6)
Locate 64,11 : Print Dfree
Dir$=SD$
BUILDMENU2
E=Exist(SELD$)
If E<>-1
CDK:
AD$="Please replace "+SELD$+" in any drive and click OK"
MYALERT[AD$]
While Not Mouse Click=1
Wend
COPMOUS
E=Exist(SELD$)
If E<>-1
Goto CDK
End If
End If
CD$="ram:c/assign fonts: "+SELD$+"fonts"+Chr$(0)
DDOS
MAKEFONTMENU
BUILDMENU2
Dir$=SELD$
CURD$=SELD$
MAKEMEN3
AD$=ADVICE$(7)
MYALERT[AD$]
CMZ=0
DCOPMOUS
If CMZ=1
Pop Proc
End If
While CMZ<>1
If Mouse Click=1 Then COPMOUS
Wend
End Proc
'
Procedure SIZES
Shared SD$,F$,FS$,NU,R,CD$,RTDSK
Dim RS$(20)
'SD$=Source Disc
'F$=Font with font apppended
'FH$=Font
'FS$=Font size
'NU if it equals 1, means one size only
' if it equals 2 then copy all sizes.
'K=size of `.font' file
'K=combined sizes of all files
'If RTDSK=1 thentransfer is the entire fonts directory in ram:
If RTDSK=1 Then Goto DEWRAM
L=Len(F$)
FH$=Left$(F$,L-5)
CD$="ram:c/list >ram:KeyFile "+SD$+"fonts/"+F$+" nodates"+Chr$(0)
DDOS
EF=0 : L=O
Open In 1,"ram:KeyFile"
Set Input 10,-1
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,DSIZ$
L=Instr(DSIZ$,F$)
If L>0
J$=Right$(DSIZ$,15)
K$=Left$(J$,6)
K=Val(K$)
End If
Wend
Close 1
'
If NU=1
CD$="ram:c/list >ram:KeyFile "+SD$+"fonts/"+FH$+"/"+FS$+" nodates"+Chr$(0)
End If
If NU=2
CD$="ram:c/list >ram:KeyFile "+SD$+"fonts/"+FH$+" nodates"+Chr$(0)
End If
DDOS
EF=0 : L=O
Open In 1,"ram:KeyFile"
Set Input 10,-1
KK=0
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,DSIZ$
If NU=1
L=Instr(DSIZ$,FS$)
End If
If NU=2
L=Len(DSIZ$)
If L<27
L=0
DSIZ$=""
End If
End If
If L>0
J$=Right$(DSIZ$,15)
K$=Left$(J$,6)
KK=KK+Val(K$)
End If
Wend
Close 1
DNEED=K+KK
Pop Proc
'
DEWRAM:
K=0 : KK=0
RINSTR$=".font"
CD$="ram:c/list >ram:KeyFile ram:fonts nodates"+Chr$(0)
DDOS
EF=0 : L=O : ZZ=1
Open In 1,"ram:KeyFile"
Set Input 10,-1
KK=0
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,DSIZ$
L=Instr(DSIZ$,RINSTR$)
If L>0
J$=Right$(DSIZ$,15)
K$=Left$(J$,6)
KK=KK+Val(K$)
Z=Instr(DSIZ$,".")
If Z>1
RS$(ZZ)=Left$(DSIZ$,Z-1)
Inc ZZ
End If
End If
Wend
Close 1
'
For X=1 To ZZ-1
CD$="ram:c/list >ram:KeyFile ram:fonts/"+RS$(X)+" nodates "+Chr$(0)
DDOS
EF=0 : L=O : ZZ=1
Open In 1,"ram:KeyFile"
Set Input 10,-1
KK=0
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,DSIZ$
L=Len(DSIZ$)
If L<27
L=0
DSIZ$=""
End If
If L>0
J$=Right$(DSIZ$,15)
K$=Left$(J$,6)
K=K+Val(K$)
End If
Wend
Close 1
Next X
DNEED=K+KK
End Proc
'
Procedure ALE
End Proc
'
Procedure CHCOPY
Shared KK$,AD$,CMZ,SELFT$,COPEASY,DR$(),DRN$(),LIM
COPEASY=0
E=Exist("Df1:")
F=Exist("Df2:")
If E=-1
AD$="Put Destination disc in df1: and click `OK'"
KK$="Df1:"
If Upper$(SELFT$)=Upper$(KK$)
AD$=ADVICE$(3)
KK$="Df0:"
End If
COPEASY=1
Goto ALDUN
End If
If(F=-1)
AD$="Put Destination disc in df2: and click `OK'"
KK$="Df2:"
If Upper$(SELFT$)=Upper$(KK$)
AD$=ADVICE$(3)
KK$="Df0:"
End If
COPEASY=1
End If
ALDUN:
If(E<>-1) and(F<>-1)
AD$=ADVICE$(3)
KK$="Df0:"
End If
MYALERT[AD$]
End Proc
'
Procedure DCOPMOUS
Shared CMZ,CH,MENYU$(),NU,CD$,AD$,COPEASY
While CMZ<>4
If Mouse Click=1 Then COPMOUS
If CMZ=1
If COPEASY=0
CD$="ram:c/delete ram:fonts all"+Chr$(0)
AD$="Deleting `ram:fonts'!"
MYALERT[AD$]
DDOS
End If
Pop Proc
End If
If CMZ=2 Then NU=1
If CMZ=3 Then NU=2
Wend
End Proc
'
Procedure COPMOUS
Shared CMZ,CH,MENYU$(),NU
CMZ=Mouse Zone
If CMZ=1
Ink 3
Paint 38,52,1
Ink 11
Paint 38,52,1
Pop Proc
End If
If CMZ=2
Ink 11
Paint 538,60,1
Ink 3
Paint 538,48,1
NU=1
Pop Proc
End If
If CMZ=3
Ink 11
Paint 538,48,1
Ink 3
Paint 538,60,1
NU=2
Pop Proc
End If
If CMZ=4
Ink 3
Paint 574,48,1
Ink 11
Paint 574,48,1
Pop Proc
End If
End Proc
'
Procedure GZONES
Reserve Zone 16
Set Zone 1,26,205 To 71,215 : Set Zone 2,245,205 To 291,215
For X=1 To 14
Set Zone(X+2),(X*20),219 To((X*20)+18),245
Next X
End Proc
'
Procedure HELP
Shared FLAG
FLAG=1
End Proc
'
Procedure CHKMOUS
Shared SF,CM,IC,PC
MZ=Mouse Zone
If MZ>0 Then Goto DCOLOURS
If SF=1
Screen Hide 1
SF=0
Goto ENM
End If
If SF=0
Screen Show 1
SF=1
Goto ENM
End If
DCOLOURS:
Curs Off
If MZ=1
CM=1
Ink 14
Paint 247,207,1
Ink 16
Paint 28,207,1
FCOLS
End If
If MZ=2
CM=2
Ink 14
Paint 28,207,1
Ink 16
Paint 247,207,1
FCOLS
End If
If MZ>2
If CM=1
Ink 14
Paint((IC*20)+2),221,1
IC=MZ-2
Ink 16
Paint((IC*20)+2),221,1
End If
If CM=2
Ink 14
Paint((PC*20)+2),221,1
PC=MZ-2
Ink 16
Paint((PC*20)+2),221,1
End If
SPECCURCOLS
End If
ENM:
End Proc
'
Procedure FCOLS
Shared IC,PC,CM
If CM=1
Ink 14
Paint((PC*20)+2),221,1
Ink 16
Paint((IC*20)+2),221,1
End If
If CM=2
Ink 14
Paint((IC*20)+2),221,1
Ink 16
Paint((PC*20)+2),221,1
End If
End Proc
'
Procedure CHKASSIGN
Shared ABC,DSKNAME$(),MC2
CASS$=""
CD$="ram:c/assign >ram:AssFile"+Chr$(0)
DDOS
ST=1 : EF=0
Open In 1,"ram:AssFile"
Set Input 10,-1
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,CASS$ : Rem ABC$(ST)
Exit If Upper$(Left$(CASS$,5))="FONTS"
Inc ST
Wend
Close 1
ABC=0
L=Instr(Upper$(CASS$),Upper$(DSKNAME$(MC2)))
If L=0 Then Pop Proc
ABC=5
End Proc
'
Procedure MENINF
Shared DR$(),DRN$(),INF$(),USE$(),CD$,LIM,AB$(),R
For X=0 To 19
INF$(X)=""
USE$(X)=""
DR$(X)=""
DRN$(X)=""
Next X
CD$="ram:c/info >ram:InfoFile"+Chr$(0)
DDOS
'
ST=1 : EF=0 : Z=1
Open In 1,"ram:InfoFile"
Set Input 10,-1
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,INF$(ST)
Inc ST
Wend
Close 1
ST=ST-1 : Rem ********** Remove count added at end of file.
Rem ********** We dont need the set up in the first three strings.
Rem ********** The first string was a null string, and then there
Rem ********** is another null string before the volume names. We
Rem ********** only want the strings between these two, so
For X=4 To ST : Rem **** Ignore the first three strings.
Rem ******************** Go past the first null string and then
If INF$(X)="" : Rem **** find the next one.
LIM=X-1 : Rem ****** So we have `LIM' number of useful strings.
Goto DUN
End If
USE$(X-3)=INF$(X) : Rem Make the `USE'ful strings.
Next X
DUN:
LIM=LIM-3 : Rem ******** Remove the count for the first three strings
For X=1 To LIM
L=Len(USE$(X))
If L>52
DRN$(X)=Right$(USE$(X),L-52)+":"
Else
DRN$(X)=""
End If
DR$(X)=Left$(USE$(X),4)
Next X
End Proc
'
Procedure DSKIN
Shared CDRN$,AA$(),MC2
CD$="ram:c/info >ram:InfoFile"+Chr$(0)
DDOS
'
ST=1 : EF=0
Open In 1,"ram:InfoFile"
Set Input 10,-1
While EF=0
EF=Eof(1)
Exit If EF=-1
Input #1,CHD$
L=Instr(CHD$,AA$(MC2))
Exit If L>0
Inc ST
Wend
Close 1
If L>0 Then Goto ISTHERE
Pop Proc
ISTHERE:
L=Len(CHD$)
If L<53
CDRN$=""
Pop Proc
End If
CDRN$=Right$(CHD$,L-52)+":"
End Proc
'
Procedure BUILDMENU2
Shared AB$(),DD(),AA$(),LIM,DR$(),DRN$(),DSKNAME$()
Screen 0
For X=0 To 23
AB$(X)=""
Next X
MENINF
Pen 2 : Paper 0
Menu Off : Y=1
For X=1 To 23
Read AB$(X)
Next X
Menu$(2)="(IN 1,5:IN 2,8)Dir "
For X=1 To 23
For Z=1 To LIM
If Upper$(DR$(Z))=Upper$(AB$(X))
Menu$(2,Y)=DR$(Z)+" "+DRN$(Z)
AA$(Y)=DR$(Z)
DSKNAME$(Y)=DRN$(Z)
Inc Y
End If
Next Z
Next X
Menu On
'
Data "df0:","df1:","df2:","df3:","dh0:","dh1:","dh2:","dh3:","dh4:","dh5:","dh6:","dh7:","dh8:","dh9:"
Data "fh0:","fh1:","fh2:","fh3:","ram:","rad:","di0:","di1:","di2:"
End Proc
'
Procedure BUILDMENUS
Screen 0
Pen 2 : Paper 0
Menu$(1)="(IN 1,5:IN 2,8)H "
MAKEMEN3
Menu$(4)="(IN 1,5:IN 2,8)Fnts1 "
Menu$(5)="(IN 1,5:IN 2,8)Fnts2 "
Menu$(6)="(IN 1,5:IN 2,8)Control "
Menu$(7)="(IN 1,5:IN 2,8) "
Menu$(6,1)="(IN 1,3)Quit"
Menu$(6,2)="(IN 1,5)Copy font to Disc"
Menu$(6,3)="(IN 1,5)Copy font to Ram"
Menu$(6,4)="(IN 1,5)Copy Ram to Disc"
Menu$(1,1)=" 1. This programme gets the fonts "
Menu$(1,2)=" from the currently ASSIGNed fonts"
Menu$(1,3)=" directory. We use DOSCALL to call"
Menu$(1,4)=" the CLI's ASSIGN command for the"
Menu$(1,5)=" fonts dir on the disc you select "
Menu$(1,6)=" from Menu 2. For some reason it "
Menu$(1,7)=" will not work on all discs, even "
Menu$(1,8)=" if they have a fonts directory, so"
Menu$(1,9)=" there will be some fonts you "
Menu$(1,10)=" cannot see with this programme!"
Menu$(1,11)=" -----------------------------"
Menu$(1,12)=" 2. Click the left MOUSE button to"
Menu$(1,13)=" alternate between LO and HI "
Menu$(1,14)=" Resolution. "
Menu$(1,15)=" -----------------------------"
Menu$(1,16)=" 3. Select Paper and Pen colours "
Menu$(1,17)=" with the buttons."
Menu$(1,18)=" -----------------------------"
Menu$(1,19)=" 4. When you open the FONT menu, the"
Menu$(1,20)=" number on the left is the FONT"
Menu$(1,21)=" number, the number on the right is"
Menu$(1,22)=" the height of the FONT in pixels."
Menu$(1,23)=" -----------------------------"
Menu$(1,24)=" 5. To view fonts, they must be in the"
Menu$(1,25)=" `fonts' directory on a disc."
Menu$(1,26)=" -----------------------------"
Menu$(1,27)=" 6. This programme allows you to view"
Menu$(1,28)=" a directory with up to 58 fonts."
Menu$(1,29)="---------------------------------------"
Menu$(1,30)=" Written by Gary O'Connor using Amos!"
Menu On
End Proc
'
Procedure MAKEMEN3
Menu$(3)="(IN 1,5:IN 2,8)Sel "
Menu$(3,1)="(IN 1,5:IN 2,4:IN 3,9) -:Current Selections:- "
Menu$(3,2)="(IN 1,3:IN 2,4)----------------------------"
Menu$(3,3)="(IN 1,5:IN 2,8) Font = "+SELF$
Menu$(3,4)="(IN 1,5:IN 2,8) Source = "+SELD$
Menu$(3,5)="(IN 1,3:IN 2,4)----------------------------"
Menu$(3,6)="(IN 1,3:IN 2,7)Cur/Dir = "+CURD$
End Proc
'
Procedure MAKEFONTMENU
Shared FC,FS
Shared MENYU$()
Screen 0
Pen 2 : Paper 0
GF=1 : FT=0
If FS>0 Then Set Font 2
Get Fonts
FC=2
Menu Off
Set Font 2
Menu Del(4) : Menu Del(5)
Menu$(4)="(IN 1,5:IN 2,8)Fnts1 "
Menu$(5)="(IN 1,5:IN 2,8)Fnts2 "
For X=1 To 58
If X<30
Menu$(4,X)=""
End If
If X>29
Menu$(5,X-29)=""
End If
MENYU$(X)=""
Next X
Do
Exit If Font$(GF)=""
If Font$(GF)<>""
FT=FT+1
FT$=Str$(FT)
LFT=Len(FT$)
If LFT>2
FT$=Right$(FT$,(LFT-1))
End If
FT$=FT$+" "
MENYU$(GF)=FT$+Left$(Font$(GF),15)+Mid$(Font$(GF),30,3)
GF=GF+1
End If
Loop
For X=1 To 58
If X=3
If DFS=1 : Rem *** if a disc font has been selected
If DCH=2 : Rem *** and we've since changed directories
Goto DX : Rem *** then we dont want this entry!
End If
End If
End If
If X<30
Menu$(4,X)=MENYU$(X)
End If
If X>29
Menu$(5,X-29)=MENYU$(X)
End If
DX:
Next
Menu On
FS=1
End Proc
'
Procedure CLEERFONTMENU
Shared FC,FS
Shared MENYU$()
Screen 0
Pen 2 : Paper 0
If FS>0 Then Set Font 2
Menu Off
Set Font 2
Menu Del(4) : Menu Del(5)
Menu$(4)="(IN 1,5:IN 2,8)Fnts1 "
Menu$(5)="(IN 1,5:IN 3,8)Fnts2 "
For X=1 To 58
If X<30
Menu$(4,X)=""
End If
If X>29
Menu$(5,X-29)=""
End If
MENYU$(X)=""
Next X
Menu On
End Proc
'
Procedure GRABFONTS
Shared AA$(),CDRN$,FLAG,FC,CD$,R,SELFT$,DR$(),DRN$(),LIM,DSKNAME$(),MC2,ABC
BUILDMENU2
MC2=Choice(2)
If FC=2 Then Set Font 0
DSKIN
If CDRN$=""
ALERT["No disc present in "+AA$(MC2)]
Wait 100
FLAG=0
Pop Proc
End If
ALERT["Checking "+AA$(MC2)+" for `fonts' dir"]
D=Exist(AA$(MC2)+"Fonts/")
Wait 50
If D=0
ALERT[" Drive "+AA$(MC2)+" has no fonts dir"]
Wait 100
FLAG=0
Pop Proc
End If
ALERT["Attempting to ASSIGN `fonts' dir"]
Dir$=DSKNAME$(MC2)
SELFT$=AA$(MC2)
'
Rem ****** Use the CLI to `assign' the `fonts' directory ******
CD$="ram:c/assign fonts: "+AA$(MC2)+"fonts"+Chr$(0)
DDOS
'
If R=-1
CHKASSIGN
If ABC=0
ALERT["Fonts present but not available"]
Wait 100
REDALERT["Assign failed!!!"]
Wait 100
ALERT["Try another disc!"]
Wait 100
FLAG=0
If FS>0
CLEERFONTMENU
End If
Pop Proc
End If
ALERT[" Getting "+AA$(MC2)+"Fonts"]
If FS=1
FS=2
End If
CURD$=DSKNAME$(MC2)
If DCH=0
DCH=1
Else
DCH=2
End If
Menu Off
Menu Del(3)
MAKEMEN3
Menu On
Else
ALERT[" Drive df0: has no fonts dir"]
BUILDMENU2
Pop Proc
End If
MAKEFONTMENU
FLAG=0
End Proc
'
Procedure DDOS
Shared CD$,R
Rem **** Accessing CLI commands from AmosBasic *******
DFAIL=0
Dreg(0)=0
Dreg(1)=Varptr(CD$) : Rem ** Put the address of the command string in D1 **
Dreg(2)=0
Dreg(3)=0
R=Doscall(-222) : Rem *** -222 is the offset for the DOS execute function ***
Rem ****** If it worked `R' will equal -1 ******
If R<>-1
DFAILED
End If
End Proc
'
Procedure DFAILED
Shared AD$
AD$="DOS command failed! Aborting!!"
MYALERT[AD$]
Wait 100
DFAIL=1
End Proc
'
Procedure ALERT[A$]
Volume 30 : Bell 60
Screen 0
Pen 2 : Paper 0
Centre At(,19)+Space$(32)
Centre At(,19)+A$
FLAG=1
End Proc
'
Procedure REDALERT[A$]
Volume 30 : Bell 60
Screen 0
Pen 3 : Paper 0
Centre At(,19)+Space$(32)
Centre At(,19)+A$
FLAG=1
End Proc
'
Procedure MYALERT[A$]
Shared AD$,ADVICE$()
Volume 30 : Bell 60
Screen 1
Pen 8 : Paper 0
Centre At(,9)+ADVICE$(0)
Centre At(,9)+AD$
End Proc
'
Procedure STBG
Screen 0
Ink 0
Bar 0,26 To 320,130
Ink 1
Bar 0,26 To 319,130
Screen 1
Ink 1
Bar 10,10 To 629,105
Screen 0
End Proc
'
Procedure MAKEFONT
Shared FLAG,IC,CH,PC,DN,OP,MENYU$(),DFS,MC2,DSKNAME$()
If Choice(2)<1 Then Pop Proc
If(Choice(1)=3) Then Pop Proc
If Choice(1)=4 Then CH=Choice(2)
If Choice(1)=5 Then CH=Choice(2)+29
If FS=2 and CH>2 Then CH=CH+1
If CH<3 Then SELD$="ROM"
If CH>2 Then DFS=1
SELF$=Left$(Font$(CH),15)
SELF$=SELF$+Mid$(Font$(CH),30,3)
If CH>2 Then SELD$=DSKNAME$(MC2)
Menu Off
Menu Del(3)
MAKEMEN3
Menu On
If Choice(2)=0
ALERT[" No font selected!"]
Wait 70
Pop Proc
End If
DFNT:
FF$=Left$(Font$(CH),15)
FF$="Loading "+FF$+Mid$(Font$(CH),30,3)
ALERT[FF$]
FLAG=False : OP=1
Screen 0
Curs Off
Ink 1
Bar 0,26 To 319,130
Screen 1
Curs Off
Ink 1
Bar 10,10 To 629,105
Screen 0
Ink 15,1
Set Font(CH)
P$="Amos Basic"
Q$="Does it in LoRes!!"
W=Text Length(P$)
WW=(320-W)/2
V=Text Length(Q$)
VV=(320-V)/2
Text WW,70,P$
Text VV,121,Q$
Screen 1
Q$="Does it in HiRes!!"
Ink 15,1
Set Font(CH)
WW=(640-W)/2
VV=(640-V)/2
Text WW,44,P$
Text VV,95,Q$
Screen 0
Set Font 2
If CH<>3 Then FS=1
ALERT[" Choose Font or Drive with menu!"]
FLAG=1
End Proc
'
Procedure CHMEN6
Shared IC,CH,PC,DN,OP,FLAG,DFS,A$,FLAG
If Choice(2)=1
Screen Close 1
Screen Close 0
End
End If
If Choice(2)=2
If DFS=0
A$="No disc font selected!"
ALERT[A$]
Wait 75
FLAG=0
Pop Proc
End If
Screen Close 1
SCR1OP
FTD=1 : FTR=0 : RTD=0
COPREQ
Screen Close 1
SCR1OP
Screen 0
MAKEFONT
End If
If Choice(2)=3
If DFS=0
A$="No disc font selected!"
ALERT[A$]
Wait 75
FLAG=0
Pop Proc
End If
Screen Close 1
SCR1OP
FTR=1 : FTD=0 : RTD=0
FTRREQ
Screen Close 1
SCR1OP
Screen 0
MAKEFONT
End If
If Choice(2)=4
If DFS=0
A$="No disc font selected!"
ALERT[A$]
Wait 75
FLAG=0
Pop Proc
End If
Screen Close 1
SCR1OP
RTD=1 : FTD=0 : FTR=0
RTDREQ
Screen Close 1
SCR1OP
Screen 0
MAKEFONT
End If
DN=0
FLAG=1
End Proc
'
Procedure SPECCURCOLS
Shared IC,PC
NEWCOLOURS
Screen 0
BL$=Space$(29)
Pen 0 : Paper 0
Centre At(,23)+Border$(BL$,1)
Pen IC : Paper PC
CI$=" Current Pen : "+Str$(IC)
CP$=" Paper :"+Str$(PC)
CC$=CI$+CP$
Centre At(,23)+Border$(CC$,1)
Curs Off
End Proc
'
Procedure NEWCOLOURS
Shared IC,PC,CLD()
BG=CLD(PC)
FG=CLD(IC)
Screen 0
Curs Off
Colour 1,BG
Colour 15,FG
Screen 1
Colour 1,BG
Colour 15,FG
End Proc
'