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