home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / screen / scrn02 / scrn4.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-03-29  |  2.0 KB  |  66 lines

  1. /*
  2. *    Additional functions for SCRN0.ARC 
  3. *
  4. *    Tim Spencer - Compuserve [73657,1400]
  5. */
  6.  
  7.  
  8.  
  9. #include "video.h"
  10.  
  11.  
  12. /*************************************************************************
  13.  scrn_page - Function to set the page used in subsequent scrn_xxx function
  14.          calls. Does *not* change the actual display page, only the
  15.          area of display memory to be accessed by scrn_xxx functions.
  16.          Use vid_page to change the actual display page.
  17.  
  18.          Note: Not for use with Monochrome Adapters. Calls to this 
  19.            function will be ignored if an MA is detected. Also, 
  20.            only pages 0 through 3 are valid with a Color Graphics 
  21.            Adapter.
  22.  
  23.     Ex: scrn_page(1, &xxx);        set to access page 1
  24. *************************************************************************/
  25. void scrn_page(pg, scrn)               
  26.  int pg;        /* page selected */
  27.  SCRN *scrn;        /* pointer to screen data */
  28.  {
  29.    pg &= 7;    /* force to page 7 or below */
  30.  
  31.    if (vcard_type() == MONO_ADAPTER) 
  32.     ;                /* ignore if mono */
  33.    else 
  34.     scrn->segment = COLOR_SEG  + (pg * 256);
  35.  }
  36.  
  37.  
  38.  
  39.  
  40.  
  41. /***********************************************************************
  42.  scrn_cls() - Clears the page selected with scrn_page with the attribute
  43.           currently defined in the SCRN structure. Does *not* affect
  44.           the current actual display page, unless that page has been
  45.           selected with vid_page.
  46.     
  47.     Note: Not generally applicable to monochrome adapters, but this
  48.           function can be used to clear the mono screen to a given
  49.           attribute. In such cases, it would assume page zero.    
  50.  
  51.     Ex: vid_page(0);    actual display page is zero
  52.         scrn_page(1);    logical display page is one
  53.         scrn_cls(&xxx);    clear page 1 in the background
  54.         vid_page(1);    now switch the display to page 1
  55. ***********************************************************************/              
  56. void scrn_cls(scrn)
  57.  SCRN *scrn;
  58.  {
  59.     register i;
  60.  
  61.     scrn_pos(0, 0, scrn);
  62.     for (i = 0; i <= 4000; i++) 
  63.        scrn_putca(' ', scrn);
  64.  }
  65.     
  66.