home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 67
/
af067a.adf
/
ACCESS.DMS
/
ACCESS.adf
/
Font8x8_Editor.AMOS
/
Font8x8_Editor.amosSourceCode
Wrap
AMOS Source Code
|
1993-03-16
|
5KB
|
162 lines
'***************************
'* AMOS Professional *
'* *
'* Font Editor *
'* *
'* (c) Europress Software *
'* *
'* Ronnie Simpson *
'***************************
'
Palette $0,$BB,$66,$33,$FF0,$B40,$FF0,$F70,$F10,$80F,$F07,$99,$840,$270,$33F,$FFF
Flash Off : Curs Off : Cls 1 : Paper 1
Reserve As Work 9,2048
Reserve Zone 327
Dim DX(256),DY(256),GX(64),GY(64),V(7)
Global DX(),DY(),GX(),GY(),V(),L
'
'
INIT
Do
M=Mouse Zone
If Mouse Key and M<257 and M>0
DISPLAY_TO_GRID[M-1] : DISPLAY_NEW
End If
If Mouse Key and M>256 and M<321
CHANGEGRID[M-256]
End If
If Mouse Key and M=322 Then STORE
If Mouse Key and M=323 Then SFONT
If Mouse Key and M=324 Then LFONT
If Mouse Key and M=325 Then Edit
If Mouse Key and M=326 Then CLEAR_GRID : DISPLAY_NEW : NEW_GRID
If Mouse Key and M=327 Then SET_GRID : DISPLAY_NEW : NEW_GRID
Loop
'
'
Procedure INIT
Set Paint 1 : Ink 14 : Box 0,0 To 319,199
Y=3 : Ink 0,,11
For L=0 To 15 : X=4
For C=1 To 16 : N=L*16+C
Bar X,Y To X+11,Y+11 : DX(N)=X : DY(N)=Y : Set Zone N,X,Y To X+11,Y+11
Add X,12
Next
Add Y,12
Next
Change Mouse 2
Y=3 : Ink 3,,8
For L=0 To 7 : X=211
For C=1 To 8 : N=L*8+C
Bar X,Y To X+11,Y+11 : GX(N)=X : GY(N)=Y : Set Zone N+256,X,Y To X+11,Y+11
Add X,12
Next
Add Y,12
Next
Change Mouse 2
Pen 2 : Ink 2 : Locate 27,14 : Print "CLEAR SET" : Box 211,107 To 307,122 : Draw 264,107 To 264,122
Set Zone 326,211,107 To 263,122 : Set Zone 327,265,107 To 307,122
Pen 5 : Ink 5 : Locate 27,16 : Print "<< STORE" : Box 211,124 To 307,138 : Set Zone 322,211,124 To 307,138
Pen 14 : Ink 14 : Locate 28,18 : Print "SAVE FONT" : Box 211,140 To 307,154 : Set Zone 323,211,140 To 307,154
Pen 13 : Ink 13 : Locate 28,20 : Print "LOAD FONT" : Box 211,156 To 307,170 : Set Zone 324,211,156 To 307,170
Pen 12 : Ink 12 : Locate 31,22 : Print "QUIT" : Box 211,172 To 307,186 : Set Zone 325,211,172 To 307,186
Ink 3,,6 : Bar 286,125 To 297,136
L=1
End Proc
Procedure DISPLAY[X]
S=Start(9)+(X*8)
CP=(127)*40+(288/8)
For C=0 To 7
P=Peek(S+C)
Poke Phybase(0)+CP+C*40,P
Poke Phybase(1)+CP+C*40,P
Poke Phybase(2)+CP+C*40,P
Poke Phybase(3)+CP+C*40,P
Next
Screen Copy 0,288,127,296,135 To 0,DX(X+1)+2,DY(X+1)+2
End Proc
Procedure DISPLAY_TO_GRID[X]
Ink 11 : Box DX(L+1),DY(L+1) To DX(L+1)+11,DY(L+1)+11
Ink 6 : Box DX(X+1),DY(X+1) To DX(X+1)+11,DY(X+1)+11 : L=X
Q=1
S=Start(9)+(X*8)
For C=0 To 7
P=Peek(S+C) : V(C)=P
For A=7 To 0 Step -1
If Btst(A,P)
Ink 6,,8 : Bar GX(Q),GY(Q) To GX(Q)+12,GY(Q)+12
Else
Ink 3,,8 : Bar GX(Q),GY(Q) To GX(Q)+12,GY(Q)+12
End If
Inc Q
Next
Next
End Proc
Procedure DISPLAY_NEW
For C=0 To 7
CP=(127)*40+(288/8)
P=V(C)
Poke Phybase(0)+CP+C*40,P
Poke Phybase(1)+CP+C*40,P
Poke Phybase(2)+CP+C*40,P
Poke Phybase(3)+CP+C*40,P
Next
Shoot
End Proc
Procedure CHANGEGRID[X]
BIT=(X-1) mod 8 : LINE=(X-1)/8 : BIT=7-BIT
If Point(GX(X)+2,GY(X)+2)=6
Ink 3,,8 : Bar GX(X),GY(X) To GX(X)+12,GY(X)+12 : Bclr BIT,V(LINE)
Else
Ink 6,,8 : Bar GX(X),GY(X) To GX(X)+12,GY(X)+12 : Bset BIT,V(LINE)
End If
Repeat : Until Mouse Key=0
DISPLAY_NEW
End Proc
Procedure STORE
S=Start(9)+(L*8)
For C=0 To 7
Poke S+C,V(C)
Next
DISPLAY[L]
Bell 70
End Proc
Procedure LFONT
Ink 2,,5 : For N=1 To 256 : Bar DX(N)+2,DY(N)+2 To DX(N)+9,DY(N)+9 : Next
F$=Fsel$("*.font","","Load AMOS default font","or a previously edited font")
If F$>""
Bload F$,9
For N=0 To 255 : DISPLAY[N] : Next
DISPLAY_TO_GRID[L] : DISPLAY_NEW
End If
End Proc
Procedure SFONT
F$=Fsel$("*.font","","Save edited font","Have you got a copy of the default ?")
If F$>"" Then Bsave F$,Start(9) To Start(9)+2048
End Proc
Procedure CLEAR_GRID
For A=0 To 7
V(A)=0
Next
Bell 30
End Proc
Procedure SET_GRID
For A=0 To 7
V(A)=$FFF
Next
Bell 30
End Proc
Procedure NEW_GRID
Q=1
For C=0 To 7
For A=7 To 0 Step -1
P=V(C)
If Btst(A,P)
Ink 6,,8 : Bar GX(Q),GY(Q) To GX(Q)+12,GY(Q)+12
Else
Ink 3,,8 : Bar GX(Q),GY(Q) To GX(Q)+12,GY(Q)+12
End If
Inc Q
Next
Next
End Proc