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