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