Detect VGA Sub-System ???
Posted: Mon Apr 25, 2011 2:00 am
I used RBIL to make this, is it enough to be proper?
Code: Select all
; Get display combination code.
; See RBIL INTERRUP.A - V-101A00.
mov ax,1A00h
int 10h
cmp al,1Ah ; AL = 1Ah if function is supported.
jne @@novga
; BL = Active display code.
; BH = Alternate display code.
cmp bl,8 ; Is color analog VGA active?
jne @@novga
; Make sure an ATI EGA Wonder isnt lying to us.
; See RBIL INTERRUP.A - V-101A00 and V-101C.
mov ax,1C00h ; Video save/restore state function.
mov cx,2 ; Only video hardware (CX=0) is supported on EGA Wonder.
int 10h ; So lets check for color registers and DAC state. (CX=2)
cmp al,1Ch ; AL = 1Ch if function is supported.
jne @@novga
; Yes, we have an active color analog VGA!
mov ax,1 ; Indicate success, VGA support was detected!
jmp @@done
@@novga:
xor ax,ax ; Indicate failure, no VGA was detected!
@@done:
ret