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 | lea ebp,[ebp+eax*4] |
61 | lea ebp,[ebp+eax*4] |
62 | add ebp,[lfb_address] |
62 | add ebp,[LFBAddress] |
63 | .xxx: push eax ebp |
63 | .xxx: push eax ebp |
64 | @@: push ebp |
64 | @@: push ebp |
65 | call [set_bank] |
65 | call [set_bank] |
66 | mov [ebp],edi |
66 | mov [ebp],edi |
67 | pop ebp |
67 | pop ebp |
Line 69... | Line 69... | ||
69 | add ebp,4 |
69 | add ebp,4 |
70 | inc eax |
70 | inc eax |
71 | cmp eax,ecx |
71 | cmp eax,ecx |
72 | jl @b |
72 | jl @b |
73 | pop ebp eax |
73 | pop ebp eax |
74 | add ebp,[bytes_per_scanline] |
74 | add ebp,[BytesPerScanLine] |
75 | inc ebx |
75 | inc ebx |
76 | cmp ebx,edx |
76 | cmp ebx,edx |
77 | jl .xxx |
77 | jl .xxx |
78 | popad |
78 | popad |
79 | .skip: |
79 | .skip: |
Line 113... | Line 113... | ||
113 | retn |
113 | retn |
Line 114... | Line 114... | ||
114 | 114 | ||
115 | dl.32.vert_line: |
115 | dl.32.vert_line: |
116 | test edi,1 |
116 | test edi,1 |
117 | jnz .forced |
117 | jnz .forced |
118 | mov esi,[0x00003000] |
118 | mov esi,[CURRENT_TASK] |
119 | mov esi,[CLIP_RECTS+esi*4] |
119 | mov esi,[CLIP_RECTS+esi*4] |
120 | mov edi,[esi] |
120 | mov edi,[esi] |
121 | or edi,edi |
121 | or edi,edi |
122 | jz .exit |
122 | jz .exit |
Line 137... | Line 137... | ||
137 | mov edx,[rr.bottom] |
137 | mov edx,[rr.bottom] |
138 | dec edx |
138 | dec edx |
139 | .draw: |
139 | .draw: |
140 | @@: call is_intersect_vln |
140 | @@: call is_intersect_vln |
141 | jc .put |
141 | jc .put |
142 | cmp [mouse_invisible],0 |
142 | cmp byte[MOUSE_VISIBLE],0 |
143 | jne .put |
143 | je .put |
144 | call [SF.draw_mouse_under] |
144 | call [SF.draw_mouse_under] |
145 | mov [mouse_invisible],1 |
145 | mov byte[MOUSE_VISIBLE],0 |
146 | .put: mov ebp,[bytes_per_scanline] |
146 | .put: mov ebp,[BytesPerScanLine] |
147 | imul ebp,ebx |
147 | imul ebp,ebx |
148 | lea ebp,[ebp+eax*4] |
148 | lea ebp,[ebp+eax*4] |
149 | add ebp,[lfb_address] |
149 | add ebp,[LFBAddress] |
150 | @@: push ebp |
150 | @@: push ebp |
151 | call [set_bank] |
151 | call [set_bank] |
152 | test ecx,0x01000000 |
152 | test ecx,0x01000000 |
153 | jz .dr |
153 | jz .dr |
154 | mov ecx,[ebp] |
154 | mov ecx,[ebp] |
Line 160... | Line 160... | ||
160 | ; jz .dr |
160 | ; jz .dr |
161 | ; mov ecx,[ebp] |
161 | ; mov ecx,[ebp] |
162 | ; not ecx |
162 | ; not ecx |
163 | ; or ecx,0x01000000 |
163 | ; or ecx,0x01000000 |
164 | ; .dr: mov [ebp],ecx |
164 | ; .dr: mov [ebp],ecx |
165 | add ebp,[bytes_per_scanline] |
165 | add ebp,[BytesPerScanLine] |
166 | inc ebx |
166 | inc ebx |
167 | cmp ebx,edx |
167 | cmp ebx,edx |
168 | jle @b |
168 | jle @b |
169 | .skip: |
169 | .skip: |
170 | add esi,SR |
170 | add esi,SR |
Line 193... | Line 193... | ||
193 | jmp .draw |
193 | jmp .draw |
Line 194... | Line 194... | ||
194 | 194 | ||
195 | dl.32.horz_line: |
195 | dl.32.horz_line: |
196 | test edi,1 |
196 | test edi,1 |
197 | jnz .forced |
197 | jnz .forced |
198 | mov esi,[0x00003000] |
198 | mov esi,[CURRENT_TASK] |
199 | mov esi,[CLIP_RECTS+esi*4] |
199 | mov esi,[CLIP_RECTS+esi*4] |
200 | mov edi,[esi] |
200 | mov edi,[esi] |
201 | or edi,edi |
201 | or edi,edi |
202 | jz .exit |
202 | jz .exit |
Line 217... | Line 217... | ||
217 | mov edx,[rr.right] |
217 | mov edx,[rr.right] |
218 | dec edx |
218 | dec edx |
219 | .draw: |
219 | .draw: |
220 | @@: call is_intersect_hln |
220 | @@: call is_intersect_hln |
221 | jc .put |
221 | jc .put |
222 | cmp [mouse_invisible],0 |
222 | cmp byte[MOUSE_VISIBLE],0 |
223 | jne .put |
223 | je .put |
224 | call [SF.draw_mouse_under] |
224 | call [SF.draw_mouse_under] |
225 | mov [mouse_invisible],1 |
225 | mov byte[MOUSE_VISIBLE],0 |
226 | .put: mov ebp,[bytes_per_scanline] |
226 | .put: mov ebp,[BytesPerScanLine] |
227 | imul ebp,eax |
227 | imul ebp,eax |
228 | lea ebp,[ebp+ebx*4] |
228 | lea ebp,[ebp+ebx*4] |
229 | add ebp,[lfb_address] |
229 | add ebp,[LFBAddress] |
230 | @@: push ebp |
230 | @@: push ebp |
231 | call [set_bank] |
231 | call [set_bank] |
232 | test ecx,0x01000000 |
232 | test ecx,0x01000000 |
233 | jz .dr |
233 | jz .dr |
234 | mov ecx,[ebp] |
234 | mov ecx,[ebp] |
Line 283... | Line 283... | ||
283 | ; edi = 0x00000001 force |
283 | ; edi = 0x00000001 force |
284 | ;----------------------------------------------------------------------------- |
284 | ;----------------------------------------------------------------------------- |
285 | begin |
285 | begin |
286 | pushad |
286 | pushad |
287 | cli |
287 | cli |
288 | mov edx,[bytes_per_scanline] |
288 | mov edx,[BytesPerScanLine] |
289 | imul edx,ebx |
289 | imul edx,ebx |
290 | lea edx,[edx+eax*4] |
290 | lea edx,[edx+eax*4] |
291 | add edx,[lfb_address] |
291 | add edx,[LFBAddress] |
292 | ; test ecx,0x01000000 |
292 | ; test ecx,0x01000000 |
293 | ; jz @f |
293 | ; jz @f |
294 | ; mov ecx,[edx] |
294 | ; mov ecx,[edx] |
295 | ; not ecx |
295 | ; not ecx |
296 | @@: test edi,1 |
296 | @@: test edi,1 |
297 | jnz .forced |
297 | jnz .forced |
298 | mov esi,[0x00003000] |
298 | mov esi,[CURRENT_TASK] |
299 | mov esi,[CLIP_RECTS+esi*4] |
299 | mov esi,[CLIP_RECTS+esi*4] |
300 | mov edi,[esi] |
300 | mov edi,[esi] |
301 | or edi,edi |
301 | or edi,edi |
302 | jz .exit |
302 | jz .exit |
303 | add esi,4 |
303 | add esi,4 |
Line 306... | Line 306... | ||
306 | jif ebx,l,[rr.top],.skip |
306 | jif ebx,l,[rr.top],.skip |
307 | jif ebx,ge,[rr.bottom],.skip |
307 | jif ebx,ge,[rr.bottom],.skip |
308 | call get_cursor_rect |
308 | call get_cursor_rect |
309 | call is_intersect_pt |
309 | call is_intersect_pt |
310 | jc .put |
310 | jc .put |
311 | cmp [mouse_invisible],0 |
311 | cmp byte[MOUSE_VISIBLE],0 |
312 | jne .put |
312 | je .put |
313 | call [SF.draw_mouse_under] |
313 | call [SF.draw_mouse_under] |
314 | mov [mouse_invisible],1 |
314 | mov byte[MOUSE_VISIBLE],0 |
315 | .put: push edx |
315 | .put: push edx |
316 | call [set_bank] |
316 | call [set_bank] |
317 | pop edx |
317 | pop edx |
318 | test ecx,0x01000000 |
318 | test ecx,0x01000000 |
319 | jz .lp1 |
319 | jz .lp1 |
Line 352... | Line 352... | ||
352 | ; ebx = y coordinate |
352 | ; ebx = y coordinate |
353 | ;----------------------------------------------------------------------------- |
353 | ;----------------------------------------------------------------------------- |
354 | begin |
354 | begin |
355 | pushad |
355 | pushad |
356 | cli |
356 | cli |
357 | imul ebx,[bytes_per_scanline] |
357 | imul ebx,[BytesPerScanLine] |
358 | shl eax,2 |
358 | shl eax,2 |
359 | add eax,ebx |
359 | add eax,ebx |
360 | add eax,[lfb_address] |
360 | add eax,[LFBAddress] |
361 | push eax |
361 | push eax |
362 | call [set_bank] |
362 | call [set_bank] |
363 | pop eax |
363 | pop eax |
364 | mov eax,[ebp] |
364 | mov eax,[ebp] |
365 | and eax,0x00FFFFFF |
365 | and eax,0x00FFFFFF |
Line 398... | Line 398... | ||
398 | 398 | ||
399 | lea edi,[ecx*3] |
399 | lea edi,[ecx*3] |
400 | push edi |
400 | push edi |
401 | add ecx,eax |
401 | add ecx,eax |
402 | add edx,ebx |
402 | add edx,ebx |
403 | mov edi,[0x00003010] |
403 | mov edi,[TASK_BASE] |
404 | movsx esi,word[edi-0x3000+0] |
404 | movsx esi,word[edi-CURRENT_TASK+0] |
405 | add eax,esi |
405 | add eax,esi |
406 | add ecx,esi |
406 | add ecx,esi |
407 | movsx esi,word[edi-0x3000+4] |
407 | movsx esi,word[edi-CURRENT_TASK+4] |
408 | add ebx,esi |
408 | add ebx,esi |
409 | add edx,esi |
409 | add edx,esi |
410 | ; add eax,[esi-0x3000+0] |
410 | ; add eax,[esi-CURRENT_TASK+0] |
411 | ; add ebx,[esi-0x3000+4] |
411 | ; add ebx,[esi-CURRENT_TASK+4] |
412 | ; add ecx,[esi-0x3000+0] |
412 | ; add ecx,[esi-CURRENT_TASK+0] |
Line 413... | Line 413... | ||
413 | ; add edx,[esi-0x3000+4] |
413 | ; add edx,[esi-CURRENT_TASK+4] |
414 | 414 | ||
415 | ; cmp eax,640 |
415 | ; cmp eax,640 |
416 | ; jb @f |
416 | ; jb @f |
Line 417... | Line 417... | ||
417 | ; SHFLOW '%x %x %x %x',eax,ebx,ecx,edx |
417 | ; SHFLOW '%x %x %x %x',eax,ebx,ecx,edx |
418 | ; @@: |
418 | ; @@: |
419 | 419 | ||
420 | mov esi,[0x00003000] |
420 | mov esi,[CURRENT_TASK] |
421 | mov esi,[CLIP_RECTS+esi*4] |
421 | mov esi,[CLIP_RECTS+esi*4] |
422 | mov edi,[esi] |
422 | mov edi,[esi] |
Line 437... | Line 437... | ||
437 | mov ecx,[rr.right] |
437 | mov ecx,[rr.right] |
438 | @@: jif edx,l,[rr.bottom],@f |
438 | @@: jif edx,l,[rr.bottom],@f |
439 | mov edx,[rr.bottom] |
439 | mov edx,[rr.bottom] |
440 | @@: call is_intersect_rc |
440 | @@: call is_intersect_rc |
441 | jc .put |
441 | jc .put |
442 | cmp [mouse_invisible],0 |
442 | cmp byte[MOUSE_VISIBLE],0 |
443 | jne .put |
443 | je .put |
444 | call [SF.draw_mouse_under] |
444 | call [SF.draw_mouse_under] |
445 | mov [mouse_invisible],1 |
445 | mov byte[MOUSE_VISIBLE],0 |
446 | .put: mov esi,ebx |
446 | .put: mov esi,ebx |
447 | sub esi,[esp+4*4] |
447 | sub esi,[esp+4*4] |
448 | imul esi,[esp+4*8] |
448 | imul esi,[esp+4*8] |
449 | mov edi,eax |
449 | mov edi,eax |
450 | sub edi,[esp+4*7] |
450 | sub edi,[esp+4*7] |
451 | lea edi,[edi*3] |
451 | lea edi,[edi*3] |
452 | add esi,edi |
452 | add esi,edi |
453 | add esi,ebp |
453 | add esi,ebp |
454 | mov edi,[bytes_per_scanline] |
454 | mov edi,[BytesPerScanLine] |
455 | imul edi,ebx |
455 | imul edi,ebx |
456 | lea edi,[edi+eax*4] |
456 | lea edi,[edi+eax*4] |
457 | add edi,[lfb_address] |
457 | add edi,[LFBAddress] |
458 | .xxx: push eax esi edi eax |
458 | .xxx: push eax esi edi eax |
459 | @@: lodsd |
459 | @@: lodsd |
Line 460... | Line 460... | ||
460 | 460 | ||
461 | push ebp edi |
461 | push ebp edi |
Line 468... | Line 468... | ||
468 | inc dword[esp] |
468 | inc dword[esp] |
469 | cmp [esp],ecx |
469 | cmp [esp],ecx |
470 | jl @b |
470 | jl @b |
471 | pop eax edi esi eax |
471 | pop eax edi esi eax |
472 | add esi,[esp+4*8] |
472 | add esi,[esp+4*8] |
473 | add edi,[bytes_per_scanline] |
473 | add edi,[BytesPerScanLine] |
474 | inc ebx |
474 | inc ebx |
475 | cmp ebx,edx |
475 | cmp ebx,edx |
476 | jl .xxx |
476 | jl .xxx |
477 | popad |
477 | popad |
478 | .skip: |
478 | .skip: |
Line 496... | Line 496... | ||
496 | 496 | ||
497 | cmp byte[bg_type],BGT_TILE |
497 | cmp byte[bg_type],BGT_TILE |
Line 498... | Line 498... | ||
498 | je .tiled |
498 | je .tiled |
499 | 499 | ||
500 | mov eax,[bg_width] |
500 | mov eax,[bg_width] |
501 | cmp eax,[screen_width] |
501 | cmp eax,[ScreenWidth] |
502 | jne @f |
502 | jne @f |
503 | mov eax,[bg_height] |
503 | mov eax,[bg_height] |
504 | cmp eax,[screen_height] |
504 | cmp eax,[ScreenHeight] |
505 | je .tiled |
505 | je .tiled |
506 | @@: |
506 | @@: |
Line 507... | Line 507... | ||
507 | imul eax,[bg_width],3 |
507 | imul eax,[bg_width],3 |
508 | mov [bg_bytes_per_scanline],eax |
508 | mov [bg_BytesPerScanLine],eax |
509 | 509 | ||
510 | mov eax,[viewport.left] |
510 | mov eax,[viewport.left] |
Line 518... | Line 518... | ||
518 | je .color |
518 | je .color |
519 | @@: |
519 | @@: |
520 | cli |
520 | cli |
Line 521... | Line 521... | ||
521 | 521 | ||
522 | call [SF.draw_mouse_under] |
522 | call [SF.draw_mouse_under] |
Line 523... | Line 523... | ||
523 | mov [mouse_invisible],1 |
523 | mov byte[MOUSE_VISIBLE],0 |
524 | 524 | ||
525 | mov esi,[CLIP_RECTS+4] |
525 | mov esi,[CLIP_RECTS+4] |
526 | mov ebp,[esi] |
526 | mov ebp,[esi] |
Line 544... | Line 544... | ||
544 | ;jc .put |
544 | ;jc .put |
545 | ;cmp [mouse_invisible],0 |
545 | ;cmp [mouse_invisible],0 |
546 | ;jne .put |
546 | ;jne .put |
547 | ;call [SF.draw_mouse_under] |
547 | ;call [SF.draw_mouse_under] |
548 | ;mov [mouse_invisible],1 |
548 | ;mov [mouse_invisible],1 |
549 | .put: mov ebp,[bytes_per_scanline] |
549 | .put: mov ebp,[BytesPerScanLine] |
550 | imul ebp,ebx |
550 | imul ebp,ebx |
551 | lea ebp,[ebp+eax*4] |
551 | lea ebp,[ebp+eax*4] |
552 | add ebp,[lfb_address] |
552 | add ebp,[LFBAddress] |
553 | .xxx: push eax ebp |
553 | .xxx: push eax ebp |
554 | @@: push ebp |
554 | @@: push ebp |
555 | call [set_bank] |
555 | call [set_bank] |
556 | push eax edx |
556 | push eax edx |
557 | mul [bg_width] |
557 | mul [bg_width] |
558 | div [screen_width] |
558 | div dword[ScreenWidth] |
559 | lea edi,[eax*3] |
559 | lea edi,[eax*3] |
560 | mov eax,ebx |
560 | mov eax,ebx |
561 | mul [bg_height] |
561 | mul [bg_height] |
562 | div [screen_height] |
562 | div dword[ScreenHeight] |
563 | mul [bg_bytes_per_scanline] |
563 | mul [bg_BytesPerScanLine] |
564 | add edi,eax |
564 | add edi,eax |
565 | add edi,bg_address |
565 | add edi,IMG_BACKGROUND |
566 | mov eax,[edi] |
566 | mov eax,[edi] |
567 | mov [ebp],eax |
567 | mov [ebp],eax |
568 | pop edx eax |
568 | pop edx eax |
569 | pop ebp |
569 | pop ebp |
570 | add ebp,4 |
570 | add ebp,4 |
571 | inc eax |
571 | inc eax |
572 | cmp eax,ecx |
572 | cmp eax,ecx |
573 | jl @b |
573 | jl @b |
574 | pop ebp eax |
574 | pop ebp eax |
575 | add ebp,[bytes_per_scanline] |
575 | add ebp,[BytesPerScanLine] |
576 | inc ebx |
576 | inc ebx |
577 | cmp ebx,edx |
577 | cmp ebx,edx |
578 | jl .xxx |
578 | jl .xxx |
579 | popad |
579 | popad |
580 | .skip: |
580 | .skip: |
Line 586... | Line 586... | ||
586 | sti |
586 | sti |
587 | popad |
587 | popad |
588 | retn |
588 | retn |
Line 589... | Line 589... | ||
589 | 589 | ||
590 | .tiled: |
590 | .tiled: |
591 | mov eax,bg_address |
591 | mov eax,IMG_BACKGROUND |
592 | mov ebx,[bg_width-2] |
592 | mov ebx,[bg_width-2] |
593 | mov bx,word[bg_height] |
593 | mov bx,word[bg_height] |
594 | xor ecx,ecx |
594 | xor ecx,ecx |
595 | .lp1: push eax |
595 | .lp1: push eax |
596 | call vm_mike_put_image.32.direct |
596 | call vm_mike_put_image.32.direct |
597 | pop eax |
597 | pop eax |
598 | rol ecx,16 |
598 | rol ecx,16 |
599 | add cx,word[bg_width] |
599 | add cx,word[bg_width] |
600 | cmp cx,word[screen_width] |
600 | cmp cx,word[ScreenWidth] |
601 | jae @f |
601 | jae @f |
602 | rol ecx,16 |
602 | rol ecx,16 |
603 | jmp .lp1 |
603 | jmp .lp1 |
604 | @@: shr ecx,16 |
604 | @@: shr ecx,16 |
605 | add ecx,[bg_height] |
605 | add ecx,[bg_height] |
606 | cmp ecx,[screen_height] |
606 | cmp ecx,[ScreenHeight] |
607 | jb .lp1 |
607 | jb .lp1 |
608 | popad |
608 | popad |
Line 609... | Line 609... | ||
609 | retn |
609 | retn |
610 | 610 | ||
611 | .color: |
611 | .color: |
612 | mov edi,[bg_address] |
612 | mov edi,[IMG_BACKGROUND] |
613 | and edi,0x00FFFFFF |
613 | and edi,0x00FFFFFF |
614 | call vm_mike_draw_rect.32 |
614 | call vm_mike_draw_rect.32 |
615 | popad |
615 | popad |