Subversion Repositories Kolibri OS

Rev

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

Rev 205 Rev 316
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 '/RD/1/FONTS/'
10
BGIFONT_PATH equ '/RD/1/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	 0x0cfff0
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
    int  0x40
104
    int  0x40
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
    int  0x40
117
    int  0x40
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
    int  0x40
123
    int  0x40
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
    int  0x40
129
    int  0x40
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
 
-
 
227
    mov  eax,48
-
 
228
    mov  ebx,3
-
 
229
    mov  ecx,sc
-
 
230
    mov  edx,sizeof.system_colors
-
 
231
    int  0x40
-
 
232
 
226
    mov  eax,12
233
    mov  eax,12
227
    mov  ebx,1
234
    mov  ebx,1
228
    int  0x40
235
    int  0x40
229
 
236
 
230
    xor  eax,eax
237
    xor  eax,eax
231
    mov  ebx,10*65536+_X*2
238
    mov  ebx,10*65536+_X*2+30
232
    mov  ecx,100*65536+_Y*2
239
    mov  ecx,100*65536+_Y*2
233
    mov  edx,0x03261212
240
    mov  edx,0x03261212
234
    mov  esi,0x805080d0
241
    mov  esi,0x805080d0
235
    mov  edi,0x005080d0
242
    mov  edi,0x005080d0
236
    int  0x40
243
    int  0x40
237
 
244
 
238
    mov  eax,4
245
    mov  eax,4
239
    mov  ebx,8*65536+8
246
    mov  ebx,8*65536+8
-
 
247
    mov  ecx,[sc.grab_text]
240
    mov  ecx,0x10ddeeff
248
    or   ecx,0x10000000
241
    mov  edx,title
249
    mov  edx,title
242
    mov  esi,title_end-title
250
    mov  esi,title_end-title
243
    cmp  [help],2
251
    cmp  [help],2
244
    je   .int
252
    je   .int
245
    sub  esi,12
253
    sub  esi,12
246
  .int:
254
  .int:
247
    int  0x40
255
    int  0x40
248
 
256
 
249
    cmp  [help],0
257
    cmp  [help],0
250
    jnz  .help
258
    jnz  .help
251
    cmp  byte[I_END],0
259
    cmp  byte[I_END],0
252
    jnz  .fontsok
260
    jnz  .fontsok
253
    mov  eax,font_msg
261
    mov  eax,font_msg
254
    call PixelPrint
262
    call PixelPrint
255
  .fontsok:
263
  .fontsok:
256
    ListFonts
264
    ListFonts
257
    jmp  .eod
265
    jmp  .eod
258
  .help:
266
  .help:
259
    cmp  [help],1
267
    cmp  [help],1
260
    jne  .nohelp
268
    jne  .nohelp
261
    mov  eax,helptxt
269
    mov  eax,helptxt
262
    cmp  byte[I_END],0
270
    cmp  byte[I_END],0
263
    jnz  .fontsok2
271
    jnz  .fontsok2
264
    mov  word[eax+2],_X-80
272
    mov  word[eax+2],_X-80
265
    call PixelPrint
273
    call PixelPrint
266
    jmp  .eod
274
    jmp  .eod
267
  .fontsok2:
275
  .fontsok2:
268
    mov  word[eax+2],_X
276
    mov  word[eax+2],_X
269
    call Print
277
    call Print
270
    jmp  .eod
278
    jmp  .eod
271
  .nohelp:
279
  .nohelp:
272
    mov  edi,cross
280
    mov  edi,cross
273
    mov  eax,38
281
    mov  eax,38
274
    mov  edx,0x4b331a
282
    mov  edx,0x4b331a
275
    mov  ebx,[edi]
283
    mov  ebx,[edi]
276
    mov  ecx,[edi+4]
284
    mov  ecx,[edi+4]
277
    int  0x40
285
    int  0x40
278
    mov  ebx,[edi+8]
286
    mov  ebx,[edi+8]
279
    mov  ecx,[edi+12]
287
    mov  ecx,[edi+12]
280
    int  0x40
288
    int  0x40
281
    mov  ebx,freetest
289
    mov  ebx,freetest
282
    BGIfont_Freetext
290
    BGIfont_Freetext
283
  .eod:
291
  .eod:
284
    mov  eax,12
292
    mov  eax,12
285
    mov  ebx,2
293
    mov  ebx,2
286
    int  0x40
294
    int  0x40
287
    ret
295
    ret
288
 
296
 
289
Print:	; eax-pointer to _txt struc
297
Print:	; eax-pointer to _txt struc
290
   pusha
298
   pusha
291
   mov	ebx,[eax]
299
   mov	ebx,[eax]
292
   movzx ecx,byte[eax+12]
300
   movzx ecx,byte[eax+12]
293
   lea	edx,[eax+13]
301
   lea	edx,[eax+13]
294
   mov	edi,eax
302
   mov	edi,eax
295
 .nextstr:
303
 .nextstr:
296
   mov esi,[edx]
304
   mov esi,[edx]
297
   add	edx,4
305
   add	edx,4
298
   push ecx
306
   push ecx
299
   mov	ecx,[edi+8]
307
   mov	ecx,[edi+8]
300
   BGIfont_Outtext
308
   BGIfont_Outtext
301
   add	 ebx,[edi+4]
309
   add	 ebx,[edi+4]
302
   pop	 ecx
310
   pop	 ecx
303
   and  esi,0xfff
311
   and  esi,0xfff
304
   add	 edx,esi
312
   add	 edx,esi
305
   loop .nextstr
313
   loop .nextstr
306
   popa
314
   popa
307
   ret
315
   ret
308
 
316
 
309
PixelPrint: ; eax-pointer to _txt struc, but used differently
317
PixelPrint: ; eax-pointer to _txt struc, but used differently
310
   pusha
318
   pusha
311
   mov  ebp,eax
319
   mov  ebp,eax
312
   mov  ebx,[ebp]
320
   mov  ebx,[ebp]
313
   movzx ecx,byte[ebp+12]
321
   movzx ecx,byte[ebp+12]
314
   mov  eax,4
322
   mov  eax,4
315
   lea  edx,[ebp+17]
323
   lea  edx,[ebp+17]
316
 .l:
324
 .l:
317
   mov  esi,[edx-4]
325
   mov  esi,[edx-4]
318
   and  esi,0xfff
326
   and  esi,0xfff
319
   push ecx
327
   push ecx
320
   mov  ecx,[ebp+8]
328
   mov  ecx,[ebp+8]
321
   int  0x40
329
   int  0x40
322
   pop  ecx
330
   pop  ecx
323
   lea  edx,[esi+edx+4]
331
   lea  edx,[esi+edx+4]
324
   add  ebx,[ebp+4]
332
   add  ebx,[ebp+4]
325
   loop .l
333
   loop .l
326
   popa
334
   popa
327
   ret
335
   ret
328
 
336
 
329
macro _txt _xy,_vert,_color,_opt,[_str]
337
macro _txt _xy,_vert,_color,_opt,[_str]
330
{
338
{
331
common
339
common
332
   _counter=0
340
   _counter=0
333
forward
341
forward
334
   _counter=_counter+1
342
   _counter=_counter+1
335
common
343
common
336
   dd  _xy	      ; 0
344
   dd  _xy	      ; 0
337
   dd  _vert	    ; 4
345
   dd  _vert	    ; 4
338
   dd  _color	    ; 8
346
   dd  _color	    ; 8
339
   db  _counter   ;_str_count   ; 12
347
   db  _counter   ;_str_count   ; 12
340
forward
348
forward
341
   local .str_beg,.str_end
349
   local .str_beg,.str_end
342
   dd  (.str_end-.str_beg) or _opt  ; 13
350
   dd  (.str_end-.str_beg) or _opt  ; 13
343
 .str_beg:
351
 .str_beg:
344
   db  _str		    ;17
352
   db  _str		    ;17
345
 .str_end:
353
 .str_end:
346
}
354
}
347
 
355
 
348
title db 'BGIFONT.INC demo - FONT font'
356
title db 'BGIFONT.INC demo - FONT font'
349
title_end:
357
title_end:
350
_M equ 30
358
_M equ 30
351
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
352
helptxt:
360
helptxt:
353
if  lang eq ru
361
if  lang eq ru
354
_txt _X shl 16+60,40,0x434ba010,BGI_HACENTER,\
362
_txt _X shl 16+60,40,0x434ba010,BGI_HACENTER,\
355
     "ƒŽŸ—ˆ… Š‹€‚ˆ˜ˆ:",\
363
     "ƒŽŸ—ˆ… Š‹€‚ˆ˜ˆ:",\
356
     "à®¡¥« - èà¨äâë/íâ®â ⥪áâ/¤¥¬ª ;",\
364
     "à®¡¥« - èà¨äâë/íâ®â ⥪áâ/¤¥¬ª ;",\
357
     "<-> áâ५ª¨ - ¢à é¥­¨¥ áâப¨;",\
365
     "<-> áâ५ª¨ - ¢à é¥­¨¥ áâப¨;",\
358
     "V - ¢ëà ¢­¨¢ ­¨¥ ¯® ¢¥à⨪ «¨;",\
366
     "V - ¢ëà ¢­¨¢ ­¨¥ ¯® ¢¥à⨪ «¨;",\
359
     "H - ¢ëà ¢­¨¢ ­¨¥ ¯® £®à¨§®­â «¨;",\
367
     "H - ¢ëà ¢­¨¢ ­¨¥ ¯® £®à¨§®­â «¨;",\
360
     "[,] - ¬ áèâ ¡ ¯® ®á¨ X;",\
368
     "[,] - ¬ áèâ ¡ ¯® ®á¨ X;",\
361
     "A,Z - ¬ áèâ ¡ ¯® ®á¨ Y;",\
369
     "A,Z - ¬ áèâ ¡ ¯® ®á¨ Y;",\
362
     "B,I - ¯®«ã¦¨à­ë© èà¨äâ ¨ ªãàᨢ;",\
370
     "B,I - ¯®«ã¦¨à­ë© èà¨äâ ¨ ªãàᨢ;",\
363
     "R - á¡à®á ¯ à ¬¥â஢ èà¨äâ ;",\
371
     "R - á¡à®á ¯ à ¬¥â஢ èà¨äâ ;",\
364
     "F1..F12 - ¢ë¡®à èà¨äâ ;",\
372
     "F1..F12 - ¢ë¡®à èà¨äâ ;",\
365
     "Esc - § ªàëâì ¯à®£ã :-("
373
     "Esc - § ªàëâì ¯à®£ã :-("
366
alpha:
374
alpha:
367
   db "‚®â ¯à¨¬¥à ⥪áâ !"
375
   db "‚®â ¯à¨¬¥à ⥪áâ !"
368
lf_head:
376
lf_head:
369
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"ˆ¬ï èà¨äâ ","‘â âãá","ID",\
377
_txt 10 shl 16+30,85 shl 16,0x6e00f7,0,"ˆ¬ï èà¨äâ ","‘â âãá","ID",\
370
     "ãâì ª ä ©«ã"
378
     "ãâì ª ä ©«ã"
371
load_ok:
379
load_ok:
372
   db "§ £à㦥­"
380
   db "§ £à㦥­"
373
load_fail:
381
load_fail:
374
   db "­¥ ­ ©¤¥­"
382
   db "­¥ ­ ©¤¥­"
375
font_msg:
383
font_msg:
376
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
384
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
377
   "Š ᮦ «¥­¨î, ­¥ ­ ©¤¥­® ­¨ ®¤­®£®",\
385
   "Š ᮦ «¥­¨î, ­¥ ­ ©¤¥­® ­¨ ®¤­®£®",\
378
   "¢¥ªâ®à­®£® èà¨äâ  *.CHR. ‚®§¬®¦­®,",\
386
   "¢¥ªâ®à­®£® èà¨äâ  *.CHR. ‚®§¬®¦­®,",\
379
   "¢ ¬ á«¥¤ã¥â ¨á¯à ¢¨âì ª®­áâ ­âã",\
387
   "¢ ¬ á«¥¤ã¥â ¨á¯à ¢¨âì ª®­áâ ­âã",\
380
   "BGIFONT_PATH ¢ ­ ç «¥ ä ©«  BGITEST.ASM",\
388
   "BGIFONT_PATH ¢ ­ ç «¥ ä ©«  BGITEST.ASM",\
381
   "¨ ¯¥à¥ª®¬¯¨«¨à®¢ âì ¥£® :-("
389
   "¨ ¯¥à¥ª®¬¯¨«¨à®¢ âì ¥£® :-("
382
else
390
else
383
_txt _X shl 16+60,40,0x434ba010, BGI_HACENTER,\
391
_txt _X shl 16+60,40,0x434ba010, BGI_HACENTER,\
384
     "HOT KEYS:",\
392
     "HOT KEYS:",\
385
     "Space - font list/this message/demo;",\
393
     "Space - font list/this message/demo;",\
386
     "<-> arrows - rotate text string;",\
394
     "<-> arrows - rotate text string;",\
387
     "V - toggle vertical alignment;",\
395
     "V - toggle vertical alignment;",\
388
     "H - toggle horizontal alignment;",\
396
     "H - toggle horizontal alignment;",\
389
     "[,] - scale on X axis;",\
397
     "[,] - scale on X axis;",\
390
     "A,Z - scale on Y axis;",\
398
     "A,Z - scale on Y axis;",\
391
     "B,I - toggle bold & italic mode;",\
399
     "B,I - toggle bold & italic mode;",\
392
     "R - reset font options;",\
400
     "R - reset font options;",\
393
     "F1..F12 - select font;",\
401
     "F1..F12 - select font;",\
394
     "Esc - close demo :-("
402
     "Esc - close demo :-("
395
alpha:
403
alpha:
396
   db 'This is a Sample text!'
404
   db 'This is a Sample text!'
397
;    db 'ABCDEFGHIGKLMNOPQRSTUVWXWZ'
405
;    db 'ABCDEFGHIGKLMNOPQRSTUVWXWZ'
398
lf_head:
406
lf_head:
399
_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",\
400
     "Filename"
408
     "Filename"
401
load_ok:
409
load_ok:
402
   db "loaded"
410
   db "loaded"
403
load_fail:
411
load_fail:
404
   db "not found"
412
   db "not found"
405
font_msg:
413
font_msg:
406
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
414
   _txt (_X+20) shl 16+180,25,0x10ff0000,0,\
407
   "Sorry, no vector font *.CHR found.",\
415
   "Sorry, no vector font *.CHR found.",\
408
   "Maybe you should correct BGIFONT_PATH",\
416
   "Maybe you should correct BGIFONT_PATH",\
409
   "constant at the beginning of file",\
417
   "constant at the beginning of file",\
410
   "BGITEST.ASM and recompile it :-("
418
   "BGITEST.ASM and recompile it :-("
411
end if
419
end if
412
 
420
 
413
macro Deltas _key,_scale,_ofs
421
macro Deltas _key,_scale,_ofs
414
{
422
{
415
   db _key
423
   db _key
416
   dd _scale
424
   dd _scale
417
   db _ofs
425
   db _ofs
418
}
426
}
419
 
427
 
420
delt:
428
delt:
421
Deltas  91, -0.15,12
429
Deltas  91, -0.15,12
422
Deltas  93, 0.15,12
430
Deltas  93, 0.15,12
423
Deltas  97, 0.15,16
431
Deltas  97, 0.15,16
424
Deltas  122,-0.15,16
432
Deltas  122,-0.15,16
425
Fkeys db 48,49,68,255
433
Fkeys db 48,49,68,255
426
 
434
 
427
macro Aligns _key,_mask,_add
435
macro Aligns _key,_mask,_add
428
{
436
{
429
   db _key
437
   db _key
430
   dw _mask,_add
438
   dw _mask,_add
431
}
439
}
432
ali:
440
ali:
433
Aligns 118,BGI_VAMASK,BGI_VATOP
441
Aligns 118,BGI_VAMASK,BGI_VATOP
434
Aligns 104,BGI_HAMASK,BGI_HARIGHT
442
Aligns 104,BGI_HAMASK,BGI_HARIGHT
435
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,\
436
    lf_head-alpha,0xb800e7,\
444
    lf_head-alpha,0xb800e7,\
437
    BGI_VACENTER or BGI_HACENTER
445
    BGI_VACENTER or BGI_HACENTER
438
freetest BGIfree ?,?,?,?,?,?,?,?,?
446
freetest BGIfree ?,?,?,?,?,?,?,?,?
439
help db ?
447
help db ?
440
pinfo:
448
pinfo:
441
    times 1024 db ?
449
    times 1024 db ?
442
rb 10000     ; reserve, unless process info will corrupt our fonts (why?)
450
sc     system_colors
443
I_END:
451
I_END: