home *** CD-ROM | disk | FTP | other *** search
- ; VIDADAPT.ASM
- ;
- ; aus DOS 7'90 S.140ff
- ;
- ; function video_adapter: byte;
-
- code segment word public
- assume cs:code
-
- video_adapter proc far
- public video_adapter
-
- ; Prüfung auf MCGA und VGA:
- mov ax,1A00h ; Die Funktion $1A des Int. $10 wird nur
- int 10h ; vom PS/2- und VGA-BIOS unterstützt
- cmp al,1Ah
- jne kein_ps2
- cmp bl,0FFh ; unbekannte Karte
- je kein_ps2
- cmp bl,0 ; keine Karte
- je kein_ps2
-
- cmp bl,3
- je kein_ps2
- cmp bl,6
- je kein_ps2
- cmp bl,9
- je kein_ps2
- xor bh,bh
- mov al,cs:tabelle[bx]
- ret
-
- kein_ps2:
- ; Prüfung auf EGA:
- mov bl,10h ; Die Funktion $12 des Int. $10 wird nur
- mov ah,12h ; vom EGA-BIOS unterstützt
- int 10h
- cmp bl,10h
- je kein_ega
- mov al,4
- ret
-
- kein_ega:
- ; Prüfung auf CGA:
- mov ah,0Fh
- int 10h
- cmp al,7
- je hgc_mda_moeglich
- mov dx,3D4h
- call suche_crtc
- cmp al,0
- je hgc_mda_moeglich
- mov al,2
- ret
-
- hgc_mda_moeglich:
- ; Prüfung auf HGC / MDA:
- mov dx,3B4h
- call suche_crtc
- cmp al,0
- je unbekannt
- mov dx,3BAh
- in al,dx
- and al,80h
- mov ah,al
- mov cx,9000h
- bit_7_loop:
- in al,dx
- and al,80h
- cmp ah,al
- loope bit_7_loop
- cmp ah,al
- je mda_da
- mov al,3
- ret
- mda_da:
- mov al,1
- ret
-
- unbekannt:
- mov al,0FFh
- ret
-
- suche_crtc proc near
-
- register equ 0Eh
- pruef_wert equ 8
-
- mov al,register
- out dx,al
- inc dx
- in al,dx
- mov ah,al
- mov al,pruef_wert
- out dx,al
- mov cx,3000
- warte: loop warte
- in al,dx
- xchg al,ah
- out dx,al
- mov al,0
- cmp ah,pruef_wert
- je crtc_da
- ret
- crtc_da:
- mov al,1
- ret
- suche_crtc endp
-
- tabelle db 0,1,2,0,4,4,0,6,6,0,5,5,5
-
- video_adapter endp
-
- code ends
- end