home *** CD-ROM | disk | FTP | other *** search
- /* vputmask.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_putmask (const char *src, const char *mask, int x, int y, int count)
- {
- int i, off;
- char *dst;
-
- if (_v_mem != NULL)
- {
- off = (y * _v_width + x) * 2;
- dst = _v_mem + off;
- for (i = 0; i < count; ++i)
- {
- if (*mask++)
- {
- dst[0] = src[0];
- dst[1] = src[1];
- }
- dst += 2; src += 2;
- }
- if (_osmode == OS2_MODE)
- VioShowBuf (off, count * 2, 0);
- }
- else if (_osmode == OS2_MODE)
- for (i = 0; i < count; ++i)
- {
- if (*mask++)
- VioWrtNCell (src, 1, y, x+i, 0);
- src += 2;
- }
- else
- {
- union REGS r;
-
- for (i = 0; i < count; ++i)
- {
- if (*mask++)
- {
- r.h.ah = 0x02;
- r.h.bh = 0;
- r.h.dl = x + i;
- r.h.dh = y;
- _int86 (0x10, &r, &r);
- r.h.ah = 0x09;
- r.h.bh = 0;
- r.h.al = src[0];
- r.h.bl = src[1];
- r.x.cx = 1;
- _int86 (0x10, &r, &r);
-
- }
- src += 2;
- }
- r.h.ah = 0x02;
- r.h.bh = 0;
- r.h.dl = (unsigned char)_v_x;
- r.h.dh = (unsigned char)_v_y;
- _int86 (0x10, &r, &r);
- }
- }
-