Rev 5681 | Rev 5847 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
5363 | yogev_ezra | 3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
2288 | clevermous | 4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
7 | |||
8 | $Revision: 5839 $ |
||
9 | |||
5665 | Pathoswith | 10 | dtext_asciiz_esi: |
11 | btr ecx, 31 |
||
2536 | mario79 | 12 | dtext: |
5665 | Pathoswith | 13 | ; edx -> string |
14 | ; esi = number of characters |
||
15 | ; ebx = output coordinates XXXXYYYY h |
||
16 | ; ecx = char color and flags flRRGGBB h |
||
17 | ; fl = ZBFFRSSS b |
||
18 | ; Z=1: edx -> zero terminated string, esi = ? |
||
19 | ; B=1: fill background with color eax |
||
20 | ; R=1: edi -> user area for redirect |
||
21 | ; FF=3: UTF-8 8x16, FF=2: UTF-16LE 8x16, FF=0: 866 6x9 |
||
22 | ; SSS = (font multiplier)-1 |
||
23 | ; edi=1: force output |
||
24 | and eax, 0xFFFFFF |
||
25 | bt ecx, 30 |
||
26 | jc @f |
||
2288 | clevermous | 27 | xor eax, eax |
5665 | Pathoswith | 28 | dec eax |
29 | @@: |
||
30 | pushd 0 0 0 eax |
||
31 | movsx eax, bx |
||
32 | sar ebx, 16 |
||
33 | push eax ebx edi |
||
34 | bt ecx, 27 |
||
35 | jc .redirect |
||
36 | mov ebp, [_display.width] |
||
37 | xor edi, edi |
||
2288 | clevermous | 38 | jmp @f |
5839 | pathoswith | 39 | .ret: |
40 | add esp, 28 |
||
41 | ret |
||
5665 | Pathoswith | 42 | .redirect: |
43 | mov ebp, [edi] |
||
44 | add edi, 8 |
||
2288 | clevermous | 45 | @@: |
5665 | Pathoswith | 46 | shl ebp, 2 |
47 | imul eax, ebp |
||
48 | shl ebx, 2 |
||
49 | add eax, ebx |
||
50 | js .ret |
||
51 | add edi, eax ; linear address (32bit) |
||
52 | mov eax, ecx |
||
53 | mov ebx, ecx |
||
54 | test ecx, ecx |
||
55 | jns @f |
||
56 | mov esi, 256 |
||
57 | @@: |
||
58 | shr ecx, 24 |
||
59 | and cl, 7 |
||
60 | inc ecx |
||
61 | push ebp ecx esi |
||
62 | mov esi, edx ; -> string |
||
63 | or eax, 0xFF000000 |
||
64 | bt ebx, 27 |
||
65 | jc .bufferReady |
||
66 | mov eax, 9 |
||
67 | bt ebx, 29 |
||
68 | jnc @f |
||
69 | add eax, 7 |
||
70 | @@: |
||
71 | imul eax, ecx |
||
72 | mov [esp+32], eax |
||
73 | imul ebp, eax |
||
74 | stdcall kernel_alloc, ebp |
||
75 | mov ecx, ebp |
||
76 | shr ecx, 2 |
||
77 | mov [esp+36], eax |
||
78 | sub edi, eax |
||
79 | mov edx, eax |
||
80 | mov eax, [esp+24] |
||
81 | cmp eax, -1 |
||
82 | jnz .background |
||
83 | mov [esp+28], edi |
||
84 | .background: |
||
85 | mov edi, edx |
||
86 | rep stosd |
||
87 | mov edi, edx |
||
88 | mov eax, ebx |
||
89 | and eax, 0xFFFFFF |
||
90 | .bufferReady: |
||
91 | mov ebp, eax |
||
92 | xor edx, edx |
||
93 | bt ebx, 29 |
||
94 | jnc .draw866 |
||
95 | bt ebx, 28 |
||
96 | jc .drawUTF8 |
||
2536 | mario79 | 97 | |
5839 | pathoswith | 98 | ; Stack map: |
5665 | Pathoswith | 99 | ; char counter +0 |
100 | fontMultiplier = 4 |
||
101 | widthX = 8 |
||
102 | ; edi +12 |
||
103 | ; X +16 |
||
104 | ; Y +20 |
||
105 | ; background +24 |
||
106 | deltaToScreen = 28 |
||
107 | ; temp buffer height +32 |
||
5839 | pathoswith | 108 | ; temp buffer pointer +36 |
2536 | mario79 | 109 | |
5665 | Pathoswith | 110 | .drawUTF16: |
111 | dec dword [esp] |
||
112 | js .done |
||
113 | xor ebx, ebx |
||
114 | mov bx, [esi] |
||
115 | test ebx, ebx |
||
116 | jz .done |
||
117 | inc esi |
||
118 | inc esi |
||
119 | cmp bx, 1419 |
||
120 | jc @f |
||
121 | xor ebx, ebx |
||
2536 | mario79 | 122 | @@: |
5665 | Pathoswith | 123 | pushd esi edi 16 |
124 | shl ebx, 4 |
||
125 | add ebx, fontUni |
||
126 | mov esi, [esp+12+fontMultiplier] |
||
127 | call drawChar |
||
128 | imul esi, 8*4 |
||
129 | pop edi |
||
130 | pop edi |
||
131 | add edi, esi |
||
132 | pop esi |
||
133 | jmp .drawUTF16 |
||
5839 | pathoswith | 134 | |
5665 | Pathoswith | 135 | .drawUTF8: |
136 | dec dword [esp] |
||
137 | js .done |
||
5681 | leency | 138 | @@: |
5665 | Pathoswith | 139 | xor ebx, ebx |
140 | mov bl, [esi] |
||
141 | inc esi |
||
142 | test bl, bl |
||
143 | jz .done |
||
144 | jns .valid |
||
145 | shl bx, 10 |
||
5681 | leency | 146 | jnc @b |
5665 | Pathoswith | 147 | shr bh, 2 |
148 | mov bl, [esi] |
||
149 | shl bl, 2 |
||
150 | shr bx, 2 |
||
151 | inc esi |
||
152 | cmp bx, 1419 |
||
153 | jc .valid |
||
154 | shl bx, 4 |
||
155 | @@: |
||
156 | jns @f |
||
157 | inc esi |
||
158 | shl bx, 1 |
||
159 | jmp @b |
||
160 | @@: |
||
161 | xor ebx, ebx |
||
162 | .valid: |
||
163 | pushd esi edi 16 |
||
164 | shl ebx, 4 |
||
165 | add ebx, fontUni |
||
166 | mov esi, [esp+12+fontMultiplier] |
||
167 | call drawChar |
||
168 | imul esi, 8*4 |
||
169 | pop edi |
||
170 | pop edi |
||
171 | add edi, esi |
||
172 | pop esi |
||
173 | jmp .drawUTF8 |
||
5839 | pathoswith | 174 | |
5665 | Pathoswith | 175 | .draw866: |
176 | dec dword [esp] |
||
177 | js .done |
||
178 | xor ebx, ebx |
||
179 | mov bl, [esi] |
||
180 | test ebx, ebx |
||
181 | jz .done |
||
182 | inc esi |
||
183 | pushd esi edi 9 |
||
184 | lea ebx, [ebx*8+ebx+font1] |
||
185 | mov esi, [esp+12+fontMultiplier] |
||
186 | call drawChar |
||
187 | imul esi, 6*4 |
||
188 | pop edi |
||
189 | pop edi |
||
190 | add edi, esi |
||
191 | pop esi |
||
192 | jmp .draw866 |
||
5839 | pathoswith | 193 | |
5665 | Pathoswith | 194 | .done: |
195 | mov ecx, edi |
||
196 | pop eax eax eax esi edx ebx ebp ebp ebp |
||
197 | mov edi, [esp] |
||
198 | test edi, edi |
||
199 | jnz @f |
||
200 | pop eax |
||
201 | ret |
||
5839 | pathoswith | 202 | @@: ; redraw from buffer to screen |
5665 | Pathoswith | 203 | push eax |
204 | sub ecx, edi |
||
205 | shr ecx, 2 |
||
206 | add edx, ecx |
||
207 | inc ecx |
||
208 | push ecx |
||
209 | push edi |
||
210 | .drawPicture: |
||
211 | mov eax, -1 |
||
212 | repz scasd |
||
213 | jcxz @f |
||
214 | mov eax, edx |
||
215 | sub eax, ecx |
||
216 | push ecx |
||
217 | mov ecx, [edi-4] |
||
218 | xchg esi, edi |
||
2453 | mario79 | 219 | call __sys_putpixel |
5665 | Pathoswith | 220 | xchg esi, edi |
2536 | mario79 | 221 | pop ecx |
5665 | Pathoswith | 222 | jmp .drawPicture |
2536 | mario79 | 223 | @@: |
5665 | Pathoswith | 224 | pop edi |
225 | mov ecx, [esp] |
||
226 | add edi, [esp+4] |
||
2288 | clevermous | 227 | inc ebx |
5665 | Pathoswith | 228 | push edi |
229 | dec ebp |
||
230 | jnz .drawPicture |
||
231 | add esp, 12 |
||
232 | call kernel_free |
||
233 | ret |
||
234 | |||
5839 | pathoswith | 235 | ; scaling/smoothing algorithm |
5665 | Pathoswith | 236 | drawChar: |
237 | mov dl, [ebx] |
||
238 | .raw: |
||
239 | bsf eax, edx |
||
240 | jz .nextRaw |
||
241 | imul eax, esi |
||
242 | shl eax, 2 |
||
243 | push edi |
||
244 | add edi, eax |
||
245 | mov ecx, esi |
||
2288 | clevermous | 246 | dec esi |
5665 | Pathoswith | 247 | jnz .square |
248 | mov [edi], ebp |
||
249 | inc esi |
||
250 | cmp [fontSmoothing], 0 |
||
251 | jz .nextPixel |
||
5839 | pathoswith | 252 | .checkLeftSubP: ; subpixel smoothing |
5665 | Pathoswith | 253 | bsf eax, edx |
254 | dec eax |
||
255 | js .checkRightSubP |
||
256 | bt [ebx], eax |
||
257 | jc .checkRightSubP |
||
258 | dec eax |
||
259 | js .checkLeftDownSubP |
||
260 | bt [ebx], eax |
||
261 | jc .checkRightSubP |
||
262 | .checkLeftDownSubP: |
||
263 | inc eax |
||
264 | bt [ebx+1], eax |
||
265 | jnc .checkLeftUpSubP |
||
266 | inc eax |
||
267 | bt [ebx+1], eax |
||
268 | jnc @f |
||
269 | bt [ebx-1], eax |
||
270 | jc .checkRightSubP |
||
271 | dec eax |
||
272 | dec eax |
||
273 | js @f |
||
274 | bt [ebx+1], eax |
||
275 | jnc @f |
||
276 | inc eax |
||
277 | .checkLeftUpSubP: |
||
278 | bt [ebx-1], eax |
||
279 | jnc .checkRightSubP |
||
280 | inc eax |
||
281 | bt [ebx-1], eax |
||
282 | jnc @f |
||
283 | bt [ebx+1], eax |
||
284 | jc .checkRightSubP |
||
285 | dec eax |
||
286 | dec eax |
||
287 | js @f |
||
288 | bt [ebx-1], eax |
||
289 | jc .checkRightSubP |
||
290 | @@: |
||
291 | mov ecx, [esp+20+deltaToScreen] |
||
292 | mov eax, [edi-4] |
||
293 | test ecx, ecx |
||
2536 | mario79 | 294 | jz @f |
5665 | Pathoswith | 295 | pusha |
296 | lea ebx, [edi+ecx-4] |
||
297 | shr ebx, 2 |
||
298 | call syscall_getpixel |
||
299 | popa |
||
2536 | mario79 | 300 | @@: |
5839 | pathoswith | 301 | push ebx edx |
302 | mov ebx, ebp |
||
303 | xor ecx, ecx |
||
304 | mov cl, bl |
||
305 | lea edx, [ecx*8+ecx] |
||
306 | lea edx, [ecx*2+edx] |
||
307 | mov cl, al |
||
308 | lea ecx, [ecx*4+ecx] |
||
309 | add edx, ecx |
||
310 | shr edx, 4 |
||
311 | mov al, dl |
||
312 | |||
313 | xor ecx, ecx |
||
314 | mov cl, ah |
||
315 | lea edx, [ecx*8+ecx] |
||
316 | lea edx, [ecx*2+edx] |
||
317 | mov cl, bh |
||
318 | lea ecx, [ecx*4+ecx] |
||
319 | add edx, ecx |
||
320 | shr edx, 4 |
||
321 | mov ah, dl |
||
322 | |||
323 | rol eax, 16 |
||
324 | rol ebx, 16 |
||
325 | xor ecx, ecx |
||
326 | mov cl, al |
||
327 | mov edx, ecx |
||
328 | shl ecx, 3 |
||
329 | sub ecx, edx |
||
330 | mov dl, bl |
||
331 | add ecx, edx |
||
332 | shr ecx, 3 |
||
333 | mov al, cl |
||
334 | rol eax, 16 |
||
5665 | Pathoswith | 335 | mov [edi-4], eax |
5839 | pathoswith | 336 | pop edx ebx |
5665 | Pathoswith | 337 | .checkRightSubP: |
338 | bsf eax, edx |
||
339 | inc eax |
||
340 | bt [ebx], eax |
||
341 | jc .nextPixel |
||
342 | inc eax |
||
343 | bt [ebx], eax |
||
344 | jc .nextPixel |
||
345 | dec eax |
||
346 | .checkRightDownSubP: |
||
347 | bt [ebx+1], eax |
||
348 | jnc .checkRightUpSubP |
||
349 | dec eax |
||
350 | bt [ebx+1], eax |
||
351 | jnc @f |
||
352 | bt [ebx-1], eax |
||
353 | jc .nextPixel |
||
354 | inc eax |
||
355 | inc eax |
||
356 | bt [ebx+1], eax |
||
357 | jnc @f |
||
358 | dec eax |
||
359 | .checkRightUpSubP: |
||
360 | bt [ebx-1], eax |
||
361 | jnc .nextPixel |
||
362 | dec eax |
||
363 | bt [ebx-1], eax |
||
364 | jnc @f |
||
365 | bt [ebx+1], eax |
||
366 | jc .nextPixel |
||
367 | inc eax |
||
368 | inc eax |
||
369 | bt [ebx-1], eax |
||
370 | jc .nextPixel |
||
371 | @@: |
||
372 | mov ecx, [esp+20+deltaToScreen] |
||
373 | mov eax, [edi+4] |
||
374 | test ecx, ecx |
||
2536 | mario79 | 375 | jz @f |
5665 | Pathoswith | 376 | pusha |
377 | lea ebx, [edi+ecx+4] |
||
378 | shr ebx, 2 |
||
379 | call syscall_getpixel |
||
380 | popa |
||
2536 | mario79 | 381 | @@: |
5839 | pathoswith | 382 | push ebx edx |
383 | mov ebx, ebp |
||
384 | xor ecx, ecx |
||
385 | mov cl, al |
||
386 | mov edx, ecx |
||
387 | shl ecx, 3 |
||
388 | sub ecx, edx |
||
389 | mov dl, bl |
||
390 | add ecx, edx |
||
391 | shr ecx, 3 |
||
5665 | Pathoswith | 392 | mov al, cl |
5839 | pathoswith | 393 | |
394 | xor ecx, ecx |
||
395 | mov cl, ah |
||
396 | lea edx, [ecx*8+ecx] |
||
397 | lea edx, [ecx*2+edx] |
||
398 | mov cl, bh |
||
399 | lea ecx, [ecx*4+ecx] |
||
400 | add edx, ecx |
||
401 | shr edx, 4 |
||
402 | mov ah, dl |
||
403 | |||
404 | rol ebx, 16 |
||
405 | rol eax, 16 |
||
406 | xor ecx, ecx |
||
407 | mov cl, bl |
||
408 | lea edx, [ecx*8+ecx] |
||
409 | lea edx, [ecx*2+edx] |
||
410 | mov cl, al |
||
411 | lea ecx, [ecx*4+ecx] |
||
412 | add edx, ecx |
||
413 | shr edx, 4 |
||
414 | mov al, dl |
||
415 | rol eax, 16 |
||
5665 | Pathoswith | 416 | mov [edi+4], eax |
5839 | pathoswith | 417 | pop edx ebx |
5665 | Pathoswith | 418 | jmp .nextPixel |
5839 | pathoswith | 419 | |
420 | .square: ; scaling |
||
5665 | Pathoswith | 421 | mov eax, esi |
422 | @@: |
||
423 | mov [edi+eax*4], ebp |
||
424 | dec eax |
||
425 | jns @b |
||
426 | add edi, [esp+20+widthX] |
||
427 | dec ecx |
||
428 | jnz .square |
||
429 | inc esi |
||
430 | mov edi, [esp] |
||
431 | .checkLeft: |
||
432 | bsf eax, edx |
||
433 | dec eax |
||
434 | js .checkRight |
||
435 | bt [ebx], eax |
||
436 | jc .checkRight |
||
437 | .checkLeftDown: |
||
438 | bt [ebx+1], eax |
||
439 | jnc .checkLeftUp |
||
440 | mov ecx, eax |
||
2288 | clevermous | 441 | inc eax |
5665 | Pathoswith | 442 | bt [ebx+1], eax |
443 | jc @f |
||
444 | bt [ebx-1], eax |
||
445 | jnc .downRightLow |
||
446 | bt [ebx-2], eax |
||
447 | jc .downRightLow |
||
448 | dec eax |
||
449 | bt [ebx-1], eax |
||
450 | jc .downRightLow |
||
451 | dec eax |
||
452 | js .downRightHigh |
||
453 | bt [ebx-2], eax |
||
454 | jc .downRightLow |
||
455 | jmp .downRightHigh |
||
5839 | pathoswith | 456 | |
5665 | Pathoswith | 457 | @@: |
458 | bt [ebx-1], eax |
||
459 | jc .checkLeftUp |
||
460 | dec eax |
||
461 | dec eax |
||
462 | js .downRightLow |
||
463 | bt [ebx+1], eax |
||
464 | jc .checkLeftUp |
||
465 | .downRightLow: |
||
466 | imul ecx, esi |
||
467 | shl ecx, 2 |
||
468 | add edi, ecx |
||
2288 | clevermous | 469 | dec esi |
5665 | Pathoswith | 470 | mov eax, [esp+20+widthX] |
471 | imul eax, esi |
||
472 | add edi, eax |
||
473 | add edi, 4 |
||
474 | mov ecx, esi |
||
475 | dec ecx |
||
476 | .drawDownRight: |
||
477 | mov eax, ecx |
||
478 | @@: |
||
479 | mov [edi+eax*4], ebp |
||
480 | dec eax |
||
481 | jns @b |
||
482 | sub edi, [esp+20+widthX] |
||
483 | add edi, 4 |
||
484 | dec ecx |
||
485 | jns .drawDownRight |
||
486 | inc esi |
||
487 | mov edi, [esp] |
||
488 | jmp .checkLeftUp |
||
5839 | pathoswith | 489 | |
5665 | Pathoswith | 490 | .downRightHigh: |
491 | imul ecx, esi |
||
492 | shl ecx, 2 |
||
493 | add edi, ecx |
||
494 | dec esi |
||
495 | mov eax, [esp+20+widthX] |
||
496 | imul eax, esi |
||
497 | add edi, eax |
||
498 | add edi, 4 |
||
499 | mov ecx, esi |
||
500 | dec ecx |
||
501 | .drawDownRightHigh: |
||
502 | mov eax, ecx |
||
503 | @@: |
||
504 | mov [edi+eax*4], ebp |
||
505 | dec eax |
||
506 | jns @b |
||
507 | sub edi, [esp+20+widthX] |
||
508 | mov eax, ecx |
||
509 | @@: |
||
510 | mov [edi+eax*4], ebp |
||
511 | dec eax |
||
512 | jns @b |
||
513 | sub edi, [esp+20+widthX] |
||
514 | add edi, 4 |
||
515 | dec ecx |
||
516 | jns .drawDownRightHigh |
||
517 | inc esi |
||
518 | mov edi, [esp] |
||
519 | .checkLeftUp: |
||
520 | bsf eax, edx |
||
521 | dec eax |
||
522 | bt [ebx-1], eax |
||
523 | jnc .checkRight |
||
524 | mov ecx, eax |
||
525 | inc eax |
||
526 | bt [ebx-1], eax |
||
527 | jc @f |
||
528 | bt [ebx+1], eax |
||
529 | jnc .upRightLow |
||
530 | bt [ebx+2], eax |
||
531 | jc .upRightLow |
||
532 | dec eax |
||
533 | bt [ebx+1], eax |
||
534 | jc .upRightLow |
||
535 | dec eax |
||
536 | js .upRightHigh |
||
537 | bt [ebx+2], eax |
||
538 | jc .upRightLow |
||
539 | jmp .upRightHigh |
||
5839 | pathoswith | 540 | |
5665 | Pathoswith | 541 | @@: |
542 | bt [ebx+1], eax |
||
543 | jc .checkRight |
||
544 | dec eax |
||
545 | dec eax |
||
546 | js .upRightLow |
||
547 | bt [ebx-1], eax |
||
548 | jc .checkRight |
||
549 | .upRightLow: |
||
550 | imul ecx, esi |
||
551 | shl ecx, 2 |
||
552 | add edi, ecx |
||
553 | add edi, 4 |
||
554 | mov ecx, esi |
||
555 | dec ecx |
||
556 | dec ecx |
||
557 | .drawUpRight: |
||
558 | mov eax, ecx |
||
559 | @@: |
||
560 | mov [edi+eax*4], ebp |
||
561 | dec eax |
||
562 | jns @b |
||
563 | add edi, [esp+20+widthX] |
||
564 | add edi, 4 |
||
565 | dec ecx |
||
566 | jns .drawUpRight |
||
567 | mov edi, [esp] |
||
568 | jmp .checkRight |
||
5839 | pathoswith | 569 | |
5665 | Pathoswith | 570 | .upRightHigh: |
571 | imul ecx, esi |
||
572 | shl ecx, 2 |
||
573 | add edi, ecx |
||
574 | add edi, 4 |
||
575 | mov ecx, esi |
||
576 | dec ecx |
||
577 | dec ecx |
||
578 | .drawUpRightHigh: |
||
579 | mov eax, ecx |
||
580 | @@: |
||
581 | mov [edi+eax*4], ebp |
||
582 | dec eax |
||
583 | jns @b |
||
584 | add edi, [esp+20+widthX] |
||
585 | mov eax, ecx |
||
586 | @@: |
||
587 | mov [edi+eax*4], ebp |
||
588 | dec eax |
||
589 | jns @b |
||
590 | add edi, [esp+20+widthX] |
||
591 | add edi, 4 |
||
592 | dec ecx |
||
593 | jns .drawUpRightHigh |
||
594 | mov edi, [esp] |
||
595 | .checkRight: |
||
596 | bsf eax, edx |
||
597 | inc eax |
||
598 | bt [ebx], eax |
||
599 | jc .nextPixel |
||
600 | .checkRightDown: |
||
601 | bt [ebx+1], eax |
||
602 | jnc .checkRightUp |
||
603 | mov ecx, eax |
||
604 | dec eax |
||
605 | bt [ebx+1], eax |
||
606 | jc @f |
||
607 | bt [ebx-1], eax |
||
608 | jnc .downLeftLow |
||
609 | bt [ebx-2], eax |
||
610 | jc .downLeftLow |
||
611 | inc eax |
||
612 | bt [ebx-1], eax |
||
613 | jc .downLeftLow |
||
614 | inc eax |
||
615 | bt [ebx-2], eax |
||
616 | jc .downLeftLow |
||
617 | jmp .downLeftHigh |
||
5839 | pathoswith | 618 | |
5665 | Pathoswith | 619 | @@: |
620 | bt [ebx-1], eax |
||
621 | jc .checkRightUp |
||
622 | inc eax |
||
623 | inc eax |
||
624 | bt [ebx+1], eax |
||
625 | jc .checkRightUp |
||
626 | .downLeftLow: |
||
627 | imul ecx, esi |
||
628 | shl ecx, 2 |
||
629 | add edi, ecx |
||
630 | dec esi |
||
631 | mov eax, [esp+20+widthX] |
||
632 | imul eax, esi |
||
633 | add edi, eax |
||
634 | mov ecx, esi |
||
635 | dec ecx |
||
636 | .drawDownLeft: |
||
637 | mov eax, ecx |
||
638 | @@: |
||
639 | mov [edi+eax*4], ebp |
||
640 | dec eax |
||
641 | jns @b |
||
642 | sub edi, [esp+20+widthX] |
||
643 | dec ecx |
||
644 | jns .drawDownLeft |
||
645 | inc esi |
||
646 | mov edi, [esp] |
||
647 | jmp .checkRightUp |
||
5839 | pathoswith | 648 | |
5665 | Pathoswith | 649 | .downLeftHigh: |
650 | imul ecx, esi |
||
651 | shl ecx, 2 |
||
652 | add edi, ecx |
||
653 | dec esi |
||
654 | mov eax, [esp+20+widthX] |
||
655 | imul eax, esi |
||
656 | add edi, eax |
||
657 | mov ecx, esi |
||
658 | dec ecx |
||
659 | .drawDownLeftHigh: |
||
660 | mov eax, ecx |
||
661 | @@: |
||
662 | mov [edi+eax*4], ebp |
||
663 | dec eax |
||
664 | jns @b |
||
665 | sub edi, [esp+20+widthX] |
||
666 | mov eax, ecx |
||
667 | @@: |
||
668 | mov [edi+eax*4], ebp |
||
669 | dec eax |
||
670 | jns @b |
||
671 | sub edi, [esp+20+widthX] |
||
672 | dec ecx |
||
673 | jns .drawDownLeftHigh |
||
674 | inc esi |
||
675 | mov edi, [esp] |
||
676 | .checkRightUp: |
||
677 | bsf eax, edx |
||
678 | inc eax |
||
679 | bt [ebx-1], eax |
||
680 | jnc .nextPixel |
||
681 | mov ecx, eax |
||
682 | dec eax |
||
683 | bt [ebx-1], eax |
||
684 | jc @f |
||
685 | bt [ebx+1], eax |
||
686 | jnc .upLeftLow |
||
687 | bt [ebx+2], eax |
||
688 | jc .upLeftLow |
||
689 | inc eax |
||
690 | bt [ebx+1], eax |
||
691 | jc .upLeftLow |
||
692 | inc eax |
||
693 | bt [ebx+2], eax |
||
694 | jc .upLeftLow |
||
695 | jmp .upLeftHigh |
||
5839 | pathoswith | 696 | |
5665 | Pathoswith | 697 | @@: |
698 | bt [ebx+1], eax |
||
699 | jc .nextPixel |
||
700 | inc eax |
||
701 | inc eax |
||
702 | bt [ebx-1], eax |
||
703 | jc .nextPixel |
||
704 | .upLeftLow: |
||
705 | imul ecx, esi |
||
706 | shl ecx, 2 |
||
707 | add edi, ecx |
||
708 | mov ecx, esi |
||
709 | dec ecx |
||
710 | dec ecx |
||
711 | .drawUpLeft: |
||
712 | mov eax, ecx |
||
713 | @@: |
||
714 | mov [edi+eax*4], ebp |
||
715 | dec eax |
||
716 | jns @b |
||
717 | add edi, [esp+20+widthX] |
||
718 | dec ecx |
||
719 | jns .drawUpLeft |
||
720 | jmp .nextPixel |
||
5839 | pathoswith | 721 | |
5665 | Pathoswith | 722 | .upLeftHigh: |
723 | imul ecx, esi |
||
724 | shl ecx, 2 |
||
725 | add edi, ecx |
||
726 | mov ecx, esi |
||
727 | dec ecx |
||
728 | dec ecx |
||
729 | .drawUpLeftHigh: |
||
730 | mov eax, ecx |
||
731 | @@: |
||
732 | mov [edi+eax*4], ebp |
||
733 | dec eax |
||
734 | jns @b |
||
735 | add edi, [esp+20+widthX] |
||
736 | mov eax, ecx |
||
737 | @@: |
||
738 | mov [edi+eax*4], ebp |
||
739 | dec eax |
||
740 | jns @b |
||
741 | add edi, [esp+20+widthX] |
||
742 | dec ecx |
||
743 | jns .drawUpLeftHigh |
||
744 | .nextPixel: |
||
745 | bsf eax, edx |
||
746 | btr edx, eax |
||
747 | pop edi |
||
748 | jmp .raw |
||
5839 | pathoswith | 749 | |
5665 | Pathoswith | 750 | .nextRaw: |
2288 | clevermous | 751 | inc ebx |
5665 | Pathoswith | 752 | mov eax, [esp+16+widthX] |
753 | imul eax, esi |
||
754 | add edi, eax |
||
755 | dec dword [esp+4] |
||
756 | jnz drawChar |
||
757 | ret |
||
2536 | mario79 | 758 | |
5665 | Pathoswith | 759 | fontSmoothing db 1 |
760 | font1: |
||
3415 | esevece | 761 | if lang eq sp |
762 | file 'char_sp.mt' |
||
3927 | kaitz | 763 | else if lang eq et |
764 | file 'char_et.mt' |
||
3415 | esevece | 765 | else |
2640 | mario79 | 766 | file 'char.mt' |
3415 | esevece | 767 | end if |
5665 | Pathoswith | 768 | fontUni: |
769 | file 'charUni.mt' |