/* vhardwar.c (emx+gcc) -- Copyright (c) 1987-1995 by Eberhard Mattes */

#include <stdlib.h>
#include <sys/video.h>
#include "video2.h"
#include "video3.h"

int v_hardware (void)
{
  static VIOMODEINFO info;

#if defined (IF_OS2)
  IF_OS2
    {
      info.cb = sizeof (info);
      VioGetMode (&info, 0);
      if (!(info.fbType & VGMT_OTHER))
        return V_MONOCHROME;
      if (info.vres / info.row < 10)
        return V_COLOR_8;
      else
        return V_COLOR_12;
    }
#endif
#if defined (IF_DOS)
  IF_DOS
    {
      union REGS r;

      _int86 (0x11, &r, &r);
      if ((r.h.al & 0x30) == 0x30)
        return V_MONOCHROME;
      else
        return V_COLOR_8;
    }
#endif
}
