#include "vid.h"

#define  FALSE  0

vputstr(row, col, str, attr, retrace)
int   row, col;
char  *str;
int   attr, retrace;
{
   register int    c;
   VIDMEM scr_ofs;

   if (vidmode() == 7)
   {
      attr |= 7;
      scr_ofs = MGAMEM + (row * 80) + col;
      retrace = FALSE;
   }
   else
   {
      if (vidmode() == 2)
         attr |= 7;
      scr_ofs = CGAMEM+(row * 80) + col;
   }

   while (*str)
   {
     c = attr <<8 | *str++;

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

     *scr_ofs++ = c;
   }
}
