Subversion Repositories Kolibri OS

Rev

Rev 5164 | Rev 5351 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5164 Rev 5349
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2011-2014. 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: 5164 $
8
$Revision: 5349 $
9
 
9
 
10
 
10
 
Line 35... Line 35...
35
align 4
35
align 4
36
block_clip:
36
block_clip:
37
;esi= clip RECT ptr
37
;esi= clip RECT ptr
38
;edi= RECT ptr
38
;edi= RECT ptr
39
;return code:
39
;return code:
40
;eax= 0 - draw, 1 - don't draw
40
;CF= 0 - draw, 1 - don't draw
Line 41... Line 41...
41
 
41
 
Line 42... Line 42...
42
        push    ebx
42
        push    ebx
43
 
43
 
Line 51... Line 51...
51
 
51
 
52
        cmp     ebx, ecx                ;right < clip.left
52
        cmp     ebx, ecx                ;right < clip.left
Line 53... Line 53...
53
        jl      .fail
53
        jl      .fail
54
 
54
 
Line 55... Line 55...
55
        cmp     eax, ecx                ;left >= clip.left
55
        cmp     eax, ecx                ;left >= clip.left
56
        jae     @F
56
        jge     @F
57
 
-
 
58
        mov     eax, ecx
-
 
59
@@:
57
 
60
        mov     [edi+RECT.left], eax
58
        mov     [edi+RECT.left], ecx
61
 
-
 
62
        cmp     ebx, edx                ;right <= clip.right
-
 
63
        jle     @f
-
 
Line -... Line 59...
-
 
59
@@:
-
 
60
        cmp     ebx, edx                ;right <= clip.right
64
        mov     ebx, edx
61
        jle     @f
65
@@:
62
 
66
        mov     [edi+RECT.right], ebx
63
        mov     [edi+RECT.right], edx
67
 
64
@@:
Line 75... Line 72...
75
 
72
 
76
        cmp     ebx, ecx                ;bottom < clip.top
73
        cmp     ebx, ecx                ;bottom < clip.top
Line 77... Line 74...
77
        jl      .fail
74
        jl      .fail
78
 
75
 
Line 79... Line 76...
79
        cmp     eax, ecx                ;top >= clip.top
76
        cmp     eax, ecx                ;top >= clip.top
80
        jae     @F
77
        jge     @F
81
 
-
 
82
        mov     eax, ecx
-
 
83
@@:
78
 
84
        mov     [edi+RECT.top], eax
79
        mov     [edi+RECT.top], ecx
-
 
80
@@:
85
 
81
        cmp     ebx, edx                ;bottom <= clip.bottom
86
        cmp     ebx, edx                ;bottom <= clip.bottom
82
        jle     @f
87
        jle     @f
-
 
88
        mov     ebx, edx
83
 
89
@@:
84
        mov     [edi+RECT.bottom], edx
90
        mov     [edi+RECT.bottom], ebx
85
@@:
91
        pop     ebx
86
        pop     ebx
92
        xor     eax, eax
87
        clc
93
        ret
88
        ret
94
.fail:
89
.fail:
Line 95... Line 90...
95
        pop     ebx
90
        pop     ebx
96
        mov     eax, 1
91
        stc
Line -... Line 92...
-
 
92
        ret
-
 
93
 
-
 
94
 
97
        ret
95
align 4
98
 
96
blit_clip:
99
 
97
 
100
align 4
98
;return code:
Line 128... Line 126...
128
 
126
 
129
        lea     edi, [esp+.sx0]
127
        lea     edi, [esp+.sx0]
Line 130... Line 128...
130
        lea     esi, [ebx+BLITTER.sc]
128
        lea     esi, [ebx+BLITTER.sc]
131
 
-
 
132
        call    block_clip
-
 
133
        test    eax, eax
129
 
Line 134... Line 130...
134
        mov     esi, 1
130
        call    block_clip
135
        jnz     .done
131
        jc      .done
136
 
132
 
137
        mov     edi, [esp+.sx0]
133
        mov     edi, [esp+.sx0]
Line 155... Line 151...
155
        mov     [esp+.dy1], eax
151
        mov     [esp+.dy1], eax
Line 156... Line 152...
156
 
152
 
157
        lea     edi, [esp+.dx0]
153
        lea     edi, [esp+.dx0]
158
        lea     esi, [ebx+BLITTER.dc]
154
        lea     esi, [ebx+BLITTER.dc]
159
        call    block_clip
-
 
160
        test    eax, eax
-
 
161
        mov     esi, 1
155
        call    block_clip
Line 162... Line 156...
162
        jnz     .done
156
        jc      .done
163
 
157
 
164
        mov     edx, [esp+.dx0]
158
        mov     edx, [esp+.dx0]
165
        mov     eax, [esp+.dx1]
159
        mov     eax, [esp+.dx1]
Line 180... Line 174...
180
        add     ecx, eax
174
        add     ecx, eax
181
        sub     ecx, [ebx+BLITTER.dst_y]
175
        sub     ecx, [ebx+BLITTER.dst_y]
182
        mov     [ebx+BLITTER.src_y], ecx
176
        mov     [ebx+BLITTER.src_y], ecx
183
        mov     [ebx+BLITTER.dst_x], edx
177
        mov     [ebx+BLITTER.dst_x], edx
184
        mov     [ebx+BLITTER.dst_y], eax
178
        mov     [ebx+BLITTER.dst_y], eax
185
        xor     esi, esi
179
        clc
186
.done:
180
.done:
187
        mov     eax, esi
-
 
188
        add     esp, 40
181
        add     esp, 40
189
        pop     ebx
182
        pop     ebx
190
        pop     esi
183
        pop     esi
191
        pop     edi
184
        pop     edi
Line 259... Line 252...
259
        mov     eax, [ecx+36]
252
        mov     eax, [ecx+36]
260
        mov     [esp+BLITTER.stride], eax
253
        mov     [esp+BLITTER.stride], eax
Line 261... Line 254...
261
 
254
 
262
        mov     ecx, esp
255
        mov     ecx, esp
263
        call    blit_clip
-
 
264
        test    eax, eax
256
        call    blit_clip
Line 265... Line 257...
265
        jne     .L57
257
        jc      .L57
Line 266... Line 258...
266
 
258
 
267
        mov     eax, [TASK_BASE]
259
        mov     eax, [TASK_BASE]