Subversion Repositories Kolibri OS

Rev

Rev 2640 | Rev 3416 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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