Rev 3684 | Rev 5665 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
2455 | mario79 | 3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
2288 | clevermous | 4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
7 | |||
8 | $Revision: 3927 $ |
||
9 | |||
2436 | mario79 | 10 | ;------------------------------------------------------------------------------ |
2288 | clevermous | 11 | align 4 |
12 | dtext_asciiz_esi: ; for skins title out |
||
13 | push eax |
||
14 | xor eax, eax |
||
15 | inc eax |
||
16 | jmp dtext.1 |
||
2436 | mario79 | 17 | ;------------------------------------------------------------------------------ |
2288 | clevermous | 18 | align 4 |
2536 | mario79 | 19 | dtext: |
20 | ; ebx x & y |
||
21 | ; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) |
||
22 | ; X = ABnnb: |
||
23 | ; nn = font |
||
24 | ; A = 0 <=> output esi characters; otherwise output ASCIIZ string |
||
25 | ; B = 1 <=> fill background with color eax |
||
26 | ; edx start of text |
||
27 | ; edi 1 force or user area for redirect |
||
2288 | clevermous | 28 | push eax |
29 | xor eax, eax |
||
2436 | mario79 | 30 | ;-------------------------------------- |
31 | align 4 |
||
2288 | clevermous | 32 | .1: |
33 | pushad |
||
34 | movsx eax, bx ; eax=y |
||
35 | sar ebx, 16 ; ebx=x |
||
36 | xchg eax, ebx ; eax=x, ebx=y |
||
37 | cmp esi, 255 |
||
38 | jb .loop |
||
2536 | mario79 | 39 | |
2288 | clevermous | 40 | mov esi, 255 |
2436 | mario79 | 41 | ;-------------------------------------- |
42 | align 4 |
||
2288 | clevermous | 43 | .loop: |
44 | test ecx, ecx |
||
45 | js .test_asciiz |
||
2536 | mario79 | 46 | |
2288 | clevermous | 47 | dec esi |
48 | js .end |
||
2536 | mario79 | 49 | |
2288 | clevermous | 50 | jmp @f |
2436 | mario79 | 51 | ;-------------------------------------- |
52 | align 4 |
||
2288 | clevermous | 53 | .test_asciiz: |
54 | cmp byte [edx], 0 |
||
55 | jz .end |
||
2436 | mario79 | 56 | |
2288 | clevermous | 57 | cmp byte [esp+28], 1 |
58 | jne @f |
||
2536 | mario79 | 59 | |
2288 | clevermous | 60 | dec esi |
61 | js .end |
||
2436 | mario79 | 62 | ;-------------------------------------- |
63 | align 4 |
||
2288 | clevermous | 64 | @@: |
65 | inc edx |
||
66 | pushad |
||
67 | movzx edx, byte [edx-1] |
||
68 | test ecx, 0x10000000 |
||
69 | jnz .font2 |
||
2536 | mario79 | 70 | |
2288 | clevermous | 71 | mov esi, 9 |
72 | lea ebp, [FONT_I+8*edx+edx] |
||
2436 | mario79 | 73 | ;-------------------------------------- |
74 | align 4 |
||
2288 | clevermous | 75 | .symloop1: |
76 | mov dl, byte [ebp] |
||
77 | or dl, 1 shl 6 |
||
2436 | mario79 | 78 | ;-------------------------------------- |
79 | align 4 |
||
2288 | clevermous | 80 | .pixloop1: |
81 | shr dl, 1 |
||
82 | jz .pixloop1end |
||
2536 | mario79 | 83 | |
2288 | clevermous | 84 | jnc .nopix |
2536 | mario79 | 85 | |
86 | test ecx, 0x08000000 ; redirect the output to the user area |
||
87 | jz @f |
||
88 | |||
89 | call draw_text_to_user_area |
||
90 | jmp .pixloop1cont |
||
91 | ;-------------------------------------- |
||
92 | align 4 |
||
93 | @@: |
||
2430 | mario79 | 94 | and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area |
2453 | mario79 | 95 | ; call [putpixel] |
96 | call __sys_putpixel |
||
2288 | clevermous | 97 | jmp .pixloop1cont |
2436 | mario79 | 98 | ;-------------------------------------- |
99 | align 4 |
||
2288 | clevermous | 100 | .nopix: |
101 | test ecx, 0x40000000 |
||
102 | jz .pixloop1cont |
||
2536 | mario79 | 103 | |
2288 | clevermous | 104 | push ecx |
105 | mov ecx, [esp+4+20h+20h] |
||
2536 | mario79 | 106 | |
107 | test ecx, 0x08000000 ; redirect the output to the user area |
||
108 | jz @f |
||
109 | |||
110 | call draw_text_to_user_area |
||
111 | pop ecx |
||
112 | jmp .pixloop1cont |
||
113 | ;-------------------------------------- |
||
114 | align 4 |
||
115 | @@: |
||
2430 | mario79 | 116 | and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area |
2453 | mario79 | 117 | ; call [putpixel] |
118 | call __sys_putpixel |
||
2288 | clevermous | 119 | pop ecx |
2436 | mario79 | 120 | ;-------------------------------------- |
121 | align 4 |
||
2288 | clevermous | 122 | .pixloop1cont: |
123 | inc eax |
||
124 | jmp .pixloop1 |
||
2436 | mario79 | 125 | ;-------------------------------------- |
126 | align 4 |
||
2288 | clevermous | 127 | .pixloop1end: |
128 | sub eax, 6 |
||
129 | inc ebx |
||
130 | inc ebp |
||
131 | dec esi |
||
132 | jnz .symloop1 |
||
2536 | mario79 | 133 | |
2288 | clevermous | 134 | popad |
135 | add eax, 6 |
||
136 | jmp .loop |
||
2436 | mario79 | 137 | ;-------------------------------------- |
138 | align 4 |
||
2288 | clevermous | 139 | .font2: |
140 | add edx, edx |
||
141 | lea ebp, [FONT_II+4*edx+edx+1] |
||
142 | push 9 |
||
143 | movzx esi, byte [ebp-1] |
||
2436 | mario79 | 144 | ;-------------------------------------- |
145 | align 4 |
||
2288 | clevermous | 146 | .symloop2: |
147 | mov dl, byte [ebp] |
||
148 | push esi |
||
2436 | mario79 | 149 | ;-------------------------------------- |
150 | align 4 |
||
2288 | clevermous | 151 | .pixloop2: |
152 | shr dl, 1 |
||
153 | jnc .nopix2 |
||
2536 | mario79 | 154 | |
155 | test ecx, 0x08000000 ; redirect the output to the user area |
||
156 | jz @f |
||
157 | |||
158 | call draw_text_to_user_area |
||
159 | jmp .pixloop2cont |
||
160 | ;-------------------------------------- |
||
161 | align 4 |
||
162 | @@: |
||
2430 | mario79 | 163 | and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area |
2453 | mario79 | 164 | ; call [putpixel] |
165 | call __sys_putpixel |
||
2288 | clevermous | 166 | jmp .pixloop2cont |
2436 | mario79 | 167 | ;-------------------------------------- |
168 | align 4 |
||
2288 | clevermous | 169 | .nopix2: |
170 | test ecx, 0x40000000 |
||
171 | jz .pixloop2cont |
||
2536 | mario79 | 172 | |
2288 | clevermous | 173 | push ecx |
174 | mov ecx, [esp+12+20h+20h] |
||
2536 | mario79 | 175 | |
176 | test ecx, 0x08000000 ; redirect the output to the user area |
||
177 | jz @f |
||
178 | |||
179 | call draw_text_to_user_area |
||
180 | pop ecx |
||
181 | jmp .pixloop2cont |
||
182 | ;-------------------------------------- |
||
183 | align 4 |
||
184 | @@: |
||
2430 | mario79 | 185 | and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area |
2453 | mario79 | 186 | ; call [putpixel] |
187 | call __sys_putpixel |
||
2288 | clevermous | 188 | pop ecx |
2436 | mario79 | 189 | ;-------------------------------------- |
190 | align 4 |
||
2288 | clevermous | 191 | .pixloop2cont: |
192 | inc eax |
||
193 | dec esi |
||
194 | jnz .pixloop2 |
||
2536 | mario79 | 195 | |
2288 | clevermous | 196 | pop esi |
197 | sub eax, esi |
||
198 | inc ebx |
||
199 | inc ebp |
||
200 | dec dword [esp] |
||
201 | jnz .symloop2 |
||
2536 | mario79 | 202 | |
2288 | clevermous | 203 | pop eax |
204 | add dword [esp+28], esi |
||
205 | popad |
||
206 | jmp .loop |
||
2436 | mario79 | 207 | ;-------------------------------------- |
208 | align 4 |
||
2288 | clevermous | 209 | .end: |
210 | popad |
||
2436 | mario79 | 211 | pop eax |
2288 | clevermous | 212 | ret |
2436 | mario79 | 213 | ;------------------------------------------------------------------------------ |
2536 | mario79 | 214 | ; eax = x coordinate |
215 | ; ebx = y coordinate |
||
216 | ; ecx = ?? RR GG BB |
||
217 | ; edi = user area |
||
218 | align 4 |
||
219 | draw_text_to_user_area: |
||
220 | pushad |
||
221 | imul ebx, [edi+0] |
||
222 | add eax, ebx |
||
223 | shl eax, 2 |
||
224 | add eax, edi |
||
225 | add eax, 8 |
||
226 | and ecx, 0xffffff |
||
227 | or ecx, 0xff000000 ; not transparent |
||
228 | mov [eax], ecx ; store pixel |
||
229 | popad |
||
230 | ret |
||
2640 | mario79 | 231 | ;------------------------------------------------------------------------------ |
232 | align 4 |
||
233 | FONT_I: |
||
3415 | esevece | 234 | if lang eq sp |
235 | file 'char_sp.mt' |
||
3927 | kaitz | 236 | else if lang eq et |
237 | file 'char_et.mt' |
||
3415 | esevece | 238 | else |
2640 | mario79 | 239 | file 'char.mt' |
3415 | esevece | 240 | end if |
2640 | mario79 | 241 | ;------------------------------------------------------------------------------ |
242 | align 4 |
||
243 | FONT_II: |
||
3415 | esevece | 244 | if lang eq sp |
245 | file 'char2_sp.mt' |
||
3927 | kaitz | 246 | else if lang eq et |
247 | file 'char2_et.mt' |
||
3415 | esevece | 248 | else |
2640 | mario79 | 249 | file 'char2.mt' |
3415 | esevece | 250 | end if |
251 | ;------------------------------------------------------------------------------=>=> |