home *** CD-ROM | disk | FTP | other *** search
- /*
- * screen.c
- * contains: screen(),napage()
- *
- * Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- */
-
- #include <stdio.h>
- #include "gfuncts.h"
-
- int _napage;
-
- /*
- * void
- * screen(mode,burst,apage,vpage)
- *
- * ARGUMENT
- * (int) mode - 0..2
- * 0 = text mode at current width
- * 1 = 320x200 medium res color graphics
- * 2 = 640x200 high res graphics
- * (int) burst - TRUE/FALSE
- * mode 0: TRUE enables color, False disables
- * mode 1: TRUE disables color, FALSE enables
- * mode 2: no actions
- * (int) apage - active page: valid in mode 0 only.
- * 0..7 for 40 column, 0..3 for 80 column
- * (int) vpage - visual page selected for display 0..7(3)
- *
- * DESCRIPTION
- * This functions exactly as the BASIC SCREEN statement. Used to select
- * video modes, active pages etc.
- *
- * MODIFICATIONS:
- *
- * "" Fri 10-Mar-1989 09:16:11
- *
- * Modified to not set the video page if video mode is less than 4.
- */
- void GF_CONV screen(mode,burst,apage,page )
- int mode,burst,apage,page;
- {
- struct GFREGS out;
- unsigned ccolumns,nmode,nvpage;
- int xnapage;
-
- vstate(&out);
- xnapage=apage;
- if(xnapage<0||xnapage>7)
- return;
- ccolumns=out.bx;
- switch(mode) {
- case 0:
- if (burst)
- nmode=ccolumns==80?3:1;
- else
- nmode=ccolumns==80?2:0;
- break;
- case 1:
- nmode=burst?5:4;
- break;
- case 2:
- nmode=6;
- break;
- default:
- nmode=2;
- break;
- }
- if(mode==0)
- nvpage=page;
- vmode(nmode);
- if(nmode<4)
- vpage(nvpage);
- }
-
- /*
- * void
- * napage(n)
- *
- * ARGUMENT
- * (int) n - Number of video page to write to
- *
- * DESCRIPTION
- * Many functions in this library write to a specified video page. Usually
- * this is explicitly specified; it can also be set in a global variable
- * and specified implicitly. This function just set's the global variable
- * _napage to the value of the parameter.
- */
- void GF_CONV napage(page)
- int page;
- {
- _napage=page;
- }
-