Rev 314 | Rev 381 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 314 | Rev 379 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | ;ret |
44 | ;ret |
Line 45... | Line 45... | ||
45 | 45 | ||
46 | 46 | ||
47 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
47 | ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
48 | ; set_bank for S3 videocards, work on S3 ViRGE PCI (325) |
48 | ; set_bank for S3 videocards, work on S3 ViRGE PCI (325) |
49 | ; modified by kmeaw |
49 | ; modified by kmeaw |
50 | set_bank: |
50 | set_bank: |
51 | pushfd |
51 | pushfd |
52 | cli |
52 | cli |
53 | cmp al,[0xfff2] |
53 | cmp al,[0xfff2] |
54 | je retsb |
54 | je retsb |
55 | mov [0xfff2],al |
55 | mov [0xfff2],al |
56 | push ax |
56 | push ax |
57 | push dx |
57 | push dx |
58 | push cx |
58 | push cx |
59 | mov cl, al |
59 | mov cl, al |
60 | mov dx, 0x3D4 |
60 | mov dx, 0x3D4 |
61 | mov al, 0x38 |
61 | mov al, 0x38 |
62 | out dx, al ;CR38 Register Lock 1 ;Note: Traditionally 48h is used to |
62 | out dx, al ;CR38 Register Lock 1 ;Note: Traditionally 48h is used to |
63 | ;unlock and 00h to lock |
63 | ;unlock and 00h to lock |
64 | inc dx |
64 | inc dx |
65 | mov al, 0x48 |
65 | mov al, 0x48 |
66 | out dx, al ;3d5 -? |
66 | out dx, al ;3d5 -? |
67 | dec dx |
67 | dec dx |
68 | mov al, 0x31 |
68 | mov al, 0x31 |
69 | out dx, al ;CR31 Memory Configuration Register |
69 | out dx, al ;CR31 Memory Configuration Register |
70 | ;0 Enable Base Address Offset (CPUA BASE). Enables bank operation if set, ;disables if clear. |
70 | ;0 Enable Base Address Offset (CPUA BASE). Enables bank operation if set, ;disables if clear. |
Line 71... | Line 71... | ||
71 | ;4-5 Bit 16-17 of the Display Start Address. For the 801/5,928 see index 51h, |
71 | ;4-5 Bit 16-17 of the Display Start Address. For the 801/5,928 see index 51h, |
72 | ;for the 864/964 see index 69h. |
72 | ;for the 864/964 see index 69h. |
73 | 73 | ||
74 | inc dx |
74 | inc dx |
75 | in al, dx |
75 | in al, dx |
76 | dec dx |
76 | dec dx |
77 | mov ah, al |
77 | mov ah, al |
78 | mov al, 0x31 |
78 | mov al, 0x31 |
79 | out dx, ax |
79 | out dx, ax |
80 | mov al, ah |
80 | mov al, ah |
81 | or al, 9 |
81 | or al, 9 |
82 | inc dx |
82 | inc dx |
83 | out dx, al |
83 | out dx, al |
84 | dec dx |
84 | dec dx |
85 | mov al, 0x35 |
85 | mov al, 0x35 |
86 | out dx, al ;CR35 CRT Register Lock |
86 | out dx, al ;CR35 CRT Register Lock |
87 | inc dx |
87 | inc dx |
88 | in al, dx |
88 | in al, dx |
89 | dec dx |
89 | dec dx |
90 | and al, 0xF0 |
90 | and al, 0xF0 |
91 | mov ch, cl |
91 | mov ch, cl |
92 | and ch, 0x0F |
92 | and ch, 0x0F |
93 | or ch, al |
93 | or ch, al |
94 | mov al, 0x35 |
94 | mov al, 0x35 |
95 | out dx, al |
95 | out dx, al |
96 | inc dx |
96 | inc dx |
97 | mov al, ch |
97 | mov al, ch |
98 | out dx, ax |
98 | out dx, ax |
99 | dec dx |
99 | dec dx |
100 | mov al, 0x51 ;Extended System Control 2 Register |
100 | mov al, 0x51 ;Extended System Control 2 Register |
101 | out dx, al |
101 | out dx, al |
102 | inc dx |
102 | inc dx |
103 | in al, dx |
103 | in al, dx |
104 | dec dx |
104 | dec dx |
105 | and al, 0xF3 |
105 | and al, 0xF3 |
106 | shr cl, 2 |
106 | shr cl, 2 |
107 | and cl, 0x0C |
107 | and cl, 0x0C |
108 | or cl, al |
108 | or cl, al |
109 | mov al, 0x51 |
109 | mov al, 0x51 |
110 | out dx, al |
110 | out dx, al |
111 | inc dx |
111 | inc dx |
112 | mov al, cl |
112 | mov al, cl |
113 | out dx, al |
113 | out dx, al |
114 | dec dx |
114 | dec dx |
115 | mov al, 0x38 |
115 | mov al, 0x38 |
116 | out dx, al |
116 | out dx, al |
117 | inc dx |
117 | inc dx |
118 | xor al, al |
118 | xor al, al |
119 | out dx, al |
119 | out dx, al |
120 | dec dx |
120 | dec dx |
121 | pop cx |
121 | pop cx |
122 | pop dx |
122 | pop dx |
123 | pop ax |
123 | pop ax |
Line 124... | Line 124... | ||
124 | retsb: |
124 | retsb: |
125 | popfd |
125 | popfd |
Line 362... | Line 362... | ||
362 | push edi |
362 | push edi |
363 | push eax |
363 | push eax |
364 | push ebx |
364 | push ebx |
365 | push ecx |
365 | push ecx |
366 | push edx |
366 | push edx |
367 | mov ecx,[0x3010] |
367 | mov ecx,[TASK_BASE] |
368 | add eax,[ecx-twdw+WDATA.box.left] |
368 | add eax,[ecx-twdw+WDATA.box.left] |
369 | add ebx,[ecx-twdw+WDATA.box.top] |
369 | add ebx,[ecx-twdw+WDATA.box.top] |
370 | push eax |
370 | push eax |
371 | mov eax,ebx ; y |
371 | mov eax,ebx ; y |
372 | mov ebx,[0xfe08] |
372 | mov ebx,[0xfe08] |
Line 400... | Line 400... | ||
400 | 400 | ||
Line 401... | Line 401... | ||
401 | ; check limits ? |
401 | ; check limits ? |
402 | 402 | ||
403 | push eax |
403 | push eax |
404 | push ecx |
404 | push ecx |
405 | mov eax,[0x3010] |
405 | mov eax,[TASK_BASE] |
406 | mov ecx,[eax+draw_data-0x3000+RECT.left] |
406 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.left] |
407 | cmp ecx,0 |
407 | cmp ecx,0 |
408 | jnz dbcblimitlset12 |
408 | jnz dbcblimitlset12 |
409 | mov ecx,[eax+draw_data-0x3000+RECT.top] |
409 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.top] |
410 | cmp ecx,0 |
410 | cmp ecx,0 |
411 | jnz dbcblimitlset12 |
411 | jnz dbcblimitlset12 |
412 | mov ecx,[eax+draw_data-0x3000+RECT.right] |
412 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
413 | cmp ecx,[0xfe00] |
413 | cmp ecx,[0xfe00] |
414 | jnz dbcblimitlset12 |
414 | jnz dbcblimitlset12 |
415 | mov ecx,[eax+draw_data-0x3000+RECT.bottom] |
415 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
416 | cmp ecx,[0xfe04] |
416 | cmp ecx,[0xfe04] |
417 | jnz dbcblimitlset12 |
417 | jnz dbcblimitlset12 |
418 | pop ecx |
418 | pop ecx |
Line 460... | Line 460... | ||
460 | mov eax,edi |
460 | mov eax,edi |
461 | sub eax,[0xfe80] |
461 | sub eax,[0xfe80] |
462 | mov ebx,3 |
462 | mov ebx,3 |
463 | div ebx |
463 | div ebx |
464 | add eax,WinMapAddress |
464 | add eax,WinMapAddress |
465 | mov ebx,[0x3000] |
465 | mov ebx,[CURRENT_TASK] |
466 | cld |
466 | cld |
Line 467... | Line 467... | ||
467 | 467 | ||
Line 468... | Line 468... | ||
468 | dbnp2412: |
468 | dbnp2412: |
Line 551... | Line 551... | ||
551 | 551 | ||
552 | mov eax,edi |
552 | mov eax,edi |
553 | sub eax,[0xfe80] |
553 | sub eax,[0xfe80] |
554 | shr eax,2 |
554 | shr eax,2 |
555 | add eax,WinMapAddress |
555 | add eax,WinMapAddress |
556 | mov ebx,[0x3000] |
556 | mov ebx,[CURRENT_TASK] |
Line 557... | Line 557... | ||
557 | cld |
557 | cld |
Line 558... | Line 558... | ||
558 | 558 | ||
Line 729... | Line 729... | ||
729 | push ebx |
729 | push ebx |
730 | push ecx |
730 | push ecx |
731 | push edx |
731 | push edx |
732 | movzx eax,word [esp+2] |
732 | movzx eax,word [esp+2] |
733 | movzx ebx,word [esp+0] |
733 | movzx ebx,word [esp+0] |
734 | mov ecx,[0x3010] |
734 | mov ecx,[TASK_BASE] |
735 | add eax,[ecx-twdw+WDATA.box.left] |
735 | add eax,[ecx-twdw+WDATA.box.left] |
736 | add ebx,[ecx-twdw+WDATA.box.top] |
736 | add ebx,[ecx-twdw+WDATA.box.top] |
737 | push eax |
737 | push eax |
738 | mov eax,ebx ; y |
738 | mov eax,ebx ; y |
739 | mul dword [0xfe08] |
739 | mul dword [0xfe08] |
Line 758... | Line 758... | ||
758 | movzx ebx,word [esp+4] |
758 | movzx ebx,word [esp+4] |
Line 759... | Line 759... | ||
759 | 759 | ||
Line 760... | Line 760... | ||
760 | ; check limits while draw ? |
760 | ; check limits while draw ? |
761 | 761 | ||
762 | push ecx |
762 | push ecx |
763 | mov eax,[0x3010] |
763 | mov eax,[TASK_BASE] |
764 | cmp dword [eax+draw_data-0x3000+RECT.left], 0 |
764 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.left], 0 |
765 | jnz dbcblimitlset212 |
765 | jnz dbcblimitlset212 |
766 | cmp dword [eax+draw_data-0x3000+RECT.top], 0 |
766 | cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0 |
767 | jnz dbcblimitlset212 |
767 | jnz dbcblimitlset212 |
768 | mov ecx,[eax+draw_data-0x3000+RECT.right] |
768 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right] |
769 | cmp ecx,[0xfe00] |
769 | cmp ecx,[0xfe00] |
770 | jnz dbcblimitlset212 |
770 | jnz dbcblimitlset212 |
771 | mov ecx,[eax+draw_data-0x3000+RECT.bottom] |
771 | mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom] |
772 | cmp ecx,[0xfe04] |
772 | cmp ecx,[0xfe04] |
773 | jnz dbcblimitlset212 |
773 | jnz dbcblimitlset212 |
774 | pop ecx |
774 | pop ecx |
Line 796... | Line 796... | ||
796 | mov edx,edi |
796 | mov edx,edi |
797 | sub edx,[0xfe80] |
797 | sub edx,[0xfe80] |
798 | mov ebx,3 |
798 | mov ebx,3 |
799 | div ebx |
799 | div ebx |
800 | add edx,WinMapAddress |
800 | add edx,WinMapAddress |
801 | mov ebx,[0x3000] |
801 | mov ebx,[CURRENT_TASK] |
802 | mov bh,[esp+4*3] |
802 | mov bh,[esp+4*3] |
Line 803... | Line 803... | ||
803 | 803 | ||
Line 804... | Line 804... | ||
804 | np2412: |
804 | np2412: |
Line 865... | Line 865... | ||
865 | 865 | ||
866 | mov edx,edi |
866 | mov edx,edi |
867 | sub edx,[0xfe80] |
867 | sub edx,[0xfe80] |
868 | shr edx,2 |
868 | shr edx,2 |
869 | add edx,WinMapAddress |
869 | add edx,WinMapAddress |
870 | mov ebx,[0x3000] |
870 | mov ebx,[CURRENT_TASK] |
Line 871... | Line 871... | ||
871 | mov bh,[esp+4*3] |
871 | mov bh,[esp+4*3] |
Line 872... | Line 872... | ||
872 | 872 |