Rev 129 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
Line 17... | Line 17... | ||
17 | jif eax,e,ecx,.exit |
17 | jif eax,e,ecx,.exit |
18 | jif ebx,e,edx,.exit |
18 | jif ebx,e,edx,.exit |
Line 19... | Line 19... | ||
19 | 19 | ||
Line 20... | Line 20... | ||
20 | call get_cursor_rect |
20 | call get_cursor_rect |
21 | 21 | ||
22 | mov ebp,[0x3010] |
22 | mov ebp,[TASK_BASE] |
23 | movsx esi,word[ebp-0x3000+0] |
23 | movsx esi,word[ebp-CURRENT_TASK+0] |
24 | add eax,esi |
24 | add eax,esi |
25 | add ecx,esi |
25 | add ecx,esi |
26 | movsx esi,word[ebp-0x3000+4] |
26 | movsx esi,word[ebp-CURRENT_TASK+4] |
27 | add ebx,esi |
27 | add ebx,esi |
28 | add edx,esi |
28 | add edx,esi |
29 | ; add eax,[ebp-0x3000+0] |
29 | ; add eax,[ebp-CURRENT_TASK+0] |
30 | ; add ebx,[ebp-0x3000+4] |
30 | ; add ebx,[ebp-CURRENT_TASK+4] |
Line 31... | Line 31... | ||
31 | ; add ecx,[ebp-0x3000+0] |
31 | ; add ecx,[ebp-CURRENT_TASK+0] |
32 | ; add edx,[ebp-0x3000+4] |
32 | ; add edx,[ebp-CURRENT_TASK+4] |
33 | 33 | ||
34 | mov esi,[0x00003000] |
34 | mov esi,[CURRENT_TASK] |
35 | mov esi,[CLIP_RECTS+esi*4] |
35 | mov esi,[CLIP_RECTS+esi*4] |
36 | mov ebp,[esi] |
36 | mov ebp,[esi] |
Line 50... | Line 50... | ||
50 | mov ecx,[rr.right] |
50 | mov ecx,[rr.right] |
51 | @@: jif edx,l,[rr.bottom],@f |
51 | @@: jif edx,l,[rr.bottom],@f |
52 | mov edx,[rr.bottom] |
52 | mov edx,[rr.bottom] |
53 | @@: call is_intersect_rc |
53 | @@: call is_intersect_rc |
54 | jc .put |
54 | jc .put |
55 | cmp [mouse_invisible],0 |
55 | cmp byte[MOUSE_VISIBLE],0 |
56 | jne .put |
56 | je .put |
57 | call [SF.draw_mouse_under] |
57 | call [SF.draw_mouse_under] |
58 | mov [mouse_invisible],1 |
58 | mov byte[MOUSE_VISIBLE],0 |
59 | .put: mov ebp,[bytes_per_scanline] |
59 | .put: mov ebp,[BytesPerScanLine] |
60 | imul ebp,ebx |
60 | imul ebp,ebx |
61 | push eax |
61 | push eax |
62 | lea eax,[eax*3] |
62 | lea eax,[eax*3] |
63 | add ebp,eax |
63 | add ebp,eax |
64 | pop eax |
64 | pop eax |
65 | add ebp,[lfb_address] |
65 | add ebp,[LFBAddress] |
66 | .xxx: push eax ebp |
66 | .xxx: push eax ebp |
67 | @@: push eax |
67 | @@: push eax |
68 | mov eax,edi |
68 | mov eax,edi |
69 | mov [ebp],ax |
69 | mov [ebp],ax |
70 | shr eax,16 |
70 | shr eax,16 |
Line 73... | Line 73... | ||
73 | add ebp,3 |
73 | add ebp,3 |
74 | inc eax |
74 | inc eax |
75 | cmp eax,ecx |
75 | cmp eax,ecx |
76 | jl @b |
76 | jl @b |
77 | pop ebp eax |
77 | pop ebp eax |
78 | add ebp,[bytes_per_scanline] |
78 | add ebp,[BytesPerScanLine] |
79 | inc ebx |
79 | inc ebx |
80 | cmp ebx,edx |
80 | cmp ebx,edx |
81 | jl .xxx |
81 | jl .xxx |
82 | popad |
82 | popad |
83 | .skip: |
83 | .skip: |
Line 117... | Line 117... | ||
117 | retn |
117 | retn |
Line 118... | Line 118... | ||
118 | 118 | ||
119 | dl.24.vert_line: |
119 | dl.24.vert_line: |
120 | test edi,1 |
120 | test edi,1 |
121 | jnz .forced |
121 | jnz .forced |
122 | mov esi,[0x00003000] |
122 | mov esi,[CURRENT_TASK] |
123 | mov esi,[CLIP_RECTS+esi*4] |
123 | mov esi,[CLIP_RECTS+esi*4] |
124 | mov edi,[esi] |
124 | mov edi,[esi] |
125 | or edi,edi |
125 | or edi,edi |
126 | jz .exit |
126 | jz .exit |
Line 141... | Line 141... | ||
141 | mov edx,[rr.bottom] |
141 | mov edx,[rr.bottom] |
142 | dec edx |
142 | dec edx |
143 | .draw: |
143 | .draw: |
144 | @@: call is_intersect_vln |
144 | @@: call is_intersect_vln |
145 | jc .put |
145 | jc .put |
146 | cmp [mouse_invisible],0 |
146 | cmp byte[MOUSE_VISIBLE],0 |
147 | jne .put |
147 | je .put |
148 | call [SF.draw_mouse_under] |
148 | call [SF.draw_mouse_under] |
149 | mov [mouse_invisible],1 |
149 | mov byte[MOUSE_VISIBLE],0 |
150 | .put: mov ebp,[bytes_per_scanline] |
150 | .put: mov ebp,[BytesPerScanLine] |
151 | imul ebp,ebx |
151 | imul ebp,ebx |
152 | push eax |
152 | push eax |
153 | lea eax,[eax*3] |
153 | lea eax,[eax*3] |
154 | add ebp,eax |
154 | add ebp,eax |
155 | pop eax |
155 | pop eax |
156 | add ebp,[lfb_address] |
156 | add ebp,[LFBAddress] |
157 | @@: test ecx,0x01000000 |
157 | @@: test ecx,0x01000000 |
158 | jz .dr |
158 | jz .dr |
159 | mov ecx,[ebp] |
159 | mov ecx,[ebp] |
160 | not ecx |
160 | not ecx |
161 | or ecx,0x01000000 |
161 | or ecx,0x01000000 |
162 | .dr: mov [ebp],cx |
162 | .dr: mov [ebp],cx |
163 | ror ecx,8 |
163 | ror ecx,8 |
164 | mov [ebp+2],ch |
164 | mov [ebp+2],ch |
165 | rol ecx,8 |
165 | rol ecx,8 |
166 | add ebp,[bytes_per_scanline] |
166 | add ebp,[BytesPerScanLine] |
167 | inc ebx |
167 | inc ebx |
168 | cmp ebx,edx |
168 | cmp ebx,edx |
169 | jle @b |
169 | jle @b |
170 | .skip: |
170 | .skip: |
171 | add esi,SR |
171 | add esi,SR |
Line 194... | Line 194... | ||
194 | jmp .draw |
194 | jmp .draw |
Line 195... | Line 195... | ||
195 | 195 | ||
196 | dl.24.horz_line: |
196 | dl.24.horz_line: |
197 | test edi,1 |
197 | test edi,1 |
198 | jnz .forced |
198 | jnz .forced |
199 | mov esi,[0x00003000] |
199 | mov esi,[CURRENT_TASK] |
200 | mov esi,[CLIP_RECTS+esi*4] |
200 | mov esi,[CLIP_RECTS+esi*4] |
201 | mov edi,[esi] |
201 | mov edi,[esi] |
202 | or edi,edi |
202 | or edi,edi |
203 | jz .exit |
203 | jz .exit |
Line 218... | Line 218... | ||
218 | mov edx,[rr.right] |
218 | mov edx,[rr.right] |
219 | dec edx |
219 | dec edx |
220 | .draw: |
220 | .draw: |
221 | @@: call is_intersect_hln |
221 | @@: call is_intersect_hln |
222 | jc .put |
222 | jc .put |
223 | cmp [mouse_invisible],0 |
223 | cmp byte[MOUSE_VISIBLE],0 |
224 | jne .put |
224 | je .put |
225 | call [SF.draw_mouse_under] |
225 | call [SF.draw_mouse_under] |
226 | mov [mouse_invisible],1 |
226 | mov byte[MOUSE_VISIBLE],0 |
227 | .put: mov ebp,[bytes_per_scanline] |
227 | .put: mov ebp,[BytesPerScanLine] |
228 | imul ebp,eax |
228 | imul ebp,eax |
229 | push eax |
229 | push eax |
230 | lea eax,[ebx*3] |
230 | lea eax,[ebx*3] |
231 | add ebp,eax |
231 | add ebp,eax |
232 | pop eax |
232 | pop eax |
233 | add ebp,[lfb_address] |
233 | add ebp,[LFBAddress] |
234 | @@: test ecx,0x01000000 |
234 | @@: test ecx,0x01000000 |
235 | jz .dr |
235 | jz .dr |
236 | mov ecx,[ebp] |
236 | mov ecx,[ebp] |
237 | not ecx |
237 | not ecx |
238 | or ecx,0x01000000 |
238 | or ecx,0x01000000 |
Line 281... | Line 281... | ||
281 | ; edi = 0x00000001 force |
281 | ; edi = 0x00000001 force |
282 | ;----------------------------------------------------------------------------- |
282 | ;----------------------------------------------------------------------------- |
283 | begin |
283 | begin |
284 | pushad |
284 | pushad |
285 | cli |
285 | cli |
286 | mov edx,[bytes_per_scanline] |
286 | mov edx,[BytesPerScanLine] |
287 | imul edx,ebx |
287 | imul edx,ebx |
288 | add edx,eax ; lea esi,[eax*3] |
288 | add edx,eax ; lea esi,[eax*3] |
289 | lea edx,[edx+eax*2] ; add edx,esi |
289 | lea edx,[edx+eax*2] ; add edx,esi |
290 | add edx,[lfb_address] |
290 | add edx,[LFBAddress] |
291 | test ecx,0x01000000 |
291 | test ecx,0x01000000 |
292 | jz @f |
292 | jz @f |
293 | mov ecx,[edx] |
293 | mov ecx,[edx] |
294 | not ecx |
294 | not ecx |
295 | @@: test edi,1 |
295 | @@: test edi,1 |
296 | jnz .forced |
296 | jnz .forced |
297 | mov esi,[0x00003000] |
297 | mov esi,[CURRENT_TASK] |
298 | mov esi,[CLIP_RECTS+esi*4] |
298 | mov esi,[CLIP_RECTS+esi*4] |
299 | mov edi,[esi] |
299 | mov edi,[esi] |
300 | or edi,edi |
300 | or edi,edi |
301 | jz .exit |
301 | jz .exit |
302 | add esi,4 |
302 | add esi,4 |
Line 305... | Line 305... | ||
305 | jif ebx,l,[rr.top],.skip |
305 | jif ebx,l,[rr.top],.skip |
306 | jif ebx,ge,[rr.bottom],.skip |
306 | jif ebx,ge,[rr.bottom],.skip |
307 | call get_cursor_rect |
307 | call get_cursor_rect |
308 | call is_intersect_pt |
308 | call is_intersect_pt |
309 | jc .put |
309 | jc .put |
310 | cmp [mouse_invisible],0 |
310 | cmp byte[MOUSE_VISIBLE],0 |
311 | jne .put |
311 | je .put |
312 | call [SF.draw_mouse_under] |
312 | call [SF.draw_mouse_under] |
313 | mov [mouse_invisible],1 |
313 | mov byte[MOUSE_VISIBLE],0 |
314 | .put: mov [edx],cx |
314 | .put: mov [edx],cx |
315 | shr ecx,16 |
315 | shr ecx,16 |
316 | mov [edx+2],cl |
316 | mov [edx+2],cl |
317 | .exit: |
317 | .exit: |
318 | sti |
318 | sti |
Line 343... | Line 343... | ||
343 | ; ebx = y coordinate |
343 | ; ebx = y coordinate |
344 | ;----------------------------------------------------------------------------- |
344 | ;----------------------------------------------------------------------------- |
345 | begin |
345 | begin |
346 | pushad |
346 | pushad |
347 | cli |
347 | cli |
348 | imul ebx,[bytes_per_scanline] |
348 | imul ebx,[BytesPerScanLine] |
349 | lea eax,[eax*3] |
349 | lea eax,[eax*3] |
350 | add eax,ebx |
350 | add eax,ebx |
351 | add eax,[lfb_address] |
351 | add eax,[LFBAddress] |
352 | mov eax,[eax] |
352 | mov eax,[eax] |
353 | and eax,0x00FFFFFF |
353 | and eax,0x00FFFFFF |
354 | mov [esp+4*6],eax |
354 | mov [esp+4*6],eax |
355 | sti |
355 | sti |
356 | popad |
356 | popad |
Line 386... | Line 386... | ||
386 | 386 | ||
387 | lea edi,[ecx*3] |
387 | lea edi,[ecx*3] |
388 | push edi |
388 | push edi |
389 | add ecx,eax |
389 | add ecx,eax |
390 | add edx,ebx |
390 | add edx,ebx |
391 | mov edi,[0x00003010] |
391 | mov edi,[TASK_BASE] |
392 | movsx esi,word[edi-0x3000+0] |
392 | movsx esi,word[edi-CURRENT_TASK+0] |
393 | add eax,esi |
393 | add eax,esi |
394 | add ecx,esi |
394 | add ecx,esi |
395 | movsx esi,word[edi-0x3000+4] |
395 | movsx esi,word[edi-CURRENT_TASK+4] |
396 | add ebx,esi |
396 | add ebx,esi |
397 | add edx,esi |
397 | add edx,esi |
398 | ; add eax,[edi-0x3000+0] |
398 | ; add eax,[edi-CURRENT_TASK+0] |
399 | ; add ebx,[edi-0x3000+4] |
399 | ; add ebx,[edi-CURRENT_TASK+4] |
400 | ; add ecx,[edi-0x3000+0] |
400 | ; add ecx,[edi-CURRENT_TASK+0] |
Line 401... | Line 401... | ||
401 | ; add edx,[edi-0x3000+4] |
401 | ; add edx,[edi-CURRENT_TASK+4] |
402 | 402 | ||
403 | mov esi,[0x00003000] |
403 | mov esi,[CURRENT_TASK] |
404 | mov esi,[CLIP_RECTS+esi*4] |
404 | mov esi,[CLIP_RECTS+esi*4] |
405 | mov edi,[esi] |
405 | mov edi,[esi] |
406 | or edi,edi |
406 | or edi,edi |
Line 420... | Line 420... | ||
420 | mov ecx,[rr.right] |
420 | mov ecx,[rr.right] |
421 | @@: jif edx,l,[rr.bottom],@f |
421 | @@: jif edx,l,[rr.bottom],@f |
422 | mov edx,[rr.bottom] |
422 | mov edx,[rr.bottom] |
423 | @@: call is_intersect_rc |
423 | @@: call is_intersect_rc |
424 | jc .put |
424 | jc .put |
425 | cmp [mouse_invisible],0 |
425 | cmp byte[MOUSE_VISIBLE],0 |
426 | jne .put |
426 | je .put |
427 | call [SF.draw_mouse_under] |
427 | call [SF.draw_mouse_under] |
428 | mov [mouse_invisible],1 |
428 | mov byte[MOUSE_VISIBLE],0 |
429 | .put: mov esi,ebx |
429 | .put: mov esi,ebx |
430 | sub esi,[esp+4*4] |
430 | sub esi,[esp+4*4] |
431 | imul esi,[esp+4*8] |
431 | imul esi,[esp+4*8] |
432 | mov edi,eax |
432 | mov edi,eax |
433 | sub edi,[esp+4*7] |
433 | sub edi,[esp+4*7] |
434 | lea edi,[edi*3] |
434 | lea edi,[edi*3] |
435 | add esi,edi |
435 | add esi,edi |
436 | add esi,ebp |
436 | add esi,ebp |
437 | mov edi,[bytes_per_scanline] |
437 | mov edi,[BytesPerScanLine] |
438 | imul edi,ebx |
438 | imul edi,ebx |
439 | push eax |
439 | push eax |
440 | lea eax,[eax*3] |
440 | lea eax,[eax*3] |
441 | add edi,eax |
441 | add edi,eax |
442 | pop eax |
442 | pop eax |
443 | add edi,[lfb_address] |
443 | add edi,[LFBAddress] |
444 | .xxx: push eax esi edi eax |
444 | .xxx: push eax esi edi eax |
445 | @@: ;movsd |
445 | @@: ;movsd |
446 | ;dec esi |
446 | ;dec esi |
447 | ;dec edi |
447 | ;dec edi |
448 | movsw |
448 | movsw |
Line 450... | Line 450... | ||
450 | inc dword[esp] |
450 | inc dword[esp] |
451 | cmp [esp],ecx |
451 | cmp [esp],ecx |
452 | jl @b |
452 | jl @b |
453 | pop eax edi esi eax |
453 | pop eax edi esi eax |
454 | add esi,[esp+4*8] |
454 | add esi,[esp+4*8] |
455 | add edi,[bytes_per_scanline] |
455 | add edi,[BytesPerScanLine] |
456 | inc ebx |
456 | inc ebx |
457 | cmp ebx,edx |
457 | cmp ebx,edx |
458 | jl .xxx |
458 | jl .xxx |
459 | popad |
459 | popad |
460 | .skip: |
460 | .skip: |
Line 478... | Line 478... | ||
478 | 478 | ||
479 | cmp byte[bg_type],BGT_TILE |
479 | cmp byte[bg_type],BGT_TILE |
Line 480... | Line 480... | ||
480 | je .tiled |
480 | je .tiled |
481 | 481 | ||
482 | mov eax,[bg_width] |
482 | mov eax,[bg_width] |
483 | cmp eax,[screen_width] |
483 | cmp eax,[ScreenWidth] |
484 | jne @f |
484 | jne @f |
485 | mov eax,[bg_height] |
485 | mov eax,[bg_height] |
486 | cmp eax,[screen_height] |
486 | cmp eax,[ScreenHeight] |
487 | je .tiled |
487 | je .tiled |
488 | @@: |
488 | @@: |
Line 489... | Line 489... | ||
489 | imul eax,[bg_width],3 |
489 | imul eax,[bg_width],3 |
490 | mov [bg_bytes_per_scanline],eax |
490 | mov [bg_BytesPerScanLine],eax |
491 | 491 | ||
492 | mov eax,[viewport.left] |
492 | mov eax,[viewport.left] |
Line 500... | Line 500... | ||
500 | je .color |
500 | je .color |
501 | @@: |
501 | @@: |
502 | cli |
502 | cli |
Line 503... | Line 503... | ||
503 | 503 | ||
504 | call [SF.draw_mouse_under] |
504 | call [SF.draw_mouse_under] |
Line 505... | Line 505... | ||
505 | mov [mouse_invisible],1 |
505 | mov byte[MOUSE_VISIBLE],0 |
506 | 506 | ||
507 | mov esi,[CLIP_RECTS+4] |
507 | mov esi,[CLIP_RECTS+4] |
508 | mov ebp,[esi] |
508 | mov ebp,[esi] |
Line 526... | Line 526... | ||
526 | ;jc .put |
526 | ;jc .put |
527 | ;cmp [mouse_invisible],0 |
527 | ;cmp [mouse_invisible],0 |
528 | ;jne .put |
528 | ;jne .put |
529 | ;call [SF.draw_mouse_under] |
529 | ;call [SF.draw_mouse_under] |
530 | ;mov [mouse_invisible],1 |
530 | ;mov [mouse_invisible],1 |
531 | .put: mov ebp,[bytes_per_scanline] |
531 | .put: mov ebp,[BytesPerScanLine] |
532 | imul ebp,ebx |
532 | imul ebp,ebx |
533 | push eax |
533 | push eax |
534 | lea eax,[eax*3] |
534 | lea eax,[eax*3] |
535 | add ebp,eax |
535 | add ebp,eax |
536 | pop eax |
536 | pop eax |
537 | add ebp,[lfb_address] |
537 | add ebp,[LFBAddress] |
538 | .xxx: push eax ebp |
538 | .xxx: push eax ebp |
539 | @@: push ebp |
539 | @@: push ebp |
540 | call [set_bank] |
540 | call [set_bank] |
541 | push eax edx |
541 | push eax edx |
542 | mul [bg_width] |
542 | mul [bg_width] |
543 | div [screen_width] |
543 | div dword[ScreenWidth] |
544 | lea edi,[eax*3] |
544 | lea edi,[eax*3] |
545 | mov eax,ebx |
545 | mov eax,ebx |
546 | mul [bg_height] |
546 | mul [bg_height] |
547 | div [screen_height] |
547 | div dword[ScreenHeight] |
548 | mul [bg_bytes_per_scanline] |
548 | mul [bg_BytesPerScanLine] |
549 | add edi,eax |
549 | add edi,eax |
550 | add edi,bg_address |
550 | add edi,IMG_BACKGROUND |
551 | mov eax,[edi] |
551 | mov eax,[edi] |
552 | mov [ebp],eax |
552 | mov [ebp],eax |
553 | pop edx eax |
553 | pop edx eax |
554 | pop ebp |
554 | pop ebp |
555 | add ebp,3 |
555 | add ebp,3 |
556 | inc eax |
556 | inc eax |
557 | cmp eax,ecx |
557 | cmp eax,ecx |
558 | jl @b |
558 | jl @b |
559 | pop ebp eax |
559 | pop ebp eax |
560 | add ebp,[bytes_per_scanline] |
560 | add ebp,[BytesPerScanLine] |
561 | inc ebx |
561 | inc ebx |
562 | cmp ebx,edx |
562 | cmp ebx,edx |
563 | jl .xxx |
563 | jl .xxx |
564 | popad |
564 | popad |
565 | .skip: |
565 | .skip: |
Line 571... | Line 571... | ||
571 | sti |
571 | sti |
572 | popad |
572 | popad |
573 | retn |
573 | retn |
Line 574... | Line 574... | ||
574 | 574 | ||
575 | .tiled: |
575 | .tiled: |
576 | mov eax,bg_address |
576 | mov eax,IMG_BACKGROUND |
577 | mov ebx,[bg_width-2] |
577 | mov ebx,[bg_width-2] |
578 | mov bx,word[bg_height] |
578 | mov bx,word[bg_height] |
579 | xor ecx,ecx |
579 | xor ecx,ecx |
580 | .lp1: push eax |
580 | .lp1: push eax |
581 | call vm_mike_put_image.24.direct |
581 | call vm_mike_put_image.24.direct |
582 | pop eax |
582 | pop eax |
583 | rol ecx,16 |
583 | rol ecx,16 |
584 | add cx,word[bg_width] |
584 | add cx,word[bg_width] |
585 | cmp cx,word[screen_width] |
585 | cmp cx,word[ScreenWidth] |
586 | jae @f |
586 | jae @f |
587 | rol ecx,16 |
587 | rol ecx,16 |
588 | jmp .lp1 |
588 | jmp .lp1 |
589 | @@: shr ecx,16 |
589 | @@: shr ecx,16 |
590 | add ecx,[bg_height] |
590 | add ecx,[bg_height] |
591 | cmp ecx,[screen_height] |
591 | cmp ecx,[ScreenHeight] |
592 | jb .lp1 |
592 | jb .lp1 |
593 | popad |
593 | popad |
Line 594... | Line 594... | ||
594 | retn |
594 | retn |
595 | 595 | ||
596 | .color: |
596 | .color: |
597 | mov edi,[bg_address] |
597 | mov edi,[IMG_BACKGROUND] |
598 | and edi,0x00FFFFFF |
598 | and edi,0x00FFFFFF |
599 | call vm_mike_draw_rect.24 |
599 | call vm_mike_draw_rect.24 |
600 | popad |
600 | popad |
601 | retn |
601 | retn |