Rev 2453 | Rev 2480 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2453 | Rev 2455 | ||
---|---|---|---|
- | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 2 | ;; ;; |
|
- | 3 | ;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;; |
|
- | 4 | ;; Distributed under terms of the GNU General Public License ;; |
|
- | 5 | ;; ;; |
|
- | 6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
1 | struct BLITTER_BLOCK |
7 | |
2 | xmin dd ? |
8 | struct BLITTER_BLOCK |
3 | ymin dd ? |
9 | xmin dd ? |
4 | xmax dd ? |
10 | ymin dd ? |
5 | ymax dd ? |
11 | xmax dd ? |
6 | ends |
12 | ymax dd ? |
7 | 13 | ends |
|
8 | 14 | ||
9 | struct BLITTER |
15 | |
10 | dc BLITTER_BLOCK |
16 | struct BLITTER |
11 | sc BLITTER_BLOCK |
17 | dc BLITTER_BLOCK |
12 | dst_x dd ? ; 32 |
18 | sc BLITTER_BLOCK |
13 | dst_y dd ? ; 36 |
19 | dst_x dd ? ; 32 |
14 | src_x dd ? ; 40 |
20 | dst_y dd ? ; 36 |
15 | src_y dd ? ; 44 |
21 | src_x dd ? ; 40 |
16 | w dd ? ; 48 |
22 | src_y dd ? ; 44 |
17 | h dd ? ; 52 |
23 | w dd ? ; 48 |
18 | 24 | h dd ? ; 52 |
|
19 | bitmap dd ? ; 56 |
25 | |
20 | stride dd ? ; 60 |
26 | bitmap dd ? ; 56 |
21 | ends |
27 | stride dd ? ; 60 |
22 | 28 | ends |
|
23 | 29 | ||
24 | align 4 |
30 | |
25 | 31 | align 4 |
|
26 | __L1OutCode: |
32 | |
27 | push ebx |
33 | __L1OutCode: |
28 | mov ebx, 8 |
34 | push ebx |
29 | cmp edx, [eax] |
35 | mov ebx, 8 |
30 | jl .L2 |
36 | cmp edx, [eax] |
31 | xor ebx, ebx |
37 | jl .L2 |
32 | cmp edx, [eax+8] |
38 | xor ebx, ebx |
33 | setg bl |
39 | cmp edx, [eax+8] |
34 | sal ebx, 2 |
40 | setg bl |
35 | .L2: |
41 | sal ebx, 2 |
36 | cmp ecx, [eax+4] |
42 | .L2: |
37 | jge .L3 |
43 | cmp ecx, [eax+4] |
38 | or ebx, 1 |
44 | jge .L3 |
39 | jmp .L4 |
45 | or ebx, 1 |
40 | 46 | jmp .L4 |
|
41 | .L3: |
47 | |
42 | cmp ecx, [eax+12] |
48 | .L3: |
43 | jle .L4 |
49 | cmp ecx, [eax+12] |
44 | or ebx, 2 |
50 | jle .L4 |
45 | .L4: |
51 | or ebx, 2 |
46 | mov eax, ebx |
52 | .L4: |
47 | pop ebx |
53 | mov eax, ebx |
48 | ret |
54 | pop ebx |
49 | 55 | ret |
|
50 | align 4 |
56 | |
51 | block_clip: |
57 | align 4 |
52 | push ebp |
58 | block_clip: |
53 | push edi |
59 | push ebp |
54 | push esi |
60 | push edi |
55 | push ebx |
61 | push esi |
56 | sub esp, 4 |
62 | push ebx |
57 | 63 | sub esp, 4 |
|
58 | mov ebx, eax |
64 | |
59 | mov [esp], edx |
65 | mov ebx, eax |
60 | mov ebp, ecx |
66 | mov [esp], edx |
61 | mov ecx, [ecx] |
67 | mov ebp, ecx |
62 | mov edx, [edx] |
68 | mov ecx, [ecx] |
63 | call __L1OutCode |
69 | mov edx, [edx] |
64 | 70 | call __L1OutCode |
|
65 | mov esi, eax |
71 | |
66 | mov edx, [esp+28] |
72 | mov esi, eax |
67 | mov ecx, [edx] |
73 | mov edx, [esp+28] |
68 | .L21: |
74 | mov ecx, [edx] |
69 | mov eax, [esp+24] |
75 | .L21: |
70 | mov edx, [eax] |
76 | mov eax, [esp+24] |
71 | mov eax, ebx |
77 | mov edx, [eax] |
72 | call __L1OutCode |
78 | mov eax, ebx |
73 | 79 | call __L1OutCode |
|
74 | mov edi, eax |
80 | |
75 | .L20: |
81 | mov edi, eax |
76 | mov eax, edi |
82 | .L20: |
77 | and eax, esi |
83 | mov eax, edi |
78 | jne .L9 |
84 | and eax, esi |
79 | cmp esi, edi |
85 | jne .L9 |
80 | je .L9 |
86 | cmp esi, edi |
81 | test esi, esi |
87 | je .L9 |
82 | jne .L10 |
88 | test esi, esi |
83 | test edi, 1 |
89 | jne .L10 |
84 | je .L11 |
90 | test edi, 1 |
85 | mov eax, [ebx+4] |
91 | je .L11 |
86 | jmp .L25 |
92 | mov eax, [ebx+4] |
87 | .L11: |
93 | jmp .L25 |
88 | test edi, 2 |
94 | .L11: |
89 | je .L13 |
95 | test edi, 2 |
90 | mov eax, [ebx+12] |
96 | je .L13 |
91 | .L25: |
97 | mov eax, [ebx+12] |
92 | mov edx, [esp+28] |
98 | .L25: |
93 | jmp .L22 |
99 | mov edx, [esp+28] |
94 | .L13: |
100 | jmp .L22 |
95 | test edi, 4 |
101 | .L13: |
96 | je .L14 |
102 | test edi, 4 |
97 | mov eax, [ebx+8] |
103 | je .L14 |
98 | jmp .L26 |
104 | mov eax, [ebx+8] |
99 | .L14: |
105 | jmp .L26 |
100 | and edi, 8 |
106 | .L14: |
101 | je .L12 |
107 | and edi, 8 |
102 | mov eax, [ebx] |
108 | je .L12 |
103 | .L26: |
109 | mov eax, [ebx] |
104 | mov edx, [esp+24] |
110 | .L26: |
105 | .L22: |
111 | mov edx, [esp+24] |
106 | mov [edx], eax |
112 | .L22: |
107 | .L12: |
113 | mov [edx], eax |
108 | mov eax, [esp+28] |
114 | .L12: |
109 | mov ecx, [eax] |
115 | mov eax, [esp+28] |
110 | jmp .L21 |
116 | mov ecx, [eax] |
111 | .L10: |
117 | jmp .L21 |
112 | test esi, 1 |
118 | .L10: |
113 | je .L16 |
119 | test esi, 1 |
114 | mov eax, [ebx+4] |
120 | je .L16 |
115 | jmp .L23 |
121 | mov eax, [ebx+4] |
116 | .L16: |
122 | jmp .L23 |
117 | test esi, 2 |
123 | .L16: |
118 | je .L18 |
124 | test esi, 2 |
119 | mov eax, [ebx+12] |
125 | je .L18 |
120 | .L23: |
126 | mov eax, [ebx+12] |
121 | mov [ebp+0], eax |
127 | .L23: |
122 | jmp .L17 |
128 | mov [ebp+0], eax |
123 | .L18: |
129 | jmp .L17 |
124 | test esi, 4 |
130 | .L18: |
125 | je .L19 |
131 | test esi, 4 |
126 | mov eax, [ebx+8] |
132 | je .L19 |
127 | jmp .L24 |
133 | mov eax, [ebx+8] |
128 | .L19: |
134 | jmp .L24 |
129 | and esi, 8 |
135 | .L19: |
130 | je .L17 |
136 | and esi, 8 |
131 | mov eax, [ebx] |
137 | je .L17 |
132 | .L24: |
138 | mov eax, [ebx] |
133 | mov edx, [esp] |
139 | .L24: |
134 | mov [edx], eax |
140 | mov edx, [esp] |
135 | .L17: |
141 | mov [edx], eax |
136 | mov ecx, [ebp+0] |
142 | .L17: |
137 | mov eax, [esp] |
143 | mov ecx, [ebp+0] |
138 | mov edx, [eax] |
144 | mov eax, [esp] |
139 | mov eax, ebx |
145 | mov edx, [eax] |
140 | call __L1OutCode |
146 | mov eax, ebx |
141 | mov esi, eax |
147 | call __L1OutCode |
142 | jmp .L20 |
148 | mov esi, eax |
143 | .L9: |
149 | jmp .L20 |
144 | add esp, 4 |
150 | .L9: |
145 | pop ebx |
151 | add esp, 4 |
146 | pop esi |
152 | pop ebx |
147 | pop edi |
153 | pop esi |
148 | pop ebp |
154 | pop edi |
149 | ret |
155 | pop ebp |
150 | 156 | ret |
|
151 | align 4 |
157 | |
152 | blit_clip: |
158 | align 4 |
153 | 159 | blit_clip: |
|
154 | .sx0 equ 36 |
160 | |
155 | .sy0 equ 32 |
161 | .sx0 equ 36 |
156 | .sx1 equ 28 |
162 | .sy0 equ 32 |
157 | .sy1 equ 24 |
163 | .sx1 equ 28 |
158 | 164 | .sy1 equ 24 |
|
159 | .dx0 equ 20 |
165 | |
160 | .dy0 equ 16 |
166 | .dx0 equ 20 |
161 | .dx1 equ 12 |
167 | .dy0 equ 16 |
162 | .dy1 equ 8 |
168 | .dx1 equ 12 |
163 | 169 | .dy1 equ 8 |
|
164 | 170 | ||
165 | push edi |
171 | |
166 | push esi |
172 | push edi |
167 | push ebx |
173 | push esi |
168 | sub esp, 40 |
174 | push ebx |
169 | 175 | sub esp, 40 |
|
170 | mov ebx, ecx |
176 | |
171 | mov edx, [ecx+BLITTER.src_x] |
177 | mov ebx, ecx |
172 | mov [esp+.sx0], edx |
178 | mov edx, [ecx+BLITTER.src_x] |
173 | mov eax, [ecx+BLITTER.src_y] |
179 | mov [esp+.sx0], edx |
174 | mov [esp+.sy0], eax |
180 | mov eax, [ecx+BLITTER.src_y] |
175 | add edx, [ecx+BLITTER.w] |
181 | mov [esp+.sy0], eax |
176 | dec edx |
182 | add edx, [ecx+BLITTER.w] |
177 | mov [esp+.sx1], edx |
183 | dec edx |
178 | add eax, [ecx+BLITTER.h] |
184 | mov [esp+.sx1], edx |
179 | dec eax |
185 | add eax, [ecx+BLITTER.h] |
180 | mov [esp+.sy1], eax |
186 | dec eax |
181 | 187 | mov [esp+.sy1], eax |
|
182 | lea ecx, [esp+.sy0] |
188 | |
183 | lea edx, [esp+.sx0] |
189 | lea ecx, [esp+.sy0] |
184 | lea eax, [ebx+BLITTER.sc] |
190 | lea edx, [esp+.sx0] |
185 | lea esi, [esp+.sy1] |
191 | lea eax, [ebx+BLITTER.sc] |
186 | 192 | lea esi, [esp+.sy1] |
|
187 | mov [esp+4], esi |
193 | |
188 | lea esi, [esp+.sx1] |
194 | mov [esp+4], esi |
189 | mov [esp], esi |
195 | lea esi, [esp+.sx1] |
190 | call block_clip |
196 | mov [esp], esi |
191 | 197 | call block_clip |
|
192 | mov esi, 1 |
198 | |
193 | test eax, eax |
199 | mov esi, 1 |
194 | jne .L28 |
200 | test eax, eax |
195 | 201 | jne .L28 |
|
196 | mov edi, [esp+.sx0] |
202 | |
197 | mov edx, [ebx+BLITTER.dst_x] |
203 | mov edi, [esp+.sx0] |
198 | add edx, edi |
204 | mov edx, [ebx+BLITTER.dst_x] |
199 | sub edx, [ebx+BLITTER.src_x] |
205 | add edx, edi |
200 | mov [esp+.dx0], edx |
206 | sub edx, [ebx+BLITTER.src_x] |
201 | 207 | mov [esp+.dx0], edx |
|
202 | mov ecx, [esp+.sy0] |
208 | |
203 | mov eax, [ebx+BLITTER.dst_y] |
209 | mov ecx, [esp+.sy0] |
204 | add eax, ecx |
210 | mov eax, [ebx+BLITTER.dst_y] |
205 | sub eax, [ebx+BLITTER.src_y] |
211 | add eax, ecx |
206 | mov [esp+.dy0], eax |
212 | sub eax, [ebx+BLITTER.src_y] |
207 | sub edx, edi |
213 | mov [esp+.dy0], eax |
208 | add edx, [esp+.sx1] |
214 | sub edx, edi |
209 | mov [esp+.dx1], edx |
215 | add edx, [esp+.sx1] |
210 | 216 | mov [esp+.dx1], edx |
|
211 | sub eax, ecx |
217 | |
212 | add eax, [esp+.sy1] |
218 | sub eax, ecx |
213 | mov [esp+.dy1], eax |
219 | add eax, [esp+.sy1] |
214 | 220 | mov [esp+.dy1], eax |
|
215 | lea ecx, [esp+.dy0] |
221 | |
216 | lea edx, [esp+.dx0] |
222 | lea ecx, [esp+.dy0] |
217 | lea eax, [esp+.dy1] |
223 | lea edx, [esp+.dx0] |
218 | mov [esp+4], eax |
224 | lea eax, [esp+.dy1] |
219 | lea eax, [esp+.dx1] |
225 | mov [esp+4], eax |
220 | mov [esp], eax |
226 | lea eax, [esp+.dx1] |
221 | mov eax, ebx |
227 | mov [esp], eax |
222 | call block_clip |
228 | mov eax, ebx |
223 | test eax, eax |
229 | call block_clip |
224 | jne .L28 |
230 | test eax, eax |
225 | 231 | jne .L28 |
|
226 | mov edx, [esp+.dx0] |
232 | |
227 | mov eax, [esp+.dx1] |
233 | mov edx, [esp+.dx0] |
228 | inc eax |
234 | mov eax, [esp+.dx1] |
229 | sub eax, edx |
235 | inc eax |
230 | mov [ebx+BLITTER.w], eax |
236 | sub eax, edx |
231 | 237 | mov [ebx+BLITTER.w], eax |
|
232 | mov eax, [esp+.dy0] |
238 | |
233 | mov ecx, [esp+.dy1] |
239 | mov eax, [esp+.dy0] |
234 | inc ecx |
240 | mov ecx, [esp+.dy1] |
235 | sub ecx, eax |
241 | inc ecx |
236 | mov [ebx+BLITTER.h], ecx |
242 | sub ecx, eax |
237 | 243 | mov [ebx+BLITTER.h], ecx |
|
238 | mov ecx, [ebx+BLITTER.src_x] |
244 | |
239 | add ecx, edx |
245 | mov ecx, [ebx+BLITTER.src_x] |
240 | sub ecx, [ebx+BLITTER.dst_x] |
246 | add ecx, edx |
241 | mov [ebx+BLITTER.src_x], ecx |
247 | sub ecx, [ebx+BLITTER.dst_x] |
242 | 248 | mov [ebx+BLITTER.src_x], ecx |
|
243 | mov ecx, [ebx+BLITTER.src_y] |
249 | |
244 | add ecx, eax |
250 | mov ecx, [ebx+BLITTER.src_y] |
245 | sub ecx, [ebx+BLITTER.dst_y] |
251 | add ecx, eax |
246 | mov [ebx+BLITTER.src_y], ecx |
252 | sub ecx, [ebx+BLITTER.dst_y] |
247 | mov [ebx+BLITTER.dst_x], edx |
253 | mov [ebx+BLITTER.src_y], ecx |
248 | mov [ebx+BLITTER.dst_y], eax |
254 | mov [ebx+BLITTER.dst_x], edx |
249 | xor esi, esi |
255 | mov [ebx+BLITTER.dst_y], eax |
250 | .L28: |
256 | xor esi, esi |
251 | mov eax, esi |
257 | .L28: |
252 | add esp, 40 |
258 | mov eax, esi |
253 | pop ebx |
259 | add esp, 40 |
254 | pop esi |
260 | pop ebx |
255 | pop edi |
261 | pop esi |
256 | 262 | pop edi |
|
257 | 263 | ||
258 | purge .sx0 |
264 | |
259 | purge .sy0 |
265 | purge .sx0 |
260 | purge .sx1 |
266 | purge .sy0 |
261 | purge .sy1 |
267 | purge .sx1 |
262 | 268 | purge .sy1 |
|
263 | purge .dx0 |
269 | |
264 | purge .dy0 |
270 | purge .dx0 |
265 | purge .dx1 |
271 | purge .dy0 |
266 | purge .dy1 |
272 | purge .dx1 |
267 | 273 | purge .dy1 |
|
268 | ret |
274 | |
269 | 275 | ret |
|
270 | 276 | ||
271 | 277 | ||
272 | align 4 |
278 | |
273 | 279 | align 4 |
|
274 | blit_32: |
280 | |
275 | push ebp |
281 | blit_32: |
276 | push edi |
282 | push ebp |
277 | push esi |
283 | push edi |
278 | push ebx |
284 | push esi |
279 | sub esp, 72 |
285 | push ebx |
280 | 286 | sub esp, 72 |
|
281 | mov eax, [TASK_BASE] |
287 | |
282 | mov ebx, [eax-twdw + WDATA.box.width] |
288 | mov eax, [TASK_BASE] |
283 | mov edx, [eax-twdw + WDATA.box.height] |
289 | mov ebx, [eax-twdw + WDATA.box.width] |
284 | 290 | mov edx, [eax-twdw + WDATA.box.height] |
|
285 | xor eax, eax |
291 | |
286 | 292 | xor eax, eax |
|
287 | mov [esp+BLITTER.dc.xmin], eax |
293 | |
288 | mov [esp+BLITTER.dc.ymin], eax |
294 | mov [esp+BLITTER.dc.xmin], eax |
289 | mov [esp+BLITTER.dc.xmax], ebx |
295 | mov [esp+BLITTER.dc.ymin], eax |
290 | mov [esp+BLITTER.dc.ymax], edx |
296 | mov [esp+BLITTER.dc.xmax], ebx |
291 | 297 | mov [esp+BLITTER.dc.ymax], edx |
|
292 | mov [esp+BLITTER.sc.xmin], eax |
298 | |
293 | mov [esp+BLITTER.sc.ymin], eax |
299 | mov [esp+BLITTER.sc.xmin], eax |
294 | mov eax, [ecx+24] |
300 | mov [esp+BLITTER.sc.ymin], eax |
295 | dec eax |
301 | mov eax, [ecx+24] |
296 | mov [esp+BLITTER.sc.xmax], eax |
302 | dec eax |
297 | mov eax, [ecx+28] |
303 | mov [esp+BLITTER.sc.xmax], eax |
298 | dec eax |
304 | mov eax, [ecx+28] |
299 | mov [esp+BLITTER.sc.ymax], eax |
305 | dec eax |
300 | 306 | mov [esp+BLITTER.sc.ymax], eax |
|
301 | mov eax, [ecx] |
307 | |
302 | mov [esp+BLITTER.dst_x], eax |
308 | mov eax, [ecx] |
303 | mov eax, [ecx+4] |
309 | mov [esp+BLITTER.dst_x], eax |
304 | mov [esp+BLITTER.dst_y], eax |
310 | mov eax, [ecx+4] |
305 | 311 | mov [esp+BLITTER.dst_y], eax |
|
306 | mov eax, [ecx+16] |
312 | |
307 | mov [esp+BLITTER.src_x], eax |
313 | mov eax, [ecx+16] |
308 | mov eax, [ecx+20] |
314 | mov [esp+BLITTER.src_x], eax |
309 | mov [esp+BLITTER.src_y], eax |
315 | mov eax, [ecx+20] |
310 | mov eax, [ecx+8] |
316 | mov [esp+BLITTER.src_y], eax |
311 | mov [esp+BLITTER.w], eax |
317 | mov eax, [ecx+8] |
312 | mov eax, [ecx+12] |
318 | mov [esp+BLITTER.w], eax |
313 | mov [esp+BLITTER.h], eax |
319 | mov eax, [ecx+12] |
314 | 320 | mov [esp+BLITTER.h], eax |
|
315 | 321 | ||
316 | mov eax, [ecx+32] |
322 | |
317 | mov [esp+56], eax |
323 | mov eax, [ecx+32] |
318 | mov eax, [ecx+36] |
324 | mov [esp+56], eax |
319 | mov [esp+60], eax |
325 | mov eax, [ecx+36] |
320 | 326 | mov [esp+60], eax |
|
321 | mov ecx, esp |
327 | |
322 | call blit_clip |
328 | mov ecx, esp |
323 | test eax, eax |
329 | call blit_clip |
324 | jne .L57 |
330 | test eax, eax |
325 | 331 | jne .L57 |
|
326 | mov eax, [TASK_BASE] |
332 | |
327 | 333 | mov eax, [TASK_BASE] |
|
328 | mov ebx, [esp+BLITTER.dst_x] |
334 | |
329 | mov ebp, [esp+BLITTER.dst_y] |
335 | mov ebx, [esp+BLITTER.dst_x] |
330 | add ebx, [eax-twdw + WDATA.box.left] |
336 | mov ebp, [esp+BLITTER.dst_y] |
331 | add ebp, [eax-twdw + WDATA.box.top] |
337 | add ebx, [eax-twdw + WDATA.box.left] |
332 | 338 | add ebp, [eax-twdw + WDATA.box.top] |
|
333 | mov ecx, ebx |
339 | |
334 | add ecx, [esp+BLITTER.w] |
340 | mov ecx, ebx |
335 | shl ecx, 16 |
341 | add ecx, [esp+BLITTER.w] |
336 | mov cx, bp |
342 | shl ecx, 16 |
337 | add ecx, [esp+BLITTER.h] |
343 | mov cx, bp |
338 | 344 | add ecx, [esp+BLITTER.h] |
|
339 | mov edi, ebp |
345 | |
340 | 346 | mov edi, ebp |
|
341 | imul edi, [_display.pitch] |
347 | |
342 | ; imul ebp, [_display.width] |
348 | imul edi, [_display.pitch] |
343 | mov ebp, [d_width_calc_area + ebp*4] |
349 | ; imul ebp, [_display.width] |
344 | 350 | mov ebp, [d_width_calc_area + ebp*4] |
|
345 | add ebp, ebx |
351 | |
346 | add ebp, [_WinMapAddress] |
352 | add ebp, ebx |
347 | 353 | add ebp, [_WinMapAddress] |
|
348 | mov eax, [esp+BLITTER.src_y] |
354 | |
349 | imul eax, [esp+BLITTER.stride] |
355 | mov eax, [esp+BLITTER.src_y] |
350 | mov esi, [esp+BLITTER.src_x] |
356 | imul eax, [esp+BLITTER.stride] |
351 | lea esi, [eax+esi*4] |
357 | mov esi, [esp+BLITTER.src_x] |
352 | add esi, [esp+BLITTER.bitmap] |
358 | lea esi, [eax+esi*4] |
353 | 359 | add esi, [esp+BLITTER.bitmap] |
|
354 | mov eax, ecx |
360 | |
355 | mov ecx, [esp+BLITTER.h] |
361 | mov eax, ecx |
356 | mov edx, [esp+BLITTER.w] |
362 | mov ecx, [esp+BLITTER.h] |
357 | 363 | mov edx, [esp+BLITTER.w] |
|
358 | test ecx, ecx ;FIXME check clipping |
364 | |
359 | jz .L57 |
365 | test ecx, ecx ;FIXME check clipping |
360 | 366 | jz .L57 |
|
361 | test edx, edx |
367 | |
362 | jz .L57 |
368 | test edx, edx |
363 | 369 | jz .L57 |
|
364 | cmp [_display.bpp], 32 |
370 | |
365 | jne .core_24 |
371 | cmp [_display.bpp], 32 |
366 | 372 | jne .core_24 |
|
367 | lea edi, [edi+ebx*4] |
373 | |
368 | 374 | lea edi, [edi+ebx*4] |
|
369 | mov ebx, [CURRENT_TASK] |
375 | |
370 | align 4 |
376 | mov ebx, [CURRENT_TASK] |
371 | .outer32: |
377 | align 4 |
372 | xor ecx, ecx |
378 | .outer32: |
373 | 379 | xor ecx, ecx |
|
374 | align 4 |
380 | |
375 | .inner32: |
381 | align 4 |
376 | cmp [ebp+ecx], bl |
382 | .inner32: |
377 | jne .skip |
383 | cmp [ebp+ecx], bl |
378 | ;-------------------------------------- |
384 | jne .skip |
379 | push eax |
385 | ;-------------------------------------- |
380 | mov eax, [esi+ecx*4] |
386 | push eax |
381 | 387 | mov eax, [esi+ecx*4] |
|
382 | ; check for hardware cursor |
388 | |
383 | cmp [_display.select_cursor], select_cursor |
389 | ; check for hardware cursor |
384 | je @f |
390 | cmp [_display.select_cursor], select_cursor |
385 | cmp [_display.select_cursor], 0 |
391 | je @f |
386 | jne .no_mouseunder |
392 | cmp [_display.select_cursor], 0 |
387 | ;-------------------------------------- |
393 | jne .no_mouseunder |
388 | align 4 |
394 | ;-------------------------------------- |
389 | @@: |
395 | align 4 |
390 | push ecx |
396 | @@: |
391 | 397 | push ecx |
|
392 | mov ecx, [esp+4] |
398 | |
393 | ror ecx, 16 |
399 | mov ecx, [esp+4] |
394 | sub ecx, edx |
400 | ror ecx, 16 |
395 | rol ecx, 16 |
401 | sub ecx, edx |
396 | sub ecx, [esp+BLITTER.h + 8] |
402 | rol ecx, 16 |
397 | 403 | sub ecx, [esp+BLITTER.h + 8] |
|
398 | ; check mouse area for putpixel |
404 | |
399 | call [_display.check_mouse] |
405 | ; check mouse area for putpixel |
400 | pop ecx |
406 | call [_display.check_mouse] |
401 | ;-------------------------------------- |
407 | pop ecx |
402 | align 4 |
408 | ;-------------------------------------- |
403 | .no_mouseunder: |
409 | align 4 |
404 | ; store to real LFB |
410 | .no_mouseunder: |
405 | mov [LFB_BASE+edi+ecx*4], eax |
411 | ; store to real LFB |
406 | pop eax |
412 | mov [LFB_BASE+edi+ecx*4], eax |
407 | ;-------------------------------------- |
413 | pop eax |
408 | align 4 |
414 | ;-------------------------------------- |
409 | .skip: |
415 | align 4 |
410 | inc ecx |
416 | .skip: |
411 | dec edx |
417 | inc ecx |
412 | jnz .inner32 |
418 | dec edx |
413 | 419 | jnz .inner32 |
|
414 | add esi, [esp+BLITTER.stride] |
420 | |
415 | add edi, [_display.pitch] |
421 | add esi, [esp+BLITTER.stride] |
416 | add ebp, [_display.width] |
422 | add edi, [_display.pitch] |
417 | 423 | add ebp, [_display.width] |
|
418 | mov edx, [esp+BLITTER.w] |
424 | |
419 | dec [esp+BLITTER.h] |
425 | mov edx, [esp+BLITTER.w] |
420 | jnz .outer32 |
426 | dec [esp+BLITTER.h] |
421 | 427 | jnz .outer32 |
|
422 | .done: |
428 | |
423 | ; call [draw_pointer] |
429 | .done: |
424 | call __sys_draw_pointer |
430 | ; call [draw_pointer] |
425 | .L57: |
431 | call __sys_draw_pointer |
426 | add esp, 72 |
432 | .L57: |
427 | pop ebx |
433 | add esp, 72 |
428 | pop esi |
434 | pop ebx |
429 | pop edi |
435 | pop esi |
430 | pop ebp |
436 | pop edi |
431 | ret |
437 | pop ebp |
432 | 438 | ret |
|
433 | .core_24: |
439 | |
434 | lea ebx, [ebx+ebx*2] |
440 | .core_24: |
435 | lea edi, [LFB_BASE+edi+ebx] |
441 | lea ebx, [ebx+ebx*2] |
436 | mov ebx, [CURRENT_TASK] |
442 | lea edi, [LFB_BASE+edi+ebx] |
437 | 443 | mov ebx, [CURRENT_TASK] |
|
438 | align 4 |
444 | |
439 | .outer24: |
445 | align 4 |
440 | mov [esp+64], edi |
446 | .outer24: |
441 | xor ecx, ecx |
447 | mov [esp+64], edi |
442 | 448 | xor ecx, ecx |
|
443 | align 4 |
449 | |
444 | .inner24: |
450 | align 4 |
445 | cmp [ebp+ecx], bl |
451 | .inner24: |
446 | jne .skip_1 |
452 | cmp [ebp+ecx], bl |
447 | ;-------------------------------------- |
453 | jne .skip_1 |
448 | push eax |
454 | ;-------------------------------------- |
449 | mov eax, [esi+ecx*4] |
455 | push eax |
450 | 456 | mov eax, [esi+ecx*4] |
|
451 | lea edi, [edi+ecx*2] |
457 | |
452 | 458 | lea edi, [edi+ecx*2] |
|
453 | ; check for hardware cursor |
459 | |
454 | cmp [_display.select_cursor], select_cursor |
460 | ; check for hardware cursor |
455 | je @f |
461 | cmp [_display.select_cursor], select_cursor |
456 | cmp [_display.select_cursor], 0 |
462 | je @f |
457 | jne .no_mouseunder_1 |
463 | cmp [_display.select_cursor], 0 |
458 | ;-------------------------------------- |
464 | jne .no_mouseunder_1 |
459 | align 4 |
465 | ;-------------------------------------- |
460 | @@: |
466 | align 4 |
461 | push ecx |
467 | @@: |
462 | 468 | push ecx |
|
463 | mov ecx, [esp+4] |
469 | |
464 | ror ecx, 16 |
470 | mov ecx, [esp+4] |
465 | sub ecx, edx |
471 | ror ecx, 16 |
466 | rol ecx, 16 |
472 | sub ecx, edx |
467 | sub ecx, [esp+BLITTER.h + 8] |
473 | rol ecx, 16 |
468 | 474 | sub ecx, [esp+BLITTER.h + 8] |
|
469 | ; check mouse area for putpixel |
475 | |
470 | call [_display.check_mouse] |
476 | ; check mouse area for putpixel |
471 | pop ecx |
477 | call [_display.check_mouse] |
472 | ;-------------------------------------- |
478 | pop ecx |
473 | align 4 |
479 | ;-------------------------------------- |
474 | .no_mouseunder_1: |
480 | align 4 |
475 | mov [edi+ecx], ax |
481 | .no_mouseunder_1: |
476 | shr eax, 16 |
482 | mov [edi+ecx], ax |
477 | mov [edi+ecx+2], al |
483 | shr eax, 16 |
478 | 484 | mov [edi+ecx+2], al |
|
479 | pop eax |
485 | |
480 | ;-------------------------------------- |
486 | pop eax |
481 | align 4 |
487 | ;-------------------------------------- |
482 | .skip_1: |
488 | align 4 |
483 | mov edi, [esp+64] |
489 | .skip_1: |
484 | inc ecx |
490 | mov edi, [esp+64] |
485 | dec edx |
491 | inc ecx |
486 | jnz .inner24 |
492 | dec edx |
487 | 493 | jnz .inner24 |
|
488 | add esi, [esp+BLITTER.stride] |
494 | |
489 | add edi, [_display.pitch] |
495 | add esi, [esp+BLITTER.stride] |
490 | add ebp, [_display.width] |
496 | add edi, [_display.pitch] |
491 | 497 | add ebp, [_display.width] |
|
492 | mov edx, [esp+BLITTER.w] |
498 | |
493 | dec [esp+BLITTER.h] |
499 | mov edx, [esp+BLITTER.w] |
494 | jnz .outer24 |
500 | dec [esp+BLITTER.h] |
495 | 501 | jnz .outer24 |
|
496 | jmp .done |
502 | |
- | 503 | jmp .done |