/*====================================================*/
/* DVVER.C                                            */
/*                                                    */
/* (c) Copyright 1988 Ralf Brown  All Rights Reserved */
/* May be freely copied for noncommercial use,        */
/* provided that this copyright notice remains intact */
/* and any changes are clearly indicated in the       */
/* comment blocks preceding functions                 */
/*====================================================*/

#include "tvapi.h"

/*======================================================*/
/* DVver--return DESQview version, -1 if not loaded     */
/*   Ralf Brown 4/3/88                                  */
/*======================================================*/

WORD pascal DVver(void)
{
#ifdef __TURBOC__
   _AX = 0x2B01 ;
   _CX = 0x4445 ;
   _DX = 0x5351 ;
   geninterrupt(0x21);
   if (_AL == 0xFF)
      return -1 ;
   else if (_BX == 2)    /* early copies of 2.00 return 2 rather than 0x0200 */
      return 0x0200 ;
   else return _BX ;
#else
   union REGS regs ;

   regs.x.ax = 0x2B01 ;
   regs.x.cx = 0x4445 ;
   regs.x.dx = 0x5351 ;
   int86(0x21,&regs,&regs) ;
   if (regs.h.al == 0xFF)
      return -1 ;
   else if (regs.x.bx == 2)
      return 0x0200 ;
   else return regs.x.bx ;
#endif __TURBOC__
}

/* End of DVVER.C */
