home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / VIDTYPE.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  1.3 KB  |  71 lines

  1.         page    58,132
  2.  
  3. ;/*
  4. ;** vidtype.asm
  5. ;** contains: vidtype()
  6. ;*/
  7.         ifndef    _LCODE
  8.          include model.h
  9.         endif
  10.         include prologue.h
  11.         name    vidtype
  12.  
  13. MONOCHROME    equ    1            ;monochrome adapter
  14. CGA        equ    2            ;CGA adapter
  15. EGA        equ    3            ;EGA adapter
  16. VGA        equ    4            ;VGA adapter
  17.  
  18. VIDEOINT    equ    010h            ;Video software interrupt #
  19.  
  20.  
  21.         pseg    cvidtype
  22.  
  23. ;/*
  24. ;**  int
  25. ;** vidtype(void)
  26. ;**
  27. ;** ARGUMENT(s)
  28. ;**  none
  29. ;**
  30. ;** DESCRIPTION
  31. ;**  Determines the type of video adapter that is currently in use
  32. ;**
  33. ;** RETURNS
  34. ;**    1    =     Monochrome
  35. ;**    2    =     CGA
  36. ;**    3    =     EGA
  37. ;**    4    =     VGA
  38. ;**
  39. ;** AUTHOR
  40. ;**  ""   Wed 07-Dec-1988    10:25:02
  41. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  42. ;**
  43. ;** MODIFICATIONS
  44. ;**
  45. ;*/
  46.         cproc    vidtype
  47.         push    ds
  48.         mov    ax,01a00h        ;Read display combination code
  49.         int    VIDEOINT        ;call BIOS
  50.         cmp    al,01ah         ;if VGA al==0x1a
  51.         jnz    chkega
  52.         mov    ax,VGA            ;indicate VGA and exit
  53.         jmp    short vidtypex
  54. chkega:     mov    ah,12h
  55.         mov    bl,10h            ;return EGA information
  56.         int    VIDEOINT
  57.         mov    ax,EGA
  58.         cmp    bl,10h            ;bl!=0x10 if EGA present
  59.         jnz    vidtypex
  60.         int    011h            ;equipment determination
  61.         mov    bx,ax
  62.         and    bx,0030h
  63.         xor    bx,0030h
  64.         mov    ax,MONOCHROME        ;check for monochrome
  65.         jz    vidtypex
  66.         mov    ax,CGA
  67. vidtypex:    pop    ds
  68.         cproce
  69.         endps
  70.         end
  71.