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