#include "vid.h"

#define  FALSE  0

vputnc(row, col, c, attr, times, retrace)
int      row, col;
register int      c;
int      attr, times, retrace;
{
   VIDMEM   scr_ofs;
   int      i;

   if (vidmode() == 7)
   {
      scr_ofs = MGAMEM;
      retrace = FALSE;
   }
   else scr_ofs = CGAMEM;

   scr_ofs += ((row * 80) + col);

   c |= (attr << 8);

   i = times;
   while (i)
   {
      if (retrace)
      {
         while ( (inp(CGASTAT) & 1) != 0);
         while ( (inp(CGASTAT) & 1) == 0);
      }

      *scr_ofs++ = c;
      i--;
   }
   return col+times;
}
