/* vgotoxy.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */

#include <stdlib.h>
#include <dos.h>
#define INCL_VIO
#include <os2emx.h>
#include <sys/video.h>
#include "video2.h"

void v_gotoxy (int x, int y)
{
  if ((unsigned)x < _v_width && (unsigned)y < _v_height)
    {
      _v_x = x; _v_y = y;
      if (_osmode == OS2_MODE)
        VioSetCurPos (y, x, 0);
      else
        {
          union REGS r;
          
          r.h.ah = 0x02;
          r.h.bh = 0x00;
          r.h.dl = (unsigned char)x;
          r.h.dh = (unsigned char)y;
          _int86 (0x10, &r, &r);
        }
    }
}
