home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / VHARDWAR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  729 b   |  36 lines

  1. /* vhardwar.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <stdlib.h>
  4. #include <dos.h>
  5. #define INCL_VIO
  6. #include <os2emx.h>
  7. #include <sys/video.h>
  8. #include "video2.h"
  9.  
  10. int v_hardware (void)
  11. {
  12.   static VIOMODEINFO info;
  13.  
  14.   if (_osmode == OS2_MODE)
  15.     {
  16.       info.cb = sizeof (info);
  17.       VioGetMode (&info, 0);
  18.       if (!(info.fbType & VGMT_OTHER))
  19.         return (V_MONOCHROME);
  20.       if (info.vres / info.row < 10)
  21.         return (V_COLOR_8);
  22.       else
  23.         return (V_COLOR_12);
  24.     }
  25.   else
  26.     {
  27.       union REGS r;
  28.  
  29.       _int86 (0x11, &r, &r);
  30.       if ((r.h.al & 0x30) == 0x30)
  31.         return (V_MONOCHROME);
  32.       else
  33.         return (V_COLOR_8);
  34.     }
  35. }
  36.