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