Subversion Repositories Kolibri OS

Rev

Rev 593 | Rev 753 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 593 Rev 673
Line 13... Line 13...
13
;;                                                              ;;
13
;;                                                              ;;
14
;;  See file COPYING for details                                ;;
14
;;  See file COPYING for details                                ;;
15
;;                                                              ;;
15
;;                                                              ;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 17... Line 17...
17
 
17
 
-
 
18
$Revision: 673 $
-
 
19
 
-
 
20
 
-
 
21
TRIDENT       equ 0
-
 
22
S3_VIDEO      equ 0
-
 
23
INTEL_VIDEO   equ 0
-
 
24
 
-
 
25
if TRIDENT
-
 
26
  if S3_VIDEO or INTEL_VIDEO
-
 
27
    stop
-
 
28
  end if
-
 
29
end if
-
 
30
 
-
 
31
if S3_VIDEO
-
 
32
  if TRIDENT or INTEL_VIDEO
-
 
33
    stop
-
 
34
  end if
-
 
35
end if
-
 
36
 
-
 
37
if INTEL_VIDEO
-
 
38
  if S3_VIDEO or TRIDENT
-
 
39
    stop
-
 
40
  end if
Line 18... Line 41...
18
$Revision: 593 $
41
end if
19
 
42
 
20
 
43
 
Line 33... Line 56...
33
; for different Vesa 1.2 setups.
56
; for different Vesa 1.2 setups.
Line 34... Line 57...
34
 
57
 
35
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
58
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
36
; set_bank for Trident videocards, work on Trident 9440
59
; set_bank for Trident videocards, work on Trident 9440
37
; modified by Mario79
-
 
38
;set_bank:
-
 
39
;cli
-
 
40
;cmp al,[BANK_RW]
-
 
41
;je retsb
-
 
42
;mov [BANK_RW],al
-
 
43
;push dx
-
 
44
;mov dx,3D8h
-
 
45
;out  dx,al
-
 
46
;pop dx
-
 
47
;retsb:
-
 
48
;sti
-
 
Line -... Line 60...
-
 
60
; modified by Mario79
-
 
61
 
-
 
62
if TRIDENT
-
 
63
set_bank:
-
 
64
           pushfd
-
 
65
           cli
-
 
66
           cmp al,[BANK_RW]
-
 
67
           je .retsb
-
 
68
 
-
 
69
           mov [BANK_RW],al
-
 
70
           push dx
-
 
71
           mov dx,3D8h
-
 
72
           out  dx,al
-
 
73
           pop dx
-
 
74
.retsb:
-
 
75
           popfd
Line 49... Line 76...
49
;ret
76
           ret
50
 
77
end if
51
 
78
 
-
 
79
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
 
80
; set_bank for S3 videocards, work on S3 ViRGE PCI (325)
52
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
81
; modified by kmeaw
53
; set_bank for S3 videocards, work on S3 ViRGE PCI (325)
82
 
54
; modified by kmeaw
83
if S3_VIDEO
55
set_bank:
84
set_bank:
56
pushfd
85
           pushfd
-
 
86
           cli
57
cli
87
           cmp al,[BANK_RW]
58
cmp al,[BANK_RW]
88
           je .retsb
59
je retsb
89
 
60
mov [BANK_RW],al
90
           mov [BANK_RW],al
61
push ax
91
           push ax
Line 124... Line 154...
124
out dx, al
154
           out dx, al
125
dec dx
155
           dec dx
126
pop cx
156
           pop cx
127
pop dx
157
           pop dx
128
pop ax
158
           pop ax
129
retsb:
159
.retsb:
130
popfd
160
           popfd
131
ret
161
           ret
-
 
162
end if
Line 132... Line 163...
132
 
163
 
133
;Set bank function for Intel 810/815 chipsets
164
;Set bank function for Intel 810/815 chipsets
134
; *****Modified by Protopopius, Russia.*****
165
; *****Modified by Protopopius, Russia.*****
135
; ********* http://menuetos.hut.ru **************
166
; ********* http://menuetos.hut.ru **************
-
 
167
; ************************************************
-
 
168
 
136
; ************************************************
169
if INTEL_VIDEO
137
;
170
 
-
 
171
set_bank:
-
 
172
           pushfd
138
;set_bank:
173
           cli
139
;cli
174
 
140
;cmp al,[BANK_RW]
175
           cmp al,[BANK_RW]
-
 
176
           je .retsb
141
;je retsb
177
 
142
;mov [BANK_RW],al
178
           mov [BANK_RW],al
143
;push ax
179
           push ax
144
;push dx
180
           push dx
145
;mov dx,3CEh
181
           mov dx,3CEh
146
;mov ah,al            ; Save value for later use
182
           mov ah,al            ; Save value for later use
147
;mov al,10h           ; Index GR10 (Address Mapping)
183
           mov al,10h           ; Index GR10 (Address Mapping)
148
;out dx,al            ; Select GR10
184
           out dx,al            ; Select GR10
149
;inc dl
185
           inc dl
150
;mov al,3             ; Set bits 0 and 1 (Enable linear page mapping)
186
           mov al,3             ; Set bits 0 and 1 (Enable linear page mapping)
151
;out dx,al            ; Write value
187
           out dx,al            ; Write value
152
;dec dl
188
           dec dl
153
;mov al,11h           ; Index GR11 (Page Selector)
189
           mov al,11h           ; Index GR11 (Page Selector)
154
;out dx,al            ; Select GR11
190
           out dx,al            ; Select GR11
155
;inc dl
191
           inc dl
156
;mov al,ah            ; Write address
192
           mov al,ah            ; Write address
157
;out dx,al            ; Write the value
193
           out dx,al            ; Write the value
158
;pop dx
194
           pop dx
159
;pop ax
195
           pop ax
-
 
196
.retsb:
160
;retsb:
197
           popfd
161
;sti
198
           ret
Line 162... Line 199...
162
;ret
199
end if
Line -... Line 200...
-
 
200
 
-
 
201
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
163
 
202
 
-
 
203
if (TRIDENT or S3_VIDEO or INTEL_VIDEO)
164
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
204
else
-
 
205
set_bank:
165
 
206
           pushfd
166
;set_bank:
207
           cli
-
 
208
 
167
;   cli
209
           cmp al,[BANK_RW]
168
;   cmp al,[BANK_RW]
210
           je .retsb
169
;   je retsb
211
 
170
;   mov [BANK_RW],al
212
           mov [BANK_RW],al
171
;   push ax
213
           push ax
172
;   push dx
214
           push dx
173
;   mov ah,al
215
           mov ah,al
174
;   mov dx,0x03D4
216
           mov dx,0x03D4
175
;   mov al,0x39
217
           mov al,0x39
176
;   out dx,al
218
           out dx,al
177
;   inc dl
219
           inc dl
178
;   mov al,0xA5
220
           mov al,0xA5
179
;   out dx,al
221
           out dx,al
180
;   dec dl
222
           dec dl
181
;   mov al,6Ah
223
           mov al,6Ah
182
;   out dx,al
224
           out dx,al
183
;   inc dl
225
           inc dl
184
;   mov al,ah
226
           mov al,ah
185
;   out dx,al
227
           out dx,al
186
;   dec dl
228
           dec dl
187
;   mov al,0x39
229
           mov al,0x39
188
;   out dx,al
230
           out dx,al
189
;   inc dl
231
           inc dl
190
;   mov al,0x5A
232
           mov al,0x5A
191
;   out dx,al
233
           out dx,al
192
;   dec dl
-
 
193
;   pop dx
-
 
194
;   pop ax
-
 
Line -... Line 234...
-
 
234
           dec dl
-
 
235
           pop dx
-
 
236
           pop ax
-
 
237
 
Line 195... Line 238...
195
;
238
.retsb:
Line 196... Line 239...
196
; retsb:
239
           popfd
Line 288... Line 331...
288
        jnz   v12nbgp
331
        jnz   v12nbgp
289
        mov   eax,[BytesPerScanLine]
332
        mov   eax,[BytesPerScanLine]
290
        mov   ebx,edi
333
        mov   ebx,edi
291
        mul   ebx
334
        mul   ebx
292
        add   eax,esi
335
        add   eax, esi
293
        add   eax,esi
-
 
294
        add   eax,esi
336
        lea   eax, [VGABasePtr+eax+esi*2]
295
        cmp   [ScreenBPP],byte 24
337
        cmp   [ScreenBPP],byte 24
296
        jz    v12bgl3
338
        jz    v12bgl3
297
        add   eax,esi
339
        add   eax,esi
Line 298... Line 340...
298
 
340
 
Line 299... Line 341...
299
      v12bgl3:
341
      v12bgl3:
300
 
342
 
Line 301... Line 343...
301
        push ebx
343
        push ebx
Line 302... Line 344...
302
        push eax
344
        push eax
303
 
345
 
304
        sub  eax,[LFBAddress]
346
        sub  eax,VGABasePtr
305
 
347
 
Line 370... Line 412...
370
    jz   dbpi2412
412
    jz   dbpi2412
371
    add  eax,ecx
413
    add  eax,ecx
Line 372... Line 414...
372
 
414
 
Line 373... Line 415...
373
  dbpi2412:
415
  dbpi2412:
374
 
416
 
Line 375... Line 417...
375
    add  eax,[LFBAddress]
417
    add  eax,VGABasePtr
Line 376... Line 418...
376
    mov  edi,eax
418
    mov  edi,eax
Line 447... Line 489...
447
    push edi
489
    push edi
448
    push ecx
490
    push ecx
Line 449... Line 491...
449
 
491
 
450
      xor  edx,edx
492
      xor  edx,edx
451
      mov  eax,edi
493
      mov  eax,edi
452
      sub  eax,[LFBAddress]
494
      sub  eax,VGABasePtr
453
      mov  ebx,3
495
      mov  ebx,3
454
      div  ebx
496
      div  ebx
455
      add  eax,WinMapAddress
497
      add  eax,WinMapAddress
456
      mov   ebx,[CURRENT_TASK]
498
      mov   ebx,[CURRENT_TASK]
Line 470... Line 512...
470
 
512
 
Line 471... Line 513...
471
     dbimp24yes12:
513
     dbimp24yes12:
472
 
514
 
473
        push edi
515
        push edi
474
        mov  eax,edi
516
        mov  eax,edi
475
        sub  eax,[LFBAddress]
517
        sub  eax,VGABasePtr
476
        shr  eax,16
518
        shr  eax,16
477
        call set_bank
519
        call set_bank
478
        and  edi,0xffff
520
        and  edi,0xffff
Line 539... Line 581...
539
    push ebx
581
    push ebx
540
    push edi
582
    push edi
541
    push ecx
583
    push ecx
Line 542... Line 584...
542
 
584
 
543
      mov  eax,edi
585
      mov  eax,edi
544
      sub  eax,[LFBAddress]
586
      sub  eax,VGABasePtr
545
      shr  eax,2
587
      shr  eax,2
546
      add  eax,WinMapAddress
588
      add  eax,WinMapAddress
547
      mov   ebx,[CURRENT_TASK]
589
      mov   ebx,[CURRENT_TASK]
Line 561... Line 603...
561
 
603
 
Line 562... Line 604...
562
      dbimp32yes12:
604
      dbimp32yes12:
563
 
605
 
564
        push edi
606
        push edi
565
        mov  eax,edi
607
        mov  eax,edi
566
        sub  eax,[LFBAddress]
608
        sub  eax,VGABasePtr
567
        shr  eax,16
609
        shr  eax,16
568
        call set_bank
610
        call set_bank
569
        and  edi,0xffff
611
        and  edi,0xffff
Line 736... Line 778...
736
    jz   pi2412
778
    jz   pi2412
737
    add  eax,ecx
779
    add  eax,ecx
Line 738... Line 780...
738
 
780
 
Line 739... Line 781...
739
  pi2412:
781
  pi2412:
740
 
782
 
Line 741... Line 783...
741
    add  eax,[LFBAddress]
783
    add  eax,VGABasePtr
Line 742... Line 784...
742
    mov  edi,eax
784
    mov  edi,eax
Line 783... Line 825...
783
    push edi
825
    push edi
784
    push ecx
826
    push ecx
785
    push ebx
827
    push ebx
Line 786... Line 828...
786
 
828
 
787
      mov  edx,edi
829
      mov  edx,edi
788
      sub  edx,[LFBAddress]
830
      sub  edx,VGABasePtr
789
      mov  ebx,3
831
      mov  ebx,3
790
      div  ebx
832
      div  ebx
791
      add  edx,WinMapAddress
833
      add  edx,WinMapAddress
792
      mov  ebx,[CURRENT_TASK]
834
      mov  ebx,[CURRENT_TASK]
Line 807... Line 849...
807
     imp24yes12:
849
     imp24yes12:
Line 808... Line 850...
808
 
850
 
809
        push edi
851
        push edi
810
        push eax
852
        push eax
811
        mov  eax,edi
853
        mov  eax,edi
812
        sub  eax,[LFBAddress]
854
        sub  eax,VGABasePtr
813
        shr  eax,16
855
        shr  eax,16
814
        call set_bank
856
        call set_bank
815
        pop  eax
857
        pop  eax
816
        and  edi,0xffff
858
        and  edi,0xffff
Line 853... Line 895...
853
    push edi
895
    push edi
854
    push ecx
896
    push ecx
855
    push ebx
897
    push ebx
Line 856... Line 898...
856
 
898
 
857
      mov  edx,edi
899
      mov  edx,edi
858
      sub  edx,[LFBAddress]
900
      sub  edx,VGABasePtr
859
      shr  edx,2
901
      shr  edx,2
860
      add  edx,WinMapAddress
902
      add  edx,WinMapAddress
861
      mov   ebx,[CURRENT_TASK]
903
      mov   ebx,[CURRENT_TASK]
Line 876... Line 918...
876
      imp32yes12:
918
      imp32yes12:
Line 877... Line 919...
877
 
919
 
878
        push edi
920
        push edi
879
        push eax
921
        push eax
880
        mov  eax,edi
922
        mov  eax,edi
881
        sub  eax,[LFBAddress]
923
        sub  eax,VGABasePtr
882
        shr  eax,16
924
        shr  eax,16
883
        call set_bank
925
        call set_bank
884
        pop  eax
926
        pop  eax
885
        and  edi,0xffff
927
        and  edi,0xffff