home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Bila Vrana
/
BILA_VRANA.iso
/
007A
/
SVGACC24.ZIP
/
SVGADEMO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-30
|
18KB
|
614 lines
/****************************************************************************
'SVGACC' A Super Vga Graphics Library for use with Microsoft compatible
C/C++ compilers
Copyright 1993-1996 by Stephen L. Balkum and Daniel A. Sill
**************** UNREGISTERD SHAREWARE VERSION ***********************
* FOR EVUALATION ONLY. NOT FOR RESALE IN ANY FORM. SOFTWARE WRITTEN *
* USING THIS UNREGISTERED SHAREWARE GRAPHICS LIBRARY MAY NOT BY SOLD *
* OR USED FOR ANY PURPOSE OTHER THAN THE EVUALTION OF THIS LIBRARY. *
**********************************************************************
**************** NO WARRANTIES AND NO LIABILITY **********************
* Stephen L. Balkum and Daniel A. Sill provide no warranties, either *
* expressed or implied, of merchantability, or fitness, for a *
* particular use or purpose of this SOFTWARE and documentation. *
* In no event shall Stephen L. Balkum or Daniel A. Sill be held *
* liable for any damages resulting from the use or misuse of the *
* SOFTWARE and documentation. *
**********************************************************************
************** U.S. GOVERNMENT RESTRICTED RIGHTS *********************
* Use, duplication, or disclosure of the SOFTWARE and documentation *
* by the U.S. Government is subject to the restictions as set forth *
* in subparagraph (c)(1)(ii) of the Rights in Technical Data and *
* Computer Software cluse at DFARS 252.227-7013. *
* Contractor/manufacturer is Stephen L. Balkum and Daniel A. Sill, *
* P.O. Box 7704, Austin, Texas 78713-7704 *
**********************************************************************
**********************************************************************
* By using this SOFTWARE or documentation, you agree to the above *
* terms and conditions. *
**********************************************************************
***************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <dos.h>
#include "svgacc.h"
#include "svgademo.h"
void main(void) {
int startvideomode;
int i, max, ky;
int mjv, mnv, tp;
int cpu, videomemory;
int mouse, joystick;
int res;
int offset, colr;
float mypi;
char dummy;
char buf[TITLEN];
char *dumptr;
/*
* Save the starting videomode and set it to mode 3.
*/
startvideomode = videomodeget();
restext();
screenclear();
/*
* Move the DOS cursor to the top left to start the program and say hello
*/
screengoto(11,0);
printf("/*SVGACC.LIB/* A SuperVGA Graphics Library for use with\n");
screengoto(23,1);
printf("Microsoft compatible C/C++ compilers\n");
screengoto(9,2);
printf("Copyright 1993-1995 by Stephen L. Balkum and Daniel A. Sill\n");
screengoto(23,11);
printf("Demonstration/Example Program\n");
screengoto(0,22);
printf("press a key to begin the demo...\n");
getkey();
screenclear();
/*
* Let's id the processor first as the library requires a 386 or better.
*/
screengoto(0,0);
cpu = whichcpu();
if (cpu < 386) {
printf("Sorry, this library requires an 80386 or better processor.\n");
printf("Processor is identified as an 80%d.\n", cpu);
printf("Demo program will be terminated.\n\n");
printf("press a key...\n");
getkey();
videomodeset(startvideomode);
exit(0);
}
/*
* Let's id the video card/chip as the library requires a SuperVGA adapter.
*/
switch(whichvga()) {
case ACUMOS:
sprintf(buf,"Acumos AVGA2/3 SuperVGA");
break;
case ATI:
sprintf(buf,"ATI Technologies 18/28/38/68800 SuperVGA");
break;
case AHEADA:
sprintf(buf,"Ahead V5000 Ver A SuperVGA");
break;
case AHEADB:
sprintf(buf,"Ahead V5000 Ver B SuperVGA");
break;
case CHIPSTECH:
sprintf(buf,"Chips and Technologies 82C450/1/2/3/5/6/7 SuperVGA");
break;
case CIRRUS:
sprintf(buf,"Cirrus Logic CL-GD 5xx,6xx,28xx,54xx,62xx SuperVGA");
break;
case EVEREX:
sprintf(buf,"Everex EV236/6xx Micro Enhancer SuperVGA");
break;
case GENOA:
sprintf(buf,"Genoa 61/62/63/64/6600 SuperVGA");
break;
case NCR:
sprintf(buf,"NCR 77C21/22/22E/22E+ SuperVGA");
break;
case OAKTECH:
sprintf(buf,"Oak Technologies OTI-037/67/77/87C SuperVGA");
break;
case PARADISE:
sprintf(buf,"Paradise/Western Digital PVGA1A,WD90C00/1x/2x/3x SuperVGA");
break;
case REALTEK:
sprintf(buf,"Realtek RT3106 SuperVGA");
break;
case TRIDENT:
sprintf(buf,"Trident 8800CS,8900B/C/CL/CX,90x0 SuperVGA");
break;
case TSENG3:
sprintf(buf,"Tseng Labs ET3000-AX/BX/BP SuperVGA");
break;
case TSENG4:
sprintf(buf,"Tseng Labs ET4000/W32/W32I SuperVGA");
break;
case VESA:
sprintf(buf,"VESA compatible SuperVGA");
break;
case VIDEO7:
sprintf(buf,"Video 7 HT-208/16 SuperVGA");
break;
case AVANCE:
sprintf(buf,"Avance Logic AL2101 SuperVGA");
break;
case MXIC:
sprintf(buf,"MXIC MX68000/10 SuperVGA");
break;
case PRIMUS:
sprintf(buf,"Primus P2000 SuperVGA");
break;
default:
printf("Microprocessor is identified as an 80%d.\n", cpu);
printf("Sorry, unable to identify video card or it is not a SuperVGA video adapter.\n");
printf("Demo program will be terminated.\n\n");
printf("press a key...\n");
getkey();
videomodeset(startvideomode);
exit(0);
}
printf("Microprocessor is identified as an 80%d.\n", cpu);
fontsystem();
printf("Video card/chip is identified as %s.\n",&buf);
/*
* Let's see the how much memory is installed on the super vga adapter.
*/
videomemory = whichmem();
if (videomemory < 1) {
printf("Sorry, unable to identify the amount of installed video memory.\n");
printf("Demo program will be terminated.\n\n");
printf("press a key...\n");
getkey();
videomodeset(startvideomode);
exit(0);
} else
printf("Installed video memory identified as %dkb.\n", videomemory);
/*
* Let's tell the user what the highest resolution that the video card
* and its installed memory card is capable of. The monitor must be able
* to support those modes too !
*/
printf("Video card and installed memory is capable of the following resolutions:\n");
if (videomemory > 2047) {
printf(" 320x200 in 256 colors\n");
printf(" 640x400 in 256 colors\n");
printf(" 640x480 in 256 colors\n");
printf(" 800x600 in 256 colors\n");
printf(" 1024x768 in 256 colors\n");
printf(" 1280x1024 in 256 colors\n");
max = 5;
} else if (videomemory > 1023) {
printf(" 320x200 in 256 colors\n");
printf(" 640x400 in 256 colors\n");
printf(" 640x480 in 256 colors\n");
printf(" 800x600 in 256 colors\n");
printf(" 1024x768 in 256 colors\n");
max = 4;
} else if (videomemory > 511) {
printf(" 320x200 in 256 color