Subversion Repositories Kolibri OS

Rev

Rev 539 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 539 Rev 551
1
; BGI Font Test
1
; BGI Font Test
2
;
2
;
3
; Written in pure assembler by Ivushkin Andrey aka Willow
3
; Written in pure assembler by Ivushkin Andrey aka Willow
4
;
4
;
5
; Created: December 20, 2004
5
; Created: December 20, 2004
6
;
6
;
7
; Last changed: February 2, 2005
7
; Last changed: February 2, 2005
8
;
8
;
9
 
9
 
10
BGIFONT_PATH equ '/sys/FONTS/'
10
BGIFONT_PATH equ '/sys/FONTS/'
11
_X equ 340
11
_X equ 340
12
_Y equ 240
12
_Y equ 240
13
 
13
 
14
BGI_WINDOW_CLIP equ 1
14
BGI_WINDOW_CLIP equ 1
15
BGI_PRC_INFO equ pinfo
15
BGI_PRC_INFO equ pinfo
16
 
16
 
17
macro ListFonts
17
macro ListFonts
18
{
18
{
19
   mov  eax,lf_head
19
   mov  eax,lf_head
20
   call PixelPrint
20
   call PixelPrint
21
   mov  ebx,20 shl 16+60
21
   mov  ebx,20 shl 16+60
22
   mov  ecx,(BGIfont_names_end-BGIfont_names)/4
22
   mov  ecx,(BGIfont_names_end-BGIfont_names)/4
23
   mov  esi,BGIfont_names
23
   mov  esi,BGIfont_names
24
 .l1:
24
 .l1:
25
   pusha
25
   pusha
26
   pusha
26
   pusha
27
   mcall 4,,0x10777fac,esi,4
27
   mcall 4,,0x10777fac,esi,4
28
   popa
28
   popa
29
   mov  edx,[esi]
29
   mov  edx,[esi]
30
   BGIfont_GetID
30
   BGIfont_GetID
31
   mov  dword[_BGIfont_Prepare.font],edx
31
   mov  dword[_BGIfont_Prepare.font],edx
32
   mov  ecx,eax
32
   mov  ecx,eax
33
   add  ebx,140 shl 16
33
   add  ebx,140 shl 16
34
   mov  edx,ebx
34
   mov  edx,ebx
35
   mcall 47,0x80100,,,0x10ffffff
35
   mcall 47,0x80100,,,0x10ffffff
36
   jecxz .nofont
36
   jecxz .nofont
37
   lea  ebx,[edx+80 shl 16+12]
37
   lea  ebx,[edx+80 shl 16+12]
38
   mov  edx,_BGIfont_Prepare.fontfullname
38
   mov  edx,_BGIfont_Prepare.fontfullname
39
   mov  esi,_BGIfont_Prepare.fontattr-1
39
   mov  esi,_BGIfont_Prepare.fontattr-1
40
   sub  esi,edx
40
   sub  esi,edx
41
   add  ecx,0x3b800b8
41
   add  ecx,0x3b800b8
42
   BGIfont_Outtext
42
   BGIfont_Outtext
43
   sub  ebx,155 shl 16+12
43
   sub  ebx,155 shl 16+12
44
   mcall 4,,0x1000f000,load_ok,load_fail-load_ok
44
   mcall 4,,0x1000f000,load_ok,load_fail-load_ok
45
   jmp  .pop
45
   jmp  .pop
46
 .nofont:
46
 .nofont:
47
   lea  ebx,[edx-80 shl 16]
47
   lea  ebx,[edx-80 shl 16]
48
   mcall 4,,0x10f00010,load_fail,font_msg-load_fail
48
   mcall 4,,0x10f00010,load_fail,font_msg-load_fail
49
 .pop:
49
 .pop:
50
   popa
50
   popa
51
   add  esi,4
51
   add  esi,4
52
   add  ebx,39
52
   add  ebx,39
53
   loop .l2
53
   loop .l2
54
   jmp  .ex
54
   jmp  .ex
55
 .l2:
55
 .l2:
56
   jmp  .l1
56
   jmp  .l1
57
.ex:
57
.ex:
58
}
58
}
59
use32
59
use32
60
  org	 0x0
60
  org	 0x0
61
 
61
 
62
  db	 'MENUET01'
62
  db	 'MENUET01'
63
  dd	 0x01
63
  dd	 0x01
64
  dd	 START
64
  dd	 START
65
  dd	 I_END
65
  dd	 I_END
66
  dd	 0x100000
66
  dd	 0x100000
67
  dd	 0x100000
67
  dd	 0x100000
68
  dd	 0x0
68
  dd	 0x0
69
not1strun  dd	 0x0
69
not1strun  dd	 0x0
70
 
70
 
71
include 'lang.inc'
71
include 'lang.inc'
72
include  '..\..\..\macros.inc'
72
include  '..\..\..\macros.inc'
73
;include   'debug.inc'
73
;include   'debug.inc'
74
include  'bgifont.inc'
74
include  'bgifont.inc'
75
 
75
 
76
START:
76
START:
77
    mov  [help],0
77
    mov  [help],0
78
    mov  ecx,(BGIfont_names_end-BGIfont_names)/4
78
    mov  ecx,(BGIfont_names_end-BGIfont_names)/4
79
    mov  esi,BGIfont_names
79
    mov  esi,BGIfont_names
80
    mov  edi,I_END
80
    mov  edi,I_END
81
    BGIfont_Init
81
    BGIfont_Init
82
reset:
82
reset:
83
    mov  esi,[BGIfont_Ptr]
83
    mov  esi,[BGIfont_Ptr]
84
    inc  esi
84
    inc  esi
85
    mov  edi,freeconst
85
    mov  edi,freeconst
86
    movsd
86
    movsd
87
    mov  esi,freeconst
87
    mov  esi,freeconst
88
    mov  edi,freetest
88
    mov  edi,freetest
89
    mov  ecx,36
89
    mov  ecx,36
90
    rep  movsb
90
    rep  movsb
91
red:
91
red:
92
    mov  eax,[freetest]
92
    mov  eax,[freetest]
93
    mov  dword[title+19],eax
93
    mov  dword[title+19],eax
94
    call draw_window
94
    call draw_window
95
    cmp  [not1strun],0
95
    cmp  [not1strun],0
96
    jnz  still
96
    jnz  still
97
    mcall 5,300
97
    mcall 5,300
98
    not  [not1strun]
98
    not  [not1strun]
99
    inc  [help]
99
    inc  [help]
100
    jmp  red
100
    jmp  red
101
still:
101
still:
102
 
102
 
103
    mov  eax,10
103
    mov  eax,10
104
    mcall
104
    mcall
105
 
105
 
106
    cmp  eax,1
106
    cmp  eax,1
107
    je	 red
107
    je	 red
108
    cmp  eax,2
108
    cmp  eax,2
109
    je	 key
109
    je	 key
110
    cmp  eax,3
110
    cmp  eax,3
111
    je	 button
111
    je	 button
112
 
112
 
113
    jmp  still
113
    jmp  still
114
 
114
 
115
button:
115
button:
116
    mov  eax,17
116
    mov  eax,17
117
    mcall
117
    mcall
118
    cmp  ah,1
118
    cmp  ah,1
119
    jnz  noclose
119
    jnz  noclose
120
close:
120
close:
121
    xor  eax,eax
121
    xor  eax,eax
122
    dec  eax
122
    dec  eax
123
    mcall
123
    mcall
124
  noclose:
124
  noclose:
125
    jmp  still
125
    jmp  still
126
 
126
 
127
key:
127
key:
128
    mov  eax,2
128
    mov  eax,2
129
    mcall
129
    mcall
130
    shr  eax,8
130
    shr  eax,8
131
    cmp  al,27 ; esc - close
131
    cmp  al,27 ; esc - close
132
    je   close
132
    je   close
133
    cmp  al,32 ; Space - help
133
    cmp  al,32 ; Space - help
134
    jne  .noh
134
    jne  .noh
135
    inc  [help]
135
    inc  [help]
136
    cmp  [help],3
136
    cmp  [help],3
137
    jne  red
137
    jne  red
138
    and  [help],0
138
    and  [help],0
139
    jmp  red
139
    jmp  red
140
  .noh:
140
  .noh:
141
    cmp  [help],2
141
    cmp  [help],2
142
    jne   still
142
    jne   still
143
    cmp  al,50
143
    cmp  al,50
144
    jb   .noff
144
    jb   .noff
145
    cmp  al,57
145
    cmp  al,57
146
    ja   .noff
146
    ja   .noff
147
    sub  al,46
147
    sub  al,46
148
  .gn:
148
  .gn:
149
    movzx ecx,al
149
    movzx ecx,al
150
    shl  ecx,28
150
    shl  ecx,28
151
    call BGIfont_GetName
151
    call BGIfont_GetName
152
    mov  [freetest],edx
152
    mov  [freetest],edx
153
    jmp  red
153
    jmp  red
154
  .noff:
154
  .noff:
155
    mov  ecx,4
155
    mov  ecx,4
156
    mov  edi,Fkeys
156
    mov  edi,Fkeys
157
  .fkey:
157
  .fkey:
158
    cmp  al,[edi]
158
    cmp  al,[edi]
159
    je   .fndkey
159
    je   .fndkey
160
    inc  edi
160
    inc  edi
161
    loop .fkey
161
    loop .fkey
162
    jmp  .notfnd
162
    jmp  .notfnd
163
  .fndkey:
163
  .fndkey:
164
    lea  eax,[edi-Fkeys+0xc]
164
    lea  eax,[edi-Fkeys+0xc]
165
    jmp  .gn
165
    jmp  .gn
166
  .notfnd:
166
  .notfnd:
167
    cmp  al,114 ; r - reset
167
    cmp  al,114 ; r - reset
168
    je   reset
168
    je   reset
169
    cmp  al,176
169
    cmp  al,176
170
    jne  .nol  ; left
170
    jne  .nol  ; left
171
    sub  dword[freetest+8],5
171
    sub  dword[freetest+8],5
172
    jmp  red
172
    jmp  red
173
  .nol:
173
  .nol:
174
    cmp  al,179
174
    cmp  al,179
175
    jne  .nor  ; right
175
    jne  .nor  ; right
176
    add  dword[freetest+8],5
176
    add  dword[freetest+8],5
177
    jmp  red
177
    jmp  red
178
  .nor:
178
  .nor:
179
    cmp  al,105 ; i -italic
179
    cmp  al,105 ; i -italic
180
    jne  .noi
180
    jne  .noi
181
    xor  dword[freetest+32],BGI_ITALIC
181
    xor  dword[freetest+32],BGI_ITALIC
182
    jmp  red
182
    jmp  red
183
  .noi:
183
  .noi:
184
    cmp  al,98 ; b -bold
184
    cmp  al,98 ; b -bold
185
    jne  .nob
185
    jne  .nob
186
    xor  dword[freetest+32],BGI_BOLD
186
    xor  dword[freetest+32],BGI_BOLD
187
    jmp  red
187
    jmp  red
188
  .nob:
188
  .nob:
189
    mov  ecx,2
189
    mov  ecx,2
190
    mov  esi,ali
190
    mov  esi,ali
191
  .ol2:
191
  .ol2:
192
    cmp  al,[esi]
192
    cmp  al,[esi]
193
    jne  .othl2
193
    jne  .othl2
194
    mov  ax,[freetest+32]
194
    mov  ax,[freetest+32]
195
    add  ax,[esi+3]
195
    add  ax,[esi+3]
196
    mov  bx,ax
196
    mov  bx,ax
197
    mov  dx,[esi+1]
197
    mov  dx,[esi+1]
198
    and  bx,dx
198
    and  bx,dx
199
    cmp  bx,dx
199
    cmp  bx,dx
200
    jne  .ok
200
    jne  .ok
201
    not  dx
201
    not  dx
202
    and  ax,dx
202
    and  ax,dx
203
  .ok:
203
  .ok:
204
    mov  [freetest+32],ax
204
    mov  [freetest+32],ax
205
    jmp  red
205
    jmp  red
206
  .othl2:
206
  .othl2:
207
    add  esi,5
207
    add  esi,5
208
    loop .ol2
208
    loop .ol2
209
  .other:
209
  .other:
210
    mov  esi,delt
210
    mov  esi,delt
211
    mov  ecx,4
211
    mov  ecx,4
212
  .ol:
212
  .ol:
213
    cmp  al,[esi]
213
    cmp  al,[esi]
214
    jne  .othl
214
    jne  .othl
215
    fld  dword[esi+1]
215
    fld  dword[esi+1]
216
    movzx eax,byte[esi+5]
216
    movzx eax,byte[esi+5]
217
    fadd dword[freetest+eax]
217
    fadd dword[freetest+eax]
218
    fstp dword[freetest+eax]
218
    fstp dword[freetest+eax]
219
    jmp  red
219
    jmp  red
220
  .othl:
220
  .othl:
221
    add  esi,6
221
    add  esi,6
222
    loop .ol
222
    loop .ol
223
    jmp  still
223
    jmp  still
224
 
224
 
225
draw_window:
225
draw_window:
226
 
226
 
227
    mov  eax,48
227
    mov  eax,48
228
    mov  ebx,3
228
    mov  ebx,3
229
    mov  ecx,sc
229
    mov  ecx,sc
230
    mov  edx,sizeof.system_colors
230
    mov  edx,sizeof.system_colors
231
    mcall
231
    mcall
232
 
232
 
233
    mov  eax,12
233
    mov  eax,12
234
    mov  ebx,1
234
    mov  ebx,1
235
    mcall
235
    mcall
236
 
236
 
237
    xor  eax,eax
237
    xor  eax,eax
238
    mov  ebx,10*65536+_X*2+30
238
    mov  ebx,10*65536+_X*2+30
239
    mov  ecx,100*65536+_Y*2
239
    mov  ecx,100*65536+_Y*2
240
    mov  edx,0x03261212
240
    mov  edx,0x04261212
241
    mov  esi,0x805080d0
241
    mov  esi,0x805080d0
242
    mov  edi,0x005080d0
242
    mov  edi,0x005080d0
243
    mcall
243
    mcall
244
 
244
 
245
    mov  eax,4
245
    mov  eax,4
246
    mov  ebx,8*65536+8
246
    mov  ebx,8*65536+8
247
    mov  ecx,[sc.grab_text]
247
    mov  ecx,[sc.grab_text]
248
    or   ecx,0x10000000
248
    or   ecx,0x10000000
249
    mov  edx,title
249
    mov  edx,title
250
    mov  esi,title_end-title
250
    mov  esi,title_end-title
251
    cmp  [help],2
251
    cmp  [help],2
252
    je   .int
252
    je   .int
253
    sub  esi,12
253
    sub  esi,12
254
  .int:
254
  .int:
255
    mcall
255
    mcall
256
 
256
 
257
    cmp  [help],0
257
    cmp  [help],0
258
    jnz  .help
258
    jnz  .help
259
    cmp  byte[I_END],0
259
    cmp  byte[I_END],0
260
    jnz  .fontsok
260
    jnz  .fontsok
261
    mov  eax,font_msg
261
    mov  eax,font_msg
262
    call PixelPrint
262
    call PixelPrint
263
  .fontsok:
263
  .fontsok:
264
    ListFonts
264
    ListFonts
265
    jmp  .eod
265
    jmp  .eod
266
  .help:
266
  .help:
267
    cmp  [help],1
267
    cmp  [help],1
268
    jne  .nohelp
268
    jne  .nohelp
269
    mov  eax,helptxt
269
    mov  eax,helptxt
270
    cmp  byte[I_END],0
270
    cmp  byte[I_END],0
271
    jnz  .fontsok2
271
    jnz  .fontsok2
272
    mov  word[eax+2],_X-80
272
    mov  word[eax+2],_X-80
273
    call PixelPrint
273
    call PixelPrint
274
    jmp  .eod
274
    jmp  .eod
275
  .fontsok2:
275
  .fontsok2:
276
    mov  word[eax+2],_X
276
    mov  word[eax+2],_X
277
    call Print
277
    call Print
278
    jmp  .eod
278
    jmp  .eod
279
  .nohelp:
279
  .nohelp:
280
    mov  edi,cross
280
    mov  edi,cross
281
    mov  eax,38
281
    mov  eax,38
282
    mov  edx,0x4b331a
282
    mov  edx,0x4b331a
283
    mov  ebx,[edi]
283
    mov  ebx,[edi]
284
    mov  ecx,[edi+4]
284
    mov  ecx,[edi+4]
285
    mcall
285
    mcall
286
    mov  ebx,[edi+8]
286
    mov  ebx,[edi+8]
287
    mov  ecx,[edi+12]
287
    mov  ecx,[edi+12]
288
    mcall
288
    mcall
289
    mov  ebx,freetest
289
    mov  ebx,freetest
290
    BGIfont_Freetext
290
    BGIfont_Freetext
291
  .eod:
291
  .eod:
292
    mov  eax,12
292
    mov  eax,12
293
    mov  ebx,2
293
    mov  ebx,2
294
    mcall
294
    mcall
295
    ret
295
    ret
296
 
296
 
297
Print:	; eax-pointer to _txt struc
297
Print:	; eax-pointer to _txt struc
298
   pusha
298
   pusha
299
   mov	ebx,[eax]
299
   mov	ebx,[eax]
300
   movzx ecx,byte[eax+12]
300
   movzx ecx,byte[eax+12]
301
   lea	edx,[eax+13]
301
   lea	edx,[eax+13]
302
   mov	edi,eax
302
   mov	edi,eax
303
 .nextstr:
303
 .nextstr:
304
   mov esi,[edx]
304
   mov esi,[edx]
305
   add	edx,4
305
   add	edx,4
306
   push ecx
306
   push ecx
307
   mov	ecx,[edi+8]
307
   mov	ecx,[edi+8]
308
   BGIfont_Outtext
308
   BGIfont_Outtext
309
   add	 ebx,[edi+4]
309
   add	 ebx,[edi+4]
310
   pop	 ecx
310
   pop	 ecx
311
   and  esi,0xfff
311
   and  esi,0xfff
312
   add	 edx,esi
312
   add	 edx,esi
313
   loop .nextstr
313
   loop .nextstr
314
   popa
314
   popa
315
   ret
315
   ret
316
 
316
 
317
PixelPrint: ; eax-pointer to _txt struc, but used differently
317
PixelPrint: ; eax-pointer to _txt struc, but used differently
318
   pusha
318
   pusha
319
   mov  ebp,eax
319
   mov  ebp,eax
320
   mov  ebx,[ebp]
320
   mov  ebx,[ebp]
321
   movzx ecx,byte[ebp+12]
321
   movzx ecx,byte[ebp+12]
322
   mov  eax,4
322
   mov  eax,4
323
   lea  edx,[ebp+17]
323
   lea  edx,[ebp+17]
324
 .l:
324
 .l:
325
   mov  esi,[edx-4]
325
   mov  esi,[edx-4]
326
   and  esi,0xfff
326
   and  esi,0xfff
327
   push ecx
327
   push ecx
328
   mov  ecx,[ebp+8]
328
   mov  ecx,[ebp+8]
329
   mcall
329
   mcall
330
   pop  ecx
330
   pop  ecx
331
   lea  edx,[esi+edx+4]
331
   lea  edx,[esi+edx+4]
332
   add  ebx,[ebp+4]
332
   add  ebx,[ebp+4]
333
   loop .l
333
   loop .l
334
   popa
334
   popa
335
   ret
335
   ret
336
 
336
 
337
macro _txt _xy,_vert,_color,_opt,[_str]
337
macro _txt _xy,_vert,_color,_opt,[_str]
338
{
338
{
339
common
339
common
340
   _counter=0
340
   _counter=0
341
forward
341
forward
342
   _counter=_counter+1
342
   _counter=_counter+1
343
common
343
common
344
   dd  _xy	      ; 0
344
   dd  _xy	      ; 0
345
   dd  _vert	    ; 4
345
   dd  _vert	    ; 4
346
   dd  _color	    ; 8
346
   dd  _color	    ; 8
347
   db  _counter   ;_str_count   ; 12
347
   db  _counter   ;_str_count   ; 12
348
forward
348
forward
349
   local .str_beg,.str_end
349
   local .str_beg,.str_end
350
   dd  (.str_end-.str_beg) or _opt  ; 13
350
   dd  (.str_end-.str_beg) or _opt  ; 13
351
 .str_beg:
351
 .str_beg:
352
   db  _str		    ;17
352
   db  _str		    ;17
353
 .str_end:
353
 .str_end:
354
}
354
}
355
 
355
 
356
title db 'BGIFONT.INC demo - FONT font'
356
title db 'BGIFONT.INC demo - FONT font'
357
title_end:
357
title_end:
358
_M equ 30
358
_M equ 30
359
cross dd _M shl 16+_X*2-_M,_Y shl 16+_Y,_X shl 16+_X,_M shl 16+_Y*2-_M
359
cross dd _M shl 16+_X*2-_M,_Y shl 16+_Y,_X shl 16+_X,_M shl 16+_Y*2-_M
360
helptxt:
360
helptxt:
361
if  lang eq ru
361
if  lang eq ru
362
_txt _X shl 16+60,40,0x434ba010,BGI_HACENTER,\
362
_txt _X shl 16+60,40,0x434ba010,BGI_HACENTER,\
363
     "ƒŽŸ—ˆ… Š‹€‚ˆ˜ˆ:",\
363
     "ƒŽŸ—ˆ… Š‹€‚ˆ˜ˆ:",\
364
     "à®¡¥« - èà¨äâë/íâ®â ⥪áâ/¤¥¬ª ;",\
364
     "à®¡¥« - èà¨äâë/íâ®â ⥪áâ/¤¥¬ª ;",\
365
     "<-> áâ५ª¨ - ¢à é¥­¨¥ áâப¨;",\
365
     "<-> áâ५ª¨ - ¢à é¥­¨¥ áâப¨;",\
366
     "V - ¢ëà ¢­¨¢ ­¨¥ ¯® ¢¥à⨪ «¨;",\
366
     "V - ¢ëà ¢­¨¢ ­¨¥ ¯® ¢¥à⨪ «¨;",\
367
     "H - ¢ëà ¢­¨¢ ­¨¥ ¯® £®à¨§®­â «¨;",\
367
     "H - ¢ëà ¢­¨¢ ­¨¥ ¯® £®à¨§®­â «¨;",\
368
     "[,] - ¬ áèâ ¡ ¯® ®á¨ X;",\
368
     "[,] - ¬ áèâ ¡ ¯® ®á¨ X;",\
369
     "A,Z - ¬ áèâ ¡ ¯® ®á¨ Y;",\
369
     "A,Z - ¬ áèâ ¡ ¯® ®á¨ Y;",\
370
     "B,I - ¯®«ã¦¨à­ë© èà¨äâ ¨ ªãàᨢ;",\
370
     "B,I - ¯®«ã¦¨à­ë© èà¨äâ ¨ ªãàᨢ;",\
371
     "R - á¡à®á ¯ à ¬¥â஢ èà¨äâ ;",\
371
     "R - á¡à®á ¯ à ¬¥â஢ èà¨äâ ;",\
372
     "F1..F12 - ¢ë¡®à èà¨äâ ;",\
372
     "F1..F12 - ¢ë¡®à èà¨äâ ;",\
373
     "Esc - § ªàëâì ¯à®£ã :-("
373
     "Esc - § ªàëâì ¯à®£ã :-("
374
alpha:
374
alpha:
375
   db "‚®â ¯à¨¬¥à ⥪áâ !"
375
   db "‚®â ¯à¨¬¥à ⥪áâ !"
376
lf_head:
376
lf_head:
377
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"ˆ¬ï èà¨äâ ","‘â âãá","ID",\
377
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"ˆ¬ï èà¨äâ ","‘â âãá","ID",\
378
     "ãâì ª ä ©«ã"
378
     "ãâì ª ä ©«ã"
379
load_ok:
379
load_ok:
380
   db "§ £à㦥­"
380
   db "§ £à㦥­"
381
load_fail:
381
load_fail:
382
   db "­¥ ­ ©¤¥­"
382
   db "­¥ ­ ©¤¥­"
383
font_msg:
383
font_msg:
384
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
384
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
385
   "Š ᮦ «¥­¨î, ­¥ ­ ©¤¥­® ­¨ ®¤­®£®",\
385
   "Š ᮦ «¥­¨î, ­¥ ­ ©¤¥­® ­¨ ®¤­®£®",\
386
   "¢¥ªâ®à­®£® èà¨äâ  *.CHR. ‚®§¬®¦­®,",\
386
   "¢¥ªâ®à­®£® èà¨äâ  *.CHR. ‚®§¬®¦­®,",\
387
   "¢ ¬ á«¥¤ã¥â ¨á¯à ¢¨âì ª®­áâ ­âã",\
387
   "¢ ¬ á«¥¤ã¥â ¨á¯à ¢¨âì ª®­áâ ­âã",\
388
   "BGIFONT_PATH ¢ ­ ç «¥ ä ©«  BGITEST.ASM",\
388
   "BGIFONT_PATH ¢ ­ ç «¥ ä ©«  BGITEST.ASM",\
389
   "¨ ¯¥à¥ª®¬¯¨«¨à®¢ âì ¥£® :-("
389
   "¨ ¯¥à¥ª®¬¯¨«¨à®¢ âì ¥£® :-("
390
else
390
else
391
_txt _X shl 16+60,40,0x434ba010, BGI_HACENTER,\
391
_txt _X shl 16+60,40,0x434ba010, BGI_HACENTER,\
392
     "HOT KEYS:",\
392
     "HOT KEYS:",\
393
     "Space - font list/this message/demo;",\
393
     "Space - font list/this message/demo;",\
394
     "<-> arrows - rotate text string;",\
394
     "<-> arrows - rotate text string;",\
395
     "V - toggle vertical alignment;",\
395
     "V - toggle vertical alignment;",\
396
     "H - toggle horizontal alignment;",\
396
     "H - toggle horizontal alignment;",\
397
     "[,] - scale on X axis;",\
397
     "[,] - scale on X axis;",\
398
     "A,Z - scale on Y axis;",\
398
     "A,Z - scale on Y axis;",\
399
     "B,I - toggle bold & italic mode;",\
399
     "B,I - toggle bold & italic mode;",\
400
     "R - reset font options;",\
400
     "R - reset font options;",\
401
     "F1..F12 - select font;",\
401
     "F1..F12 - select font;",\
402
     "Esc - close demo :-("
402
     "Esc - close demo :-("
403
alpha:
403
alpha:
404
   db 'This is a Sample text!'
404
   db 'This is a Sample text!'
405
;    db 'ABCDEFGHIGKLMNOPQRSTUVWXWZ'
405
;    db 'ABCDEFGHIGKLMNOPQRSTUVWXWZ'
406
lf_head:
406
lf_head:
407
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"Font name","Status","ID",\
407
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"Font name","Status","ID",\
408
     "Filename"
408
     "Filename"
409
load_ok:
409
load_ok:
410
   db "loaded"
410
   db "loaded"
411
load_fail:
411
load_fail:
412
   db "not found"
412
   db "not found"
413
font_msg:
413
font_msg:
414
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
414
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
415
   "Sorry, no vector font *.CHR found.",\
415
   "Sorry, no vector font *.CHR found.",\
416
   "Maybe you should correct BGIFONT_PATH",\
416
   "Maybe you should correct BGIFONT_PATH",\
417
   "constant at the beginning of file",\
417
   "constant at the beginning of file",\
418
   "BGITEST.ASM and recompile it :-("
418
   "BGITEST.ASM and recompile it :-("
419
end if
419
end if
420
 
420
 
421
macro Deltas _key,_scale,_ofs
421
macro Deltas _key,_scale,_ofs
422
{
422
{
423
   db _key
423
   db _key
424
   dd _scale
424
   dd _scale
425
   db _ofs
425
   db _ofs
426
}
426
}
427
 
427
 
428
delt:
428
delt:
429
Deltas  91, -0.15,12
429
Deltas  91, -0.15,12
430
Deltas  93, 0.15,12
430
Deltas  93, 0.15,12
431
Deltas  97, 0.15,16
431
Deltas  97, 0.15,16
432
Deltas  122,-0.15,16
432
Deltas  122,-0.15,16
433
Fkeys db 48,49,68,255
433
Fkeys db 48,49,68,255
434
 
434
 
435
macro Aligns _key,_mask,_add
435
macro Aligns _key,_mask,_add
436
{
436
{
437
   db _key
437
   db _key
438
   dw _mask,_add
438
   dw _mask,_add
439
}
439
}
440
ali:
440
ali:
441
Aligns 118,BGI_VAMASK,BGI_VATOP
441
Aligns 118,BGI_VAMASK,BGI_VATOP
442
Aligns 104,BGI_HAMASK,BGI_HARIGHT
442
Aligns 104,BGI_HAMASK,BGI_HARIGHT
443
freeconst BGIfree 'FONT',_X shl 16+_Y,0, 1.0, 1.0, alpha,\
443
freeconst BGIfree 'FONT',_X shl 16+_Y,0, 1.0, 1.0, alpha,\
444
    lf_head-alpha,0xb800e7,\
444
    lf_head-alpha,0xb800e7,\
445
    BGI_VACENTER or BGI_HACENTER
445
    BGI_VACENTER or BGI_HACENTER
446
freetest BGIfree ?,?,?,?,?,?,?,?,?
446
freetest BGIfree ?,?,?,?,?,?,?,?,?
447
help db ?
447
help db ?
448
pinfo:
448
pinfo:
449
    times 1024 db ?
449
    times 1024 db ?
450
sc     system_colors
450
sc     system_colors
451
I_END:
451
I_END: