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 15... | Line 15... | ||
15 | 15 | ||
Line 16... | Line 16... | ||
16 | DRIVER_CODE_START: |
16 | DRIVER_CODE_START: |
Line -... | Line 17... | ||
- | 17 | ||
- | 18 | ;----------------------------------------------------------------------------- |
|
17 | 19 | ||
18 | ;----------------------------------------------------------------------------- |
20 | include '../const.inc' ; kernel defines |
Line 19... | Line 21... | ||
19 | 21 | ||
Line 53... | Line 55... | ||
53 | end virtual |
55 | end virtual |
Line 54... | Line 56... | ||
54 | 56 | ||
Line 55... | Line 57... | ||
55 | ;----------------------------------------------------------------------------- |
57 | ;----------------------------------------------------------------------------- |
56 | - | ||
Line 57... | Line 58... | ||
57 | CLIP_RECTS = 0x00720000 ; 0x00780000 |
58 | |
58 | bg_address = 0x300000 |
59 | CLIP_RECTS = 0x00720000 ; 0x00780000 |
59 | 60 | ||
60 | ;label bg_bytes_per_scanline dword at 0x600000-16;0x460000-16 |
61 | ;label bg_BytesPerScanLine dword at 0x600000-16;0x460000-16 |
Line 61... | Line 62... | ||
61 | ;label bg_type dword at 0x600000-12;0x460000-12 |
62 | ;label bg_type dword at 0x600000-12;0x460000-12 |
62 | ;label bg_width dword at 0x600000-8;0x460000-8 |
63 | ;label bg_width dword at 0x600000-8;0x460000-8 |
63 | ;label bg_height dword at 0x600000-4;0x460000-4 |
64 | ;label bg_height dword at 0x600000-4;0x460000-4 |
64 | 65 | ||
Line 65... | Line -... | ||
65 | label bg_bytes_per_scanline dword at 0x460000-16 |
- | |
66 | label bg_type dword at 0x460000-12 |
- | |
67 | label bg_width dword at 0x460000-8 |
- | |
68 | label bg_height dword at 0x460000-4 |
- | |
69 | - | ||
70 | label lfb_address dword at 0x0000FE80 |
- | |
71 | label mouse_invisible dword at 0x0000F204 |
- | |
72 | 66 | label bg_BytesPerScanLine dword at 0x460000-16 |
|
73 | label screen_width dword at 0x0000FE00 |
67 | label bg_type dword at 0x460000-12 |
Line 74... | Line 68... | ||
74 | label screen_height dword at 0x0000FE04 |
68 | label bg_width dword at 0x460000-8 |
Line 98... | Line 92... | ||
98 | mov edi,SF |
92 | mov edi,SF |
99 | mov ecx,sizeof.graph_funcs/4 |
93 | mov ecx,sizeof.graph_funcs/4 |
100 | cld |
94 | cld |
101 | rep movsd |
95 | rep movsd |
Line 102... | Line 96... | ||
102 | 96 | ||
103 | ; push dword[0x00003000] |
97 | ; push dword[CURRENT_TASK] |
104 | ; mov dword[0x00003000],1 |
98 | ; mov dword[CURRENT_TASK],1 |
105 | ; call [SF.disable_mouse] |
99 | ; call [SF.disable_mouse] |
Line 106... | Line 100... | ||
106 | ; pop dword[0x00003000] |
100 | ; pop dword[CURRENT_TASK] |
107 | 101 | ||
108 | mov [viewport.left],0 |
102 | mov [viewport.left],0 |
109 | mov [viewport.top],0 |
103 | mov [viewport.top],0 |
Line 110... | Line 104... | ||
110 | m2m [viewport.right],[0x0000FE00] |
104 | m2m [viewport.right],[ScreenWidth] |
111 | m2m [viewport.bottom],[0x0000FE04] |
105 | m2m [viewport.bottom],[ScreenHeight] |
112 | 106 | ||
113 | movzx eax,byte[0xE035] |
107 | movzx eax,byte[GFX_CARD_VENDOR] |
114 | cmp byte[0xE034],'2' |
108 | cmp byte[VESA_VER_MAJOR],'2' |
115 | jb @f |
109 | jb @f |
Line 116... | Line 110... | ||
116 | mov al,0 |
110 | mov al,0 |
117 | @@: mov eax,[setbnk+eax*4] |
111 | @@: mov eax,[setbnk+eax*4] |
118 | mov [set_bank],eax |
112 | mov [set_bank],eax |
Line 119... | Line 113... | ||
119 | 113 | ||
Line 219... | Line 213... | ||
219 | .exit.2: |
213 | .exit.2: |
Line 220... | Line 214... | ||
220 | 214 | ||
221 | mov [GF.calculatescreen],vm_mike_calculatescreen |
215 | mov [GF.calculatescreen],vm_mike_calculatescreen |
Line -... | Line 216... | ||
- | 216 | mov [GF.setscreen],vm_mike_setscreen |
|
- | 217 | ||
- | 218 | ;! mov [GF.disable_mouse],vm_dummy |
|
222 | mov [GF.setscreen],vm_mike_setscreen |
219 | ;! mov [GF.draw_pointer],vm_dummy |
223 | 220 | ||
224 | inc [call_cnt] |
221 | inc [call_cnt] |
225 | xor eax,eax |
222 | xor eax,eax |
226 | .exit.3: |
223 | .exit.3: |
227 | retn |
224 | retn |
228 | .exit: |
225 | .exit: |
229 | xor eax,eax |
226 | xor eax,eax |
230 | dec eax |
227 | dec eax |
Line -... | Line 228... | ||
- | 228 | retn |
|
- | 229 | endf |
|
- | 230 | ||
- | 231 | func vm_dummy |
|
- | 232 | begin |
|
231 | retn |
233 | ret |
232 | endf |
234 | endf |
233 | 235 | ||
234 | func vm_mike_calculatescreen |
236 | func vm_mike_calculatescreen |
235 | begin |
237 | begin |
236 | ; call [SF.calculatescreen] |
238 | ; call [SF.calculatescreen] |
237 | .direct: |
239 | .direct: |
238 | pushad |
240 | pushad |
239 | cli |
241 | cli |
240 | movzx ecx,word[0x00003004] ; number of processes |
242 | movzx ecx,word[TASK_COUNT] ; number of processes |
241 | lea edi,[CLIP_RECTS+ecx*4+4] |
243 | lea edi,[CLIP_RECTS+ecx*4+4] |
242 | push dword[0x00003000] |
244 | push dword[CURRENT_TASK] |
243 | xor eax,eax |
245 | xor eax,eax |
244 | .next_window: |
246 | .next_window: |
245 | inc eax |
247 | inc eax |
246 | push ecx ebx eax edi |
248 | push ecx ebx eax edi |
247 | mov [0x00003000],ax |
249 | mov [CURRENT_TASK],ax |
248 | call calc_clipping_rects |
250 | call calc_clipping_rects |
249 | pop edi eax ebx |
251 | pop edi eax ebx |
250 | mov [CLIP_RECTS+eax*4],edi |
252 | mov [CLIP_RECTS+eax*4],edi |
251 | mov [edi],ecx |
253 | mov [edi],ecx |
252 | add edi,4 |
254 | add edi,4 |
253 | shl ecx,2 |
255 | shl ecx,2 |
254 | rep movsd |
256 | rep movsd |
255 | pop ecx |
257 | pop ecx |
256 | loop .next_window |
258 | loop .next_window |
257 | pop dword[0x00003000] |
259 | pop dword[CURRENT_TASK] |
258 | sti |
260 | sti |
Line 348... | Line 350... | ||
348 | endf |
350 | endf |
Line 349... | Line 351... | ||
349 | 351 | ||
350 | func get_cursor_rect |
352 | func get_cursor_rect |
351 | begin |
353 | begin |
352 | push eax |
354 | push eax |
353 | movsx eax,word[0x0000FB0A] |
355 | movsx eax,word[MOUSE_X] |
354 | mov [tr.left],eax |
356 | mov [tr.left],eax |
355 | add eax,31 |
357 | add eax,31 |
356 | mov [tr.right],eax |
358 | mov [tr.right],eax |
357 | movsx eax,word[0x0000FB0C] |
359 | movsx eax,word[MOUSE_Y] |
358 | mov [tr.top],eax |
360 | mov [tr.top],eax |
359 | add eax,31 |
361 | add eax,31 |
360 | mov [tr.bottom],eax |
362 | mov [tr.bottom],eax |
361 | pop eax |
363 | pop eax |
Line 434... | Line 436... | ||
434 | push eax edx |
436 | push eax edx |
435 | mov eax,[esp+4*3] |
437 | mov eax,[esp+4*3] |
436 | mov ebp,eax |
438 | mov ebp,eax |
437 | shr eax,16 |
439 | shr eax,16 |
438 | sub al,0x0A |
440 | sub al,0x0A |
439 | cmp al,[0xfff2] |
441 | cmp al,[BANK_RW] |
440 | je .exit |
442 | je .exit |
441 | mov [0xfff2],al |
443 | mov [BANK_RW],al |
Line 442... | Line 444... | ||
442 | 444 | ||
443 | mov dx,3CEh |
445 | mov dx,3CEh |
444 | mov ah,al ; Save value for later use |
446 | mov ah,al ; Save value for later use |
445 | mov al,10h ; Index GR10 (Address Mapping) |
447 | mov al,10h ; Index GR10 (Address Mapping) |
Line 455... | Line 457... | ||
455 | mov al,ah ; Write address |
457 | mov al,ah ; Write address |
456 | out dx,al ; Write the value |
458 | out dx,al ; Write the value |
Line 457... | Line 459... | ||
457 | 459 | ||
458 | .exit: |
460 | .exit: |
459 | and ebp,0x0000FFFF |
461 | and ebp,0x0000FFFF |
460 | add ebp,0x000A0000 |
462 | add ebp,VGABasePtr |
461 | pop edx eax |
463 | pop edx eax |
462 | sti |
464 | sti |
463 | ret |
465 | ret |
Line 472... | Line 474... | ||
472 | push eax edx ecx |
474 | push eax edx ecx |
473 | mov eax,[esp+4*4] |
475 | mov eax,[esp+4*4] |
474 | mov ebp,eax |
476 | mov ebp,eax |
475 | shr eax,16 |
477 | shr eax,16 |
476 | sub al,0x0A |
478 | sub al,0x0A |
477 | cmp al,[0xfff2] |
479 | cmp al,[BANK_RW] |
478 | je .exit |
480 | je .exit |
479 | mov [0xfff2],al |
481 | mov [BANK_RW],al |
Line 480... | Line 482... | ||
480 | 482 | ||
481 | mov cl,al |
483 | mov cl,al |
482 | mov dx,0x3D4 |
484 | mov dx,0x3D4 |
483 | mov al,0x38 |
485 | mov al,0x38 |
Line 535... | Line 537... | ||
535 | xor al,al |
537 | xor al,al |
536 | out dx,al |
538 | out dx,al |
Line 537... | Line 539... | ||
537 | 539 | ||
538 | .exit: |
540 | .exit: |
539 | and ebp,0x0000FFFF |
541 | and ebp,0x0000FFFF |
540 | add ebp,0x000A0000 |
542 | add ebp,VGABasePtr |
541 | pop ecx edx eax |
543 | pop ecx edx eax |
542 | sti |
544 | sti |
543 | ret |
545 | ret |
Line 551... | Line 553... | ||
551 | push eax edx |
553 | push eax edx |
552 | mov eax,[esp+4*3] |
554 | mov eax,[esp+4*3] |
553 | mov ebp,eax |
555 | mov ebp,eax |
554 | shr eax,16 |
556 | shr eax,16 |
555 | sub al,0x0A |
557 | sub al,0x0A |
556 | cmp al,[0xfff2] |
558 | cmp al,[BANK_RW] |
557 | je .exit |
559 | je .exit |
558 | mov [0xfff2],al |
560 | mov [BANK_RW],al |
Line 559... | Line 561... | ||
559 | 561 | ||
560 | mov ah,al |
562 | mov ah,al |
561 | ; grrrr...mode-set locked the S3 registers, so unlock them again |
563 | ; grrrr...mode-set locked the S3 registers, so unlock them again |
562 | ; xxx - do this after mode-set |
564 | ; xxx - do this after mode-set |
Line 582... | Line 584... | ||
582 | or al,ah |
584 | or al,ah |
583 | out dx,al |
585 | out dx,al |
Line 584... | Line 586... | ||
584 | 586 | ||
585 | .exit: |
587 | .exit: |
586 | and ebp,0x0000FFFF |
588 | and ebp,0x0000FFFF |
587 | add ebp,0x000A0000 |
589 | add ebp,VGABasePtr |
588 | pop edx eax |
590 | pop edx eax |
589 | sti |
591 | sti |
590 | ret |
592 | ret |
Line 597... | Line 599... | ||
597 | push eax edx |
599 | push eax edx |
598 | mov eax,[esp+4*3] |
600 | mov eax,[esp+4*3] |
599 | mov ebp,eax |
601 | mov ebp,eax |
600 | shr eax,16 |
602 | shr eax,16 |
601 | sub al,0x0A |
603 | sub al,0x0A |
602 | cmp al,[0xfff2] |
604 | cmp al,[BANK_RW] |
603 | je .exit |
605 | je .exit |
604 | mov [0xfff2],al |
606 | mov [BANK_RW],al |
Line 605... | Line 607... | ||
605 | 607 | ||
606 | mov ah,al |
608 | mov ah,al |
607 | mov dx,0x03D4 |
609 | mov dx,0x03D4 |
608 | mov al,0x39 |
610 | mov al,0x39 |
Line 624... | Line 626... | ||
624 | out dx,al |
626 | out dx,al |
625 | dec dl |
627 | dec dl |
Line 626... | Line 628... | ||
626 | 628 | ||
627 | .exit: |
629 | .exit: |
628 | and ebp,0x0000FFFF |
630 | and ebp,0x0000FFFF |
629 | add ebp,0x000A0000 |
631 | add ebp,VGABasePtr |
630 | pop edx eax |
632 | pop edx eax |
631 | sti |
633 | sti |
632 | ret |
634 | ret |