home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ;/*
- ;** vidtype.asm
- ;** contains: vidtype()
- ;*/
- ifndef _LCODE
- include model.h
- endif
- include prologue.h
- name vidtype
-
- MONOCHROME equ 1 ;monochrome adapter
- CGA equ 2 ;CGA adapter
- EGA equ 3 ;EGA adapter
- VGA equ 4 ;VGA adapter
-
- VIDEOINT equ 010h ;Video software interrupt #
-
-
- pseg cvidtype
-
- ;/*
- ;** int
- ;** vidtype(void)
- ;**
- ;** ARGUMENT(s)
- ;** none
- ;**
- ;** DESCRIPTION
- ;** Determines the type of video adapter that is currently in use
- ;**
- ;** RETURNS
- ;** 1 = Monochrome
- ;** 2 = CGA
- ;** 3 = EGA
- ;** 4 = VGA
- ;**
- ;** AUTHOR
- ;** "" Wed 07-Dec-1988 10:25:02
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc vidtype
- push ds
- mov ax,01a00h ;Read display combination code
- int VIDEOINT ;call BIOS
- cmp al,01ah ;if VGA al==0x1a
- jnz chkega
- mov ax,VGA ;indicate VGA and exit
- jmp short vidtypex
- chkega: mov ah,12h
- mov bl,10h ;return EGA information
- int VIDEOINT
- mov ax,EGA
- cmp bl,10h ;bl!=0x10 if EGA present
- jnz vidtypex
- int 011h ;equipment determination
- mov bx,ax
- and bx,0030h
- xor bx,0030h
- mov ax,MONOCHROME ;check for monochrome
- jz vidtypex
- mov ax,CGA
- vidtypex: pop ds
- cproce
- endps
- end
-