home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / VPUTN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  984 b   |  47 lines

  1. /* vputn.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <stdlib.h>
  4. #include <dos.h>
  5. #define INCL_VIO
  6. #include <os2emx.h>
  7. #include <sys/video.h>
  8. #include "video2.h"
  9.  
  10. void v_putn (char c, int count)
  11. {
  12.   if (count > 0)
  13.     {
  14.       if (_osmode == OS2_MODE)
  15.         {
  16.           BYTE cell[2];
  17.  
  18.           cell[0] = c;
  19.           cell[1] = (BYTE)_v_attr;
  20.           VioWrtNCell (cell, count, _v_y, _v_x, 0);
  21.         }
  22.       else if (_v_mem != NULL)
  23.         {
  24.           char *p;
  25.  
  26.           p = _v_mem + (_v_y * _v_width + _v_x) * 2;
  27.           while (count > 0)
  28.             {
  29.               p[0] = c;
  30.               p[1] = (char)_v_attr;
  31.               --count; p += 2;
  32.             }
  33.         }
  34.       else
  35.         {
  36.           union REGS r;
  37.  
  38.           r.h.ah = 0x09;
  39.           r.h.bh = 0;
  40.           r.h.bl = (unsigned char)_v_attr;
  41.           r.h.al = c;
  42.           r.x.cx = count;
  43.           _int86 (0x10, &r, &r);
  44.         }
  45.     }
  46. }
  47.