/* vgotoxy.c (emx+gcc) -- Copyright (c) 1987-1994 by Eberhard Mattes */

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

void v_gotoxy (int x, int y)
{
  if ((unsigned)x < _v_width && (unsigned)y < _v_height)
    {
      _v_x = x; _v_y = y;
#if defined (IF_OS2)
      IF_OS2
        {
          VioSetCurPos ((USHORT)y, (USHORT)x, 0);
        }
#endif
#if defined (IF_DOS)
      IF_DOS
        {
          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);
        }
#endif
    }
}
