home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / SCAPAGE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.2 KB  |  46 lines

  1. /**
  2. *
  3. * Name        scapage -- Display (activate) a video page
  4. *
  5. * Synopsis    apage = scapage(page);
  6. *
  7. *        int apage      The video page actually displayed.
  8. *        int page      The page to display (activate).
  9. *
  10. * Description    SCAPAGE sets the active display page, i.e., displays the
  11. *        page.  The cursor is not changed in form.
  12. *
  13. *        Use SCPAGES to find how many pages are supported by the
  14. *        current device in the current mode.  Use SCPAGE to
  15. *        direct C TOOLS PLUS screen output to a given page,
  16. *        whether it is active (displayed) or not.  Use SCACTPG to
  17. *        display a page and to use its recorded cursor type.
  18. *
  19. * Returns    apage          The video page actually displayed.
  20. *
  21. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983, 1984, 1986
  22. *
  23. **/
  24.  
  25. #include <bscreen.h>
  26. #include <butility.h>
  27.  
  28. int scapage(page)
  29. int page;
  30. {
  31.     int ax,bx,cx,dx,flags;          /* General registers          */
  32.     int max_page;
  33.  
  34.     max_page = scpages() - 1;          /* Maximum page value          */
  35.  
  36.     utbound(page,0,max_page)
  37.  
  38.     if (max_page)              /* Switch active page only if   */
  39.     {                      /* this device supports more    */
  40.        ax = utbyword(5,page);          /* than one.              */
  41.        bios(16,&ax,&bx,&cx,&dx,&flags);
  42.     }
  43.  
  44.     return(page);
  45. }
  46.