Rev 2321 | Rev 2461 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2321 | Rev 2322 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | .;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. 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 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 2321 $ |
8 | $Revision: 2322 $ |
9 | 9 | ||
10 | ; // Alver 22.06.2008 // { |
10 | ; // Alver 22.06.2008 // { |
11 | align 4 |
11 | align 4 |
Line 129... | Line 129... | ||
129 | .end: |
129 | .end: |
130 | popad |
130 | popad |
131 | pop eax ; << // Alver 22.06.2008 // << |
131 | pop eax ; << // Alver 22.06.2008 // << |
132 | ret |
132 | ret |
Line -... | Line 133... | ||
- | 133 | ||
- | 134 | diff10 "old font code size",dtext,$ |
|
133 | 135 | ||
134 | ;===================================================== |
136 | ;===================================================== |
135 | ; NEW FONTS |
137 | ; NEW FONTS |
136 | ;_____________________________________________________ |
138 | ;_____________________________________________________ |
Line 137... | Line 139... | ||
137 | ; |
139 | ; |
138 | 140 | ||
Line 139... | Line 141... | ||
139 | align 8 |
141 | align 8 |
Line 140... | Line 142... | ||
140 | sdsh_data: |
142 | sdsh_data: |
Line 141... | Line 143... | ||
141 | 143 | ||
142 | include 'sdsh.inc' |
144 | include 'fonts/sd_data.asm' |
Line 150... | Line 152... | ||
150 | ; ecx = 0x00RRGGBB |
152 | ; ecx = 0x00RRGGBB |
151 | ; edx = if (bits[31:8] == 0) |
153 | ; edx = if (bits[31:8] == 0) |
152 | ; then dl = single char to write |
154 | ; then dl = single char to write |
153 | ; else edx= pointer to asciiz-string |
155 | ; else edx= pointer to asciiz-string |
Line -... | Line 156... | ||
- | 156 | ||
- | 157 | draw_char: |
|
- | 158 | ; font test |
|
- | 159 | ; bl=y; bh=x |
|
- | 160 | ; dl=ascii |
|
- | 161 | movzx eax, bh |
|
- | 162 | movzx ebx, bl |
|
- | 163 | movzx ecx, dl |
|
- | 164 | xor edi, edi |
|
154 | 165 | mov ebp, edi |
|
155 | 166 | ||
156 | sdsh_draw_char: |
167 | sdsh_draw_char: |
157 | ; eax = left side X |
168 | ; eax = left side X |
158 | ; ebx = bottom Y |
169 | ; ebx = bottom Y |
159 | ; edi = color 0x0RRGGBB |
170 | ; edi = color 0x0RRGGBB |
160 | ; ebp = font@ |
171 | ; ebp = font@ |
- | 172 | ; ecx = ascii, zero-extended to 32bits |
|
- | 173 | push ecx |
|
161 | ; ecx = ascii, zero-extended to 32bits |
174 | push edx |
162 | push ecx, edx, ebp |
175 | push ebp |
163 | shl ebp, 4 |
176 | shl ebp, 4 |
164 | add ebp, sdsh_data.info |
177 | add ebp, sdsh_data.info |
165 | call ch_checkscreen |
178 | call ch_checkscreen |
166 | jb .exit |
179 | jb .exit |
Line 179... | Line 192... | ||
179 | add edx, 4 |
192 | add edx, 4 |
180 | dec cl |
193 | dec cl |
181 | jnz .next_tick |
194 | jnz .next_tick |
182 | .blank: |
195 | .blank: |
183 | .exit: |
196 | .exit: |
- | 197 | pop ebp |
|
- | 198 | pop edx |
|
184 | pop ebp, edx, ecx |
199 | pop ecx |
185 | ret |
200 | ret |
Line 186... | Line 201... | ||
186 | 201 | ||
187 | 202 | ||
Line 239... | Line 254... | ||
239 | .gptick.3: |
254 | .gptick.3: |
240 | sub dl, (sdsh_data.v9-sdsh_data.v5) |
255 | sub dl, (sdsh_data.v9-sdsh_data.v5) |
241 | cmp dl, (sdsh_data.v13-sdsh_data.v9) |
256 | cmp dl, (sdsh_data.v13-sdsh_data.v9) |
242 | jae .gptick.4 |
257 | jae .gptick.4 |
243 | mov esi, sdsh_data.v9 |
258 | mov esi, sdsh_data.v9 |
- | 259 | lea esi,[esi+edx*2] |
|
244 | lea esi,[esi+edx*2+edx] ; 3-byte tickgroups .v9-12: 4 ticks each |
260 | add esi, edx ; 3-byte tickgroups .v9-12: 4 ticks each |
245 | mov dh, 9 |
261 | mov dh, 9 |
246 | shr dl, 2 |
262 | shr dl, 2 |
247 | add dl, dh |
263 | add dl, dh |
248 | jmp .gptick.done |
264 | jmp .gptick.done |
249 | .gptick.4: |
265 | .gptick.4: |
Line 355... | Line 371... | ||
355 | xchg esi, edx |
371 | xchg esi, edx |
356 | .move_and_draw: |
372 | .move_and_draw: |
357 | mov ch, dl |
373 | mov ch, dl |
358 | and ch, 3 |
374 | and ch, 3 |
359 | jz .moved |
375 | jz .moved |
360 | btc ch, 0 |
376 | btc ecx, 8 |
361 | jz .2 |
377 | jz .2 |
362 | .1: |
378 | .1: |
363 | dec cl ; right turns (1 and 3) |
379 | dec cl ; right turns (1 and 3) |
364 | and cl, 7 |
380 | and cl, 7 |
365 | @@: btc ch, 1 ; straight angle (3) ? |
381 | @@: btc ecx, 9 ; straight angle (3) ? |
366 | jc .1 |
382 | jc .1 |
367 | jmp .moved |
383 | jmp .moved |
368 | .2: |
384 | .2: |
369 | inc cl ; left turn (2) |
385 | inc cl ; left turn (2) |
370 | and cl, 7 |
386 | and cl, 7 |
371 | btc ch, 1 ; just to zero ah |
387 | btc ecx, 9 ; just to zero ah |
372 | .moved: |
388 | .moved: |
373 | call [.moves + ecx*4] ; go new way |
389 | call [.moves + ecx*4] ; go new way |
374 | call ch_putpixel |
390 | call ch_putpixel |
375 | shr edx, 2 |
391 | shr edx, 2 |
376 | dec esi |
392 | dec esi |
Line 425... | Line 441... | ||
425 | ch_checkwin: |
441 | ch_checkwin: |
426 | ; eax = x coordinate |
442 | ; eax = x coordinate |
427 | ; ebx = y coordinate |
443 | ; ebx = y coordinate |
428 | ; ebp -> font info |
444 | ; ebp -> font info |
429 | ;!destroys ch, edx! |
445 | ;!destroys ch, edx! |
- | 446 | push eax |
|
430 | push eax, ebx |
447 | push ebx |
431 | mov ch, byte[CURRENT_TASK] |
448 | mov ch, byte[CURRENT_TASK] |
432 | mov al, byte [ebp] ; char X-width |
449 | mov al, byte [ebp] ; char X-width |
433 | mov edx, [_display.width] ; screen X-size |
450 | mov edx, [_display.width] ; screen X-size |
434 | imul edx, ebx |
451 | imul edx, ebx |
435 | add edx, [_WinMapAddress] |
452 | add edx, [_WinMapAddress] |
436 | add edx, eax |
453 | add edx, eax |
437 | cmp ch, byte [edx] |
454 | cmp ch, byte [edx] |
438 | jne .fail |
455 | jne .fail |
439 | moxzx eax, byte [ebp] |
456 | movzx eax, byte [ebp] |
440 | cmp ch, byte [edx+eax] |
457 | cmp ch, byte [edx+eax] |
441 | jne .fail |
458 | jne .fail |
442 | moxzx ebx, byte [ebp+1] |
459 | movzx ebx, byte [ebp+1] |
443 | imul ebx, [_display.width] |
460 | imul ebx, [_display.width] |
444 | cmp ch, byte [edx+ebx] |
461 | cmp ch, byte [edx+ebx] |
445 | jne .fail |
462 | jne .fail |
446 | add edx, eax |
463 | add edx, eax |
447 | cmp ch, byte [edx+ebx] |
464 | cmp ch, byte [edx+ebx] |
448 | clc |
465 | clc |
449 | je .done |
466 | je .done |
450 | .fail: |
467 | .fail: |
451 | stc ; CF means the charbox is invisible |
468 | stc ; CF means the charbox is invisible |
452 | .done: |
469 | .done: |
- | 470 | pop ebx |
|
453 | pop ebx, eax |
471 | pop eax |
454 | ret |
472 | ret |
Line 455... | Line 473... | ||
455 | 473 | ||
456 | align 4 |
474 | align 4 |
457 | ch_putpixel: |
475 | ch_putpixel: |
Line 461... | Line 479... | ||
461 | push edx |
479 | push edx |
462 | mov edx, ebx |
480 | mov edx, ebx |
463 | imul edx, [BytesPerScanLine] |
481 | imul edx, [BytesPerScanLine] |
464 | lea edx, [edx+eax*4] |
482 | lea edx, [edx+eax*4] |
465 | mov [LFB_BASE+edx], edi |
483 | mov [LFB_BASE+edx], edi |
466 | pop edx |
484 | pop edx |
467 | ret |
485 | ret |
468 | ;) |
486 | ;) |
Line 469... | Line -... | ||
469 | - | ||
- | 487 | ||
470 | ;diff16 "font code end ",0,$ |
488 |