Rev 2384 | Rev 2446 | 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] |
343 | add ebp, ebx |
||
344 | add ebp, [_WinMapAddress] |
||
345 | |||
1894 | serge | 346 | |
2288 | clevermous | 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 | |||
1894 | serge | 352 | |
2430 | mario79 | 353 | mov ecx, [esp+BLITTER.h] |
2288 | clevermous | 354 | mov edx, [esp+BLITTER.w] |
355 | |||
1894 | serge | 356 | |
2288 | clevermous | 357 | jz .L57 |
358 | |||
1894 | serge | 359 | |
2288 | clevermous | 360 | jz .L57 |
361 | |||
1894 | serge | 362 | |
2288 | clevermous | 363 | jne .core_24 |
364 | |||
1894 | serge | 365 | |
2288 | clevermous | 366 | |
1894 | serge | 367 | |
2288 | clevermous | 368 | align 4 |
1894 | serge | 369 | .outer32: |
370 | xor ecx, ecx |
||
2288 | clevermous | 371 | |
1894 | serge | 372 | |
373 | .inner32: |
||
374 | cmp [ebp+ecx], bl |
||
2288 | clevermous | 375 | jne @F |
376 | ;-------------------------------------- |
||
2430 | mario79 | 377 | push eax |
378 | mov eax, [esi+ecx*4] |
||
379 | |||
1894 | serge | 380 | |
2430 | mario79 | 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 |
||
2288 | clevermous | 393 | pop eax |
2430 | mario79 | 394 | ;-------------------------------------- |
395 | align 4 |
||
396 | @@: |
||
1894 | serge | 397 | inc ecx |
2288 | clevermous | 398 | dec edx |
399 | jnz .inner32 |
||
400 | |||
1894 | serge | 401 | |
2288 | clevermous | 402 | add edi, [_display.pitch] |
403 | add ebp, [_display.width] |
||
404 | |||
1894 | serge | 405 | |
2288 | clevermous | 406 | dec [esp+BLITTER.h] |
407 | jnz .outer32 |
||
408 | |||
1894 | serge | 409 | |
410 | call [draw_pointer] |
||
2288 | clevermous | 411 | .L57: |
1894 | serge | 412 | add esp, 72 |
2288 | clevermous | 413 | pop ebx |
414 | pop esi |
||
415 | pop edi |
||
416 | pop ebp |
||
417 | ret |
||
1894 | serge | 418 | |
419 | |||
420 | lea ebx, [ebx+ebx*2] |
||
2288 | clevermous | 421 | lea edi, [LFB_BASE+edi+ebx] |
422 | mov ebx, [CURRENT_TASK] |
||
423 | |||
1894 | serge | 424 | |
425 | .outer24: |
||
426 | mov [esp+64], edi |
||
2288 | clevermous | 427 | xor ecx, ecx |
428 | |||
1894 | serge | 429 | |
430 | .inner24: |
||
431 | cmp [ebp+ecx], bl |
||
2288 | clevermous | 432 | jne @F |
433 | ;-------------------------------------- |
||
2430 | mario79 | 434 | push eax |
435 | mov eax, [esi+ecx*4] |
||
2288 | clevermous | 436 | |
1894 | serge | 437 | |
2288 | clevermous | 438 | |
2430 | mario79 | 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 | |||
2288 | clevermous | 452 | shr eax, 16 |
453 | mov [edi+ecx+2], al |
||
454 | |||
2430 | mario79 | 455 | |
456 | ;-------------------------------------- |
||
457 | align 4 |
||
458 | @@: |
||
1894 | serge | 459 | mov edi, [esp+64] |
2288 | clevermous | 460 | inc ecx |
461 | dec edx |
||
462 | jnz .inner24 |
||
463 | |||
1894 | serge | 464 | |
2288 | clevermous | 465 | add edi, [_display.pitch] |
466 | add ebp, [_display.width] |
||
467 | |||
1894 | serge | 468 | |
2288 | clevermous | 469 | dec [esp+BLITTER.h] |
470 | jnz .outer24 |
||
471 | |||
1894 | serge | 472 | |
2288 | clevermous | 473 |