home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name scpages -- Return the number of video display pages for
- * the current video device and mode.
- *
- * Synopsis num_pages = scpages();
- *
- * int num_pages The number of display pages.
- *
- * Description This function reports the number of pages supported on
- * the current video display adapter in the current mode.
- * It returns 1 for modes that do not support multiple
- * pages, such as mode 7 on the Monochrome Adapter.
- *
- * Use SCAPAGE to display any given page. Use SCPAGE to
- * direct C TOOLS PLUS screen output to any page, whether
- * it is currently displayed or not.
- *
- * Returns num_pages The number of display pages.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- **/
-
- #include <bscreen.h>
-
- int scpages()
- {
- int pages;
- int mode,columns,act_page;
-
- if (!b_know_hw)
- scequip(); /* Sense hardware present. */
-
- pages = 0; /* In case of impossible */
- /* conditions. */
-
- if (b_ega == scmode(&mode,&columns,&act_page))
- switch (mode) /* Enhanced Graphics Adapter */
- {
- case 0:
- case 1:
- if (scrows() == 25)
- pages = 8;
- else /* Presumable 43-line mode */
- pages = ((b_mem_ega == 64) ? 4 : 8);
- break;
- case 2:
- case 3:
- if (scrows() == 25)
- pages = ((b_mem_ega == 64) ? 4 : 8);
- else /* Presumable 43-line mode */
- pages = b_mem_ega >> 5;
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- pages = 1;
- break;
- case 13:
- pages = b_mem_ega >> 5;
- break;
- case 14:
- pages = b_mem_ega >> 6;
- break;
- case 16:
- pages = (b_mem_ega == 256) ? 2 : 1;
- break;
- }
- else
- switch (mode)
- {
- case 0:
- case 1:
- pages = 8; /* Color/Graphics Adapter 40 col*/
- break;
- case 2:
- case 3:
- pages = 4; /* Color/Graphics Adapter 80 col*/
- break;
- case 4: /* CGA medium-res graphics */
- case 5: /* CGA medium-res graphics */
- case 6: /* CGA high-res graphics */
- case 7: /* Monochrome Adapter */
- case 8: /* PCjr low-res graphics */
- case 9: /* PCjr medium-res graphics */
- case 10: /* PCjr high-res graphics */
- pages = 1;
- break;
- }
-
- return pages;
- }