home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / bios / setpage.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  579 b   |  28 lines

  1. /*
  2.  *    setpage -- select "visual" screen page for viewing
  3.  *    (the "active" page is the one being written to)
  4.  */
  5.  
  6. #include <dos.h>
  7. #include <local\std.h>
  8. #include <local\bioslib.h>
  9. #include <local\video.h>
  10.  
  11. int
  12. setpage(pg)
  13. int pg;    /* visual screen page number */
  14. {
  15.     union REGS inregs, outregs;
  16.  
  17.     /* check page number against table */
  18.     if (Maxpage[Vmode] > 0 && (pg < 0 || pg >= Maxpage[Vmode]))
  19.         return (-1);
  20.  
  21.     /* change the visual page */
  22.     inregs.h.ah = SET_PAGE;
  23.     inregs.h.al = pg;
  24.     int86(VIDEO_IO, &inregs, &outregs);
  25.  
  26.     return (outregs.x.cflag);
  27. }
  28.