home *** CD-ROM | disk | FTP | other *** search
/ Quake++ for Quake / Quake++.iso / quake / edquake / code / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-12  |  3.8 KB  |  153 lines

  1. /*EdQuake v0.50 source code
  2.   (c) Copyright 1996 Scott Mitting
  3.   email:smitting@netusa1.net
  4.   ----------------------------------
  5.   INIT.C  -  Runs init routines for SVGACC. If you cant pass these
  6.          then you can't run quake anyways, so why make a level
  7.          for it?
  8.  
  9.   __variables:
  10.   int startvideomode       -- video mode upon entry
  11.   __functions:
  12.   void initcpu()       -- runs all system diagnostic routines:
  13.                   386/mouse/512k video
  14.   ----------------------------------
  15.   the entire source code is under renovation to make it easier
  16.   to understand.  happy coding.
  17. */
  18.  
  19. #include "svgacc.h"
  20.  
  21. int startvideomode;
  22.  
  23. void initcpu()
  24. {
  25.     int cpu, videomemory, mouse, mjv, mnv, tp, i;
  26.     char buf[80];
  27.  
  28.     startvideomode = videomodeget();
  29.     restext();
  30.     clrscr();
  31.     gotoxy(1,1);
  32.     printf("Init EdQuake v0.5\n");
  33.     cpu = whichcpu();
  34.     if (cpu < 386) {
  35.     printf("386 or better processor required.\n");
  36.     printf("Processor is identified as an 80%d.\n", cpu);
  37.     printf("press a key...\n");
  38.     getch();
  39.     videomodeset(startvideomode);
  40.     exit(0);
  41.     }
  42.     switch(whichvga()) {
  43.     case ACUMOS:
  44.         printf("Acumos AVGA2/3 SuperVGA\n");
  45.         break;
  46.     case ATI:
  47.         printf("ATI Technologies 18/28/38/68800 SuperVGA\n");
  48.         break;
  49.     case AHEADA:
  50.         printf("Ahead V5000 Ver A SuperVGA\n");
  51.         break;
  52.     case AHEADB:
  53.         printf("Ahead V5000 Ver B SuperVGA\n");
  54.         break;
  55.     case CHIPSTECH:
  56.         printf("Chips and Technologies 82C450/1/2/3/5/6/7 SuperVGA\n");
  57.         break;
  58.     case CIRRUS:
  59.         printf("Cirrus Logic CL-GD 5xx,6xx,28xx,54xx,62xx SuperVGA\n");
  60.         break;
  61.     case EVEREX:
  62.         printf("Everex EV236/6xx Micro Enhancer SuperVGA\n");
  63.         break;
  64.     case GENOA:
  65.         printf("Genoa 61/62/63/64/6600 SuperVGA\n");
  66.         break;
  67.     case NCR:
  68.         printf("NCR 77C21/22/22E/22E+ SuperVGA\n");
  69.         break;
  70.     case OAKTECH:
  71.         printf("Oak Technologies OTI-037/67/77/87C SuperVGA\n");
  72.         break;
  73.     case PARADISE:
  74.         printf("Paradise/Western Digital PVGA1A,WD90C00/1x/2x/3x SuperVGA\n");
  75.         break;
  76.     case REALTEK:
  77.         printf("Realtek RT3106 SuperVGA\n");
  78.         break;
  79.     case TRIDENT:
  80.         printf("Trident 8800CS,8900B/C/CL/CX,90x0 SuperVGA\n");
  81.         break;
  82.     case TSENG3:
  83.         printf("Tseng Labs ET3000-AX/BX/BP SuperVGA\n");
  84.         break;
  85.     case TSENG4:
  86.         printf("Tseng Labs ET4000/W32/W32I SuperVGA\n");
  87.         break;
  88.     case VESA:
  89.         printf("VESA compatible SuperVGA\n");
  90.         break;
  91.     case VIDEO7:
  92.         printf("Video 7 HT-208/16 SuperVGA\n");
  93.         break;
  94.     case AVANCE:
  95.         printf("Avance Logic AL2101 SuperVGA\n");
  96.         break;
  97.     case MXIC:
  98.         printf("MXIC MX68000/10 SuperVGA\n");
  99.         break;
  100.     case PRIMUS:
  101.         printf("Primus P2000 SuperVGA\n");
  102.         break;
  103.     default:
  104.         printf("Sorry, unable to identify video card or it is not a SuperVGA video adapter.\n");
  105.         printf("press a key...\n");
  106.         getch();
  107.         videomodeset(startvideomode);
  108.         exit(0);
  109.     }
  110.     videomemory = whichmem();
  111.     printf("videoram=%i\n",videomemory);
  112.     if (videomemory < 511) {
  113.     printf("Sorry, 512k of video ram required.\n");
  114.     printf("press a key...\n");
  115.     getch();
  116.     videomodeset(startvideomode);
  117.     exit(0);
  118.     } else
  119.     mouse = whichmouse();
  120.     if (mouse > 0) {
  121.         mouseinfo(&mjv, &mnv, &tp, &i);
  122.         switch (tp) {
  123.         case 1:
  124.         sprintf(buf,"bus mouse\n");
  125.         break;
  126.         case 2:
  127.         sprintf(buf,"serial mouse\n");
  128.         break;
  129.         case 3:
  130.         sprintf(buf,"Inport mouse\n");
  131.         break;
  132.         case 4:
  133.         sprintf(buf,"PS/2 mouuse\n");
  134.         break;
  135.         case 5:
  136.         sprintf(buf,"HP mouse\n");
  137.         break;
  138.         default:
  139.         sprintf(buf,"unknown type\n");
  140.     }
  141.     } else
  142.     {
  143.     printf("Microsoft compatible mouse required.\n");
  144.     printf("press a key...\n");
  145.     getch();
  146.     videomodeset(startvideomode);
  147.     exit(0);
  148.     }
  149.     printf("%i detected.\n",cpu);
  150.  
  151.     printf("Init EdQuake v0.5\n");
  152. }
  153.