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