Rev 2448 | Rev 2451 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1894 | serge | 1 | |
2384 | hidnplayr | 2 | xmin dd ? |
3 | ymin dd ? |
||
4 | xmax dd ? |
||
5 | ymax dd ? |
||
6 | ends |
||
7 | |||
1894 | serge | 8 | |
9 | |||
2384 | hidnplayr | 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 | |||
1894 | serge | 19 | |
2384 | hidnplayr | 20 | stride dd ? ; 60 |
21 | ends |
||
22 | |||
1894 | serge | 23 | |
24 | |||
25 | |||
26 | |||
27 | push ebx |
||
2288 | clevermous | 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: |
||
1894 | serge | 36 | cmp ecx, [eax+4] |
2288 | clevermous | 37 | jge .L3 |
38 | or ebx, 1 |
||
39 | jmp .L4 |
||
40 | |||
1894 | serge | 41 | |
42 | cmp ecx, [eax+12] |
||
2288 | clevermous | 43 | jle .L4 |
44 | or ebx, 2 |
||
45 | .L4: |
||
1894 | serge | 46 | mov eax, ebx |
2288 | clevermous | 47 | pop ebx |
48 | ret |
||
1894 | serge | 49 | |
50 | |||
51 | block_clip: |
||
52 | push ebp |
||
2288 | clevermous | 53 | push edi |
54 | push esi |
||
55 | push ebx |
||
56 | sub esp, 4 |
||
57 | |||
1894 | serge | 58 | |
2288 | clevermous | 59 | mov [esp], edx |
60 | mov ebp, ecx |
||
61 | mov ecx, [ecx] |
||
62 | mov edx, [edx] |
||
63 | call __L1OutCode |
||
64 | |||
1894 | serge | 65 | |
2288 | clevermous | 66 | mov edx, [esp+28] |
67 | mov ecx, [edx] |
||
68 | .L21: |
||
1894 | serge | 69 | mov eax, [esp+24] |
2288 | clevermous | 70 | mov edx, [eax] |
71 | mov eax, ebx |
||
72 | call __L1OutCode |
||
73 | |||
1894 | serge | 74 | |
2288 | clevermous | 75 | .L20: |
1894 | serge | 76 | mov eax, edi |
2288 | clevermous | 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: |
||
1894 | serge | 88 | test edi, 2 |
2288 | clevermous | 89 | je .L13 |
90 | mov eax, [ebx+12] |
||
91 | .L25: |
||
1894 | serge | 92 | mov edx, [esp+28] |
2288 | clevermous | 93 | jmp .L22 |
94 | .L13: |
||
1894 | serge | 95 | test edi, 4 |
2288 | clevermous | 96 | je .L14 |
97 | mov eax, [ebx+8] |
||
98 | jmp .L26 |
||
99 | .L14: |
||
1894 | serge | 100 | and edi, 8 |
2288 | clevermous | 101 | je .L12 |
102 | mov eax, [ebx] |
||
103 | .L26: |
||
1894 | serge | 104 | mov edx, [esp+24] |
2288 | clevermous | 105 | .L22: |
1894 | serge | 106 | mov [edx], eax |
2288 | clevermous | 107 | .L12: |
1894 | serge | 108 | mov eax, [esp+28] |
2288 | clevermous | 109 | mov ecx, [eax] |
110 | jmp .L21 |
||
111 | .L10: |
||
1894 | serge | 112 | test esi, 1 |
2288 | clevermous | 113 | je .L16 |
114 | mov eax, [ebx+4] |
||
115 | jmp .L23 |
||
116 | .L16: |
||
1894 | serge | 117 | test esi, 2 |
2288 | clevermous | 118 | je .L18 |
119 | mov eax, [ebx+12] |
||
120 | .L23: |
||
1894 | serge | 121 | mov [ebp+0], eax |
2288 | clevermous | 122 | jmp .L17 |
123 | .L18: |
||
1894 | serge | 124 | test esi, 4 |
2288 | clevermous | 125 | je .L19 |
126 | mov eax, [ebx+8] |
||
127 | jmp .L24 |
||
128 | .L19: |
||
1894 | serge | 129 | and esi, 8 |
2288 | clevermous | 130 | je .L17 |
131 | mov eax, [ebx] |
||
132 | .L24: |
||
1894 | serge | 133 | mov edx, [esp] |
2288 | clevermous | 134 | mov [edx], eax |
135 | .L17: |
||
1894 | serge | 136 | mov ecx, [ebp+0] |
2288 | clevermous | 137 | mov eax, [esp] |
138 | mov edx, [eax] |
||
139 | mov eax, ebx |
||
140 | call __L1OutCode |
||
141 | mov esi, eax |
||
142 | jmp .L20 |
||
143 | .L9: |
||
1894 | serge | 144 | add esp, 4 |
2288 | clevermous | 145 | pop ebx |
146 | pop esi |
||
147 | pop edi |
||
148 | pop ebp |
||
149 | ret |
||
1894 | serge | 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 | |||
2288 | clevermous | 166 | push esi |
167 | push ebx |
||
168 | sub esp, 40 |
||
169 | |||
1894 | serge | 170 | |
2288 | clevermous | 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 | |||
1894 | serge | 182 | |
2288 | clevermous | 183 | lea edx, [esp+.sx0] |
184 | lea eax, [ebx+BLITTER.sc] |
||
185 | lea esi, [esp+.sy1] |
||
186 | |||
1894 | serge | 187 | |
2288 | clevermous | 188 | lea esi, [esp+.sx1] |
189 | mov [esp], esi |
||
190 | call block_clip |
||
191 | |||
1894 | serge | 192 | |
2288 | clevermous | 193 | test eax, eax |
194 | jne .L28 |
||
195 | |||
1894 | serge | 196 | |
2288 | clevermous | 197 | mov edx, [ebx+BLITTER.dst_x] |
198 | add edx, edi |
||
199 | sub edx, [ebx+BLITTER.src_x] |
||
200 | mov [esp+.dx0], edx |
||
201 | |||
1894 | serge | 202 | |
2288 | clevermous | 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 | |||
1894 | serge | 211 | |
2288 | clevermous | 212 | add eax, [esp+.sy1] |
213 | mov [esp+.dy1], eax |
||
214 | |||
1894 | serge | 215 | |
2288 | clevermous | 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 | |||
1894 | serge | 226 | |
2288 | clevermous | 227 | mov eax, [esp+.dx1] |
228 | inc eax |
||
229 | sub eax, edx |
||
230 | mov [ebx+BLITTER.w], eax |
||
231 | |||
1894 | serge | 232 | |
2288 | clevermous | 233 | mov ecx, [esp+.dy1] |
234 | inc ecx |
||
235 | sub ecx, eax |
||
236 | mov [ebx+BLITTER.h], ecx |
||
237 | |||
1894 | serge | 238 | |
2288 | clevermous | 239 | add ecx, edx |
240 | sub ecx, [ebx+BLITTER.dst_x] |
||
241 | mov [ebx+BLITTER.src_x], ecx |
||
242 | |||
1894 | serge | 243 | |
2288 | clevermous | 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: |
||
1894 | serge | 251 | mov eax, esi |
2288 | clevermous | 252 | add esp, 40 |
253 | pop ebx |
||
254 | pop esi |
||
255 | pop edi |
||
256 | |||
1894 | serge | 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 |
||
2288 | clevermous | 276 | push edi |
277 | push esi |
||
278 | push ebx |
||
279 | sub esp, 72 |
||
280 | |||
1894 | serge | 281 | |
2288 | clevermous | 282 | mov ebx, [eax-twdw + WDATA.box.width] |
283 | mov edx, [eax-twdw + WDATA.box.height] |
||
284 | |||
1894 | serge | 285 | |
2288 | clevermous | 286 | |
1894 | serge | 287 | |
2288 | clevermous | 288 | mov [esp+BLITTER.dc.ymin], eax |
289 | mov [esp+BLITTER.dc.xmax], ebx |
||
290 | mov [esp+BLITTER.dc.ymax], edx |
||
291 | |||
1894 | serge | 292 | |
2288 | clevermous | 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 | |||
1894 | serge | 301 | |
2288 | clevermous | 302 | mov [esp+BLITTER.dst_x], eax |
303 | mov eax, [ecx+4] |
||
304 | mov [esp+BLITTER.dst_y], eax |
||
305 | |||
1894 | serge | 306 | |
2288 | clevermous | 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 | |||
1894 | serge | 315 | |
316 | |||
2288 | clevermous | 317 | mov [esp+56], eax |
318 | mov eax, [ecx+36] |
||
319 | mov [esp+60], eax |
||
320 | |||
1894 | serge | 321 | |
2288 | clevermous | 322 | call blit_clip |
323 | test eax, eax |
||
324 | jne .L57 |
||
325 | |||
1894 | serge | 326 | |
2288 | clevermous | 327 | |
1894 | serge | 328 | |
2288 | clevermous | 329 | mov ebp, [esp+BLITTER.dst_y] |
330 | add ebx, [eax-twdw + WDATA.box.left] |
||
331 | add ebp, [eax-twdw + WDATA.box.top] |
||
332 | |||
2430 | mario79 | 333 | |
334 | add ecx, [esp+BLITTER.w] |
||
335 | shl ecx, 16 |
||
336 | mov cx, bp |
||
337 | add ecx, [esp+BLITTER.h] |
||
338 | |||
339 | |||
2288 | clevermous | 340 | |
1894 | serge | 341 | |
2288 | clevermous | 342 | ; imul ebp, [_display.width] |
2446 | mario79 | 343 | mov ebp, [d_width_calc_area + ebp*4] |
344 | |||
345 | |||
2288 | clevermous | 346 | add ebp, [_WinMapAddress] |
347 | |||
1894 | serge | 348 | |
2288 | clevermous | 349 | imul eax, [esp+BLITTER.stride] |
350 | mov esi, [esp+BLITTER.src_x] |
||
351 | lea esi, [eax+esi*4] |
||
352 | add esi, [esp+BLITTER.bitmap] |
||
353 | |||
1894 | serge | 354 | |
2430 | mario79 | 355 | mov ecx, [esp+BLITTER.h] |
2288 | clevermous | 356 | mov edx, [esp+BLITTER.w] |
357 | |||
1894 | serge | 358 | |
2288 | clevermous | 359 | jz .L57 |
360 | |||
1894 | serge | 361 | |
2288 | clevermous | 362 | jz .L57 |
363 | |||
1894 | serge | 364 | |
2288 | clevermous | 365 | jne .core_24 |
366 | |||
1894 | serge | 367 | |
2288 | clevermous | 368 | |
1894 | serge | 369 | |
2288 | clevermous | 370 | align 4 |
1894 | serge | 371 | .outer32: |
372 | xor ecx, ecx |
||
2288 | clevermous | 373 | |
1894 | serge | 374 | |
375 | .inner32: |
||
376 | cmp [ebp+ecx], bl |
||
2288 | clevermous | 377 | jne .skip |
2449 | mario79 | 378 | ;-------------------------------------- |
2430 | mario79 | 379 | push eax |
380 | mov eax, [esi+ecx*4] |
||
381 | |||
1894 | serge | 382 | |
2448 | mario79 | 383 | cmp [_display.select_cursor], 0 |
384 | je @f |
||
385 | cmp [_display.select_cursor], select_cursor |
||
386 | jne .no_mouseunder |
||
387 | ;-------------------------------------- |
||
388 | align 4 |
||
389 | @@: |
||
390 | push ecx |
||
2430 | mario79 | 391 | |
392 | |||
393 | ror ecx, 16 |
||
394 | sub ecx, edx |
||
395 | rol ecx, 16 |
||
396 | sub ecx, [esp+BLITTER.h + 8] |
||
397 | |||
398 | |||
399 | call [_display.check_mouse] |
||
400 | pop ecx |
||
401 | ;-------------------------------------- |
||
2448 | mario79 | 402 | align 4 |
403 | .no_mouseunder: |
||
404 | ; store to real LFB |
||
2430 | mario79 | 405 | mov [LFB_BASE+edi+ecx*4], eax |
2288 | clevermous | 406 | pop eax |
2430 | mario79 | 407 | ;-------------------------------------- |
408 | align 4 |
||
409 | .skip: |
||
2449 | mario79 | 410 | inc ecx |
2288 | clevermous | 411 | dec edx |
412 | jnz .inner32 |
||
413 | |||
1894 | serge | 414 | |
2288 | clevermous | 415 | add edi, [_display.pitch] |
416 | add ebp, [_display.width] |
||
417 | |||
1894 | serge | 418 | |
2288 | clevermous | 419 | dec [esp+BLITTER.h] |
420 | jnz .outer32 |
||
421 | |||
1894 | serge | 422 | |
423 | call [draw_pointer] |
||
2288 | clevermous | 424 | .L57: |
1894 | serge | 425 | add esp, 72 |
2288 | clevermous | 426 | pop ebx |
427 | pop esi |
||
428 | pop edi |
||
429 | pop ebp |
||
430 | ret |
||
1894 | serge | 431 | |
432 | |||
433 | lea ebx, [ebx+ebx*2] |
||
2288 | clevermous | 434 | lea edi, [LFB_BASE+edi+ebx] |
435 | mov ebx, [CURRENT_TASK] |
||
436 | |||
1894 | serge | 437 | |
438 | .outer24: |
||
439 | mov [esp+64], edi |
||
2288 | clevermous | 440 | xor ecx, ecx |
441 | |||
1894 | serge | 442 | |
443 | .inner24: |
||
444 | cmp [ebp+ecx], bl |
||
2288 | clevermous | 445 | jne .skip_1 |
2449 | mario79 | 446 | ;-------------------------------------- |
2430 | mario79 | 447 | push eax |
448 | mov eax, [esi+ecx*4] |
||
2288 | clevermous | 449 | |
1894 | serge | 450 | |
2288 | clevermous | 451 | |
2430 | mario79 | 452 | |
2448 | mario79 | 453 | cmp [_display.select_cursor], 0 |
454 | je @f |
||
455 | cmp [_display.select_cursor], select_cursor |
||
456 | jne .no_mouseunder_1 |
||
457 | ;-------------------------------------- |
||
458 | align 4 |
||
459 | @@: |
||
460 | push ecx |
||
2430 | mario79 | 461 | |
462 | |||
463 | ror ecx, 16 |
||
464 | sub ecx, edx |
||
465 | rol ecx, 16 |
||
466 | sub ecx, [esp+BLITTER.h + 8] |
||
467 | |||
468 | |||
469 | call [_display.check_mouse] |
||
470 | pop ecx |
||
471 | ;-------------------------------------- |
||
2448 | mario79 | 472 | align 4 |
473 | .no_mouseunder_1: |
||
474 | mov [edi+ecx], ax |
||
2288 | clevermous | 475 | shr eax, 16 |
476 | mov [edi+ecx+2], al |
||
477 | |||
2430 | mario79 | 478 | |
479 | ;-------------------------------------- |
||
480 | align 4 |
||
481 | .skip_1: |
||
2449 | mario79 | 482 | mov edi, [esp+64] |
2288 | clevermous | 483 | inc ecx |
484 | dec edx |
||
485 | jnz .inner24 |
||
486 | |||
1894 | serge | 487 | |
2288 | clevermous | 488 | add edi, [_display.pitch] |
489 | add ebp, [_display.width] |
||
490 | |||
1894 | serge | 491 | |
2288 | clevermous | 492 | dec [esp+BLITTER.h] |
493 | jnz .outer24 |
||
494 | |||
1894 | serge | 495 | |
2288 | clevermous | 496 |