Rev 431 | Rev 684 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 431 | Rev 593 | ||
---|---|---|---|
1 | $Revision: 431 $ |
- | |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;; ;; |
2 | ;; ;; |
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; ;; |
5 | ;; ;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | 7 | ||
- | 8 | $Revision: 593 $ |
|
- | 9 | ||
8 | 10 | ||
9 | align 4 |
11 | align 4 |
10 | dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) |
12 | dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) |
11 | ; eax x & y |
13 | ; eax x & y |
12 | ; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) |
14 | ; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) |
13 | ; X = ABnnb: |
15 | ; X = ABnnb: |
14 | ; nn = font |
16 | ; nn = font |
15 | ; A = 0 <=> output edx characters; otherwise output ASCIIZ string |
17 | ; A = 0 <=> output edx characters; otherwise output ASCIIZ string |
16 | ; B = 1 <=> fill background with color esi |
18 | ; B = 1 <=> fill background with color esi |
17 | ; ecx start of text |
19 | ; ecx start of text |
18 | ; edi 1 force |
20 | ; edi 1 force |
19 | 21 | ||
20 | pushad |
22 | pushad |
21 | call [disable_mouse] |
23 | call [disable_mouse] |
22 | 24 | ||
23 | mov ebp, ecx ; ebp=pointer to text |
25 | mov ebp, ecx ; ebp=pointer to text |
24 | mov ecx, ebx ; ecx=color |
26 | mov ecx, ebx ; ecx=color |
25 | movsx ebx, ax ; ebx=y |
27 | movsx ebx, ax ; ebx=y |
26 | sar eax, 16 ; eax=x |
28 | sar eax, 16 ; eax=x |
27 | cmp edx, 255 |
29 | cmp edx, 255 |
28 | jb .loop |
30 | jb .loop |
29 | mov edx, 255 |
31 | mov edx, 255 |
30 | .loop: |
32 | .loop: |
31 | test ecx, ecx |
33 | test ecx, ecx |
32 | js .test_asciiz |
34 | js .test_asciiz |
33 | dec edx |
35 | dec edx |
34 | js .end |
36 | js .end |
35 | jmp @f |
37 | jmp @f |
36 | .test_asciiz: |
38 | .test_asciiz: |
37 | cmp byte [ebp], 0 |
39 | cmp byte [ebp], 0 |
38 | jz .end |
40 | jz .end |
39 | @@: |
41 | @@: |
40 | push edx |
42 | push edx |
41 | movzx edx, byte [ebp] |
43 | movzx edx, byte [ebp] |
42 | inc ebp |
44 | inc ebp |
43 | test ecx, 0x10000000 |
45 | test ecx, 0x10000000 |
44 | jnz .font2 |
46 | jnz .font2 |
45 | pushad |
47 | pushad |
46 | mov esi, 9 |
48 | mov esi, 9 |
47 | lea ebp, [FONT_I+8*edx+edx] |
49 | lea ebp, [FONT_I+8*edx+edx] |
48 | .symloop1: |
50 | .symloop1: |
49 | mov dl, byte [ebp] |
51 | mov dl, byte [ebp] |
50 | or dl, 1 shl 6 |
52 | or dl, 1 shl 6 |
51 | .pixloop1: |
53 | .pixloop1: |
52 | shr dl, 1 |
54 | shr dl, 1 |
53 | jz .pixloop1end |
55 | jz .pixloop1end |
54 | jnc .nopix |
56 | jnc .nopix |
55 | call [putpixel] |
57 | call [putpixel] |
56 | jmp .pixloop1cont |
58 | jmp .pixloop1cont |
57 | .nopix: |
59 | .nopix: |
58 | test ecx, 0x40000000 |
60 | test ecx, 0x40000000 |
59 | jz .pixloop1cont |
61 | jz .pixloop1cont |
60 | push ecx |
62 | push ecx |
61 | mov ecx, [esp+4+4] |
63 | mov ecx, [esp+4+4] |
62 | call [putpixel] |
64 | call [putpixel] |
63 | pop ecx |
65 | pop ecx |
64 | .pixloop1cont: |
66 | .pixloop1cont: |
65 | inc eax |
67 | inc eax |
66 | jmp .pixloop1 |
68 | jmp .pixloop1 |
67 | .pixloop1end: |
69 | .pixloop1end: |
68 | sub eax, 6 |
70 | sub eax, 6 |
69 | inc ebx |
71 | inc ebx |
70 | inc ebp |
72 | inc ebp |
71 | dec esi |
73 | dec esi |
72 | jnz .symloop1 |
74 | jnz .symloop1 |
73 | popad |
75 | popad |
74 | add eax, 6 |
76 | add eax, 6 |
75 | pop edx |
77 | pop edx |
76 | jmp .loop |
78 | jmp .loop |
77 | .font2: |
79 | .font2: |
78 | pushad |
80 | pushad |
79 | add edx, edx |
81 | add edx, edx |
80 | lea ebp, [FONT_II+4*edx+edx+1] |
82 | lea ebp, [FONT_II+4*edx+edx+1] |
81 | push 9 |
83 | push 9 |
82 | movzx esi, byte [ebp-1] |
84 | movzx esi, byte [ebp-1] |
83 | .symloop2: |
85 | .symloop2: |
84 | mov dl, byte [ebp] |
86 | mov dl, byte [ebp] |
85 | push esi |
87 | push esi |
86 | .pixloop2: |
88 | .pixloop2: |
87 | shr dl, 1 |
89 | shr dl, 1 |
88 | jnc .nopix2 |
90 | jnc .nopix2 |
89 | call [putpixel] |
91 | call [putpixel] |
90 | jmp .pixloop2cont |
92 | jmp .pixloop2cont |
91 | .nopix2: |
93 | .nopix2: |
92 | test ecx, 0x40000000 |
94 | test ecx, 0x40000000 |
93 | jz .pixloop2cont |
95 | jz .pixloop2cont |
94 | push ecx |
96 | push ecx |
95 | mov ecx, [esp+12+4] |
97 | mov ecx, [esp+12+4] |
96 | call [putpixel] |
98 | call [putpixel] |
97 | pop ecx |
99 | pop ecx |
98 | .pixloop2cont: |
100 | .pixloop2cont: |
99 | inc eax |
101 | inc eax |
100 | dec esi |
102 | dec esi |
101 | jnz .pixloop2 |
103 | jnz .pixloop2 |
102 | pop esi |
104 | pop esi |
103 | sub eax, esi |
105 | sub eax, esi |
104 | inc ebx |
106 | inc ebx |
105 | inc ebp |
107 | inc ebp |
106 | dec dword [esp] |
108 | dec dword [esp] |
107 | jnz .symloop2 |
109 | jnz .symloop2 |
108 | pop eax |
110 | pop eax |
109 | add dword [esp+28], esi |
111 | add dword [esp+28], esi |
110 | popad |
112 | popad |
111 | pop edx |
113 | pop edx |
112 | jmp .loop |
114 | jmp .loop |
113 | .end: |
115 | .end: |
114 | popad |
116 | popad |
115 | ret=>=> |
117 | ret=>=> |