home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / 2MONITOR.ZIP / SNAP.C < prev    next >
C/C++ Source or Header  |  1989-09-10  |  1KB  |  35 lines

  1. /* SNAP - - Snaps image on color tube to mono tube.                       */
  2. /* Written 9/89 by W. J. Morton                                           */
  3. #define INCL_BASE
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <os2.h>
  7. #include <ctype.h>
  8.  
  9. VIOPHYSBUF     viopbBufm;
  10. VIOPHYSBUF     viopbBufc; 
  11. PCH            pchScreenm, pchScreenc;   /* Pointers to mono, color      */
  12.  
  13. void main(int argc, char **argv)
  14.  
  15. {
  16.    register int   i;
  17.  
  18.    viopbBufm.pBuf = (PCH) 0xB0000L;          /* Get a mono screen pointer */
  19.    viopbBufc.cb = 4000;
  20.    VioGetPhysBuf(&viopbBufm, 0);
  21.    pchScreenm = MAKEP(viopbBufm.asel[0],0);
  22.  
  23.    viopbBufc.pBuf = (PCH) 0xB8000L;         /* Get a color screen pointer */
  24.    viopbBufc.cb = 4000;
  25.    VioGetPhysBuf(&viopbBufc, 0);
  26.    pchScreenc = MAKEP(viopbBufc.asel[0],0);
  27.                                            /* Copy chars from color to mono */
  28.    i = 0;                                  /* and make attributes NORMAL    */  
  29.    for (i = 0; i < 4000; i +=2)
  30.       {
  31.       *(pchScreenm + i) = *(pchScreenc + i);
  32.       *(pchScreenm + i + 1) = 7;
  33.       }      
  34. }
  35.