home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / graphics / vesa24_2.zip / VEINFO.CPP < prev    next >
C/C++ Source or Header  |  1993-04-09  |  2KB  |  81 lines

  1. /*************************************************************************/
  2. /*                VEINFO.CPP                                                 */
  3. /*    Author: Don Lewis                                                     */
  4. /*    Date:   February 22, 1993                                             */
  5. /*    Description:                                                         */
  6. /*                Read the VESA information off the video card             */
  7. /*                and acknowledge available modes to the user.             */
  8. /*                                                                         */
  9. /*************************************************************************/
  10.  
  11. #include "stdio.h"
  12. #include "conio.h"
  13. #include <e:\borlandc\cprogs\vesainf.cpp>
  14.  
  15. struct info;
  16. struct modeinfo;
  17.  
  18. void VesaInformation(void);
  19. void ReturnSvgaMode(int);
  20.  
  21. void VesaInformation(void)
  22. {
  23.     unsigned int i;
  24.     GetSvgaInfo();
  25.  
  26.     printf("\t\t******* VESA SVGA and EXTENDED mode information *******\n");
  27.     printf("\t%s ", info.OEMStringPtr);
  28.     for (i=0; i<=3; i++)
  29.     printf("%c", info.VESASignature[i]);
  30.     printf(" Version %d.%d, ", info.VESAVersion/ 0x100,
  31.                        info.VESAVersion % 0x100);
  32.     printf("%d kilobytes video ram\n\n",info.TotalMemory * 64);
  33.     printf("MODE    ACTIVE?  RESOLUTION\t   DESCRIPTION\n");
  34.     i = 0;
  35.     while (info.VideoModePtr[i] != 0xffff)
  36.     {
  37.         ReturnSvgaMode(info.VideoModePtr[i]);
  38.         if (modeinfo.ModeAttributes && 1)
  39.             printf("%xh\tPresent ", info.VideoModePtr[i]);
  40.         else printf("%xh \tNOT Present ", info.VideoModePtr[i]);
  41.         printf("%dx%dx%dbpp\t",modeinfo.XResolution,modeinfo.YResolution,
  42.                 modeinfo.BitsPerPixel);
  43.  
  44.         switch (modeinfo.MemoryModel)
  45.         {
  46.             case 0x00: if (modeinfo.ModeAttributes && 8)printf("COLOR TEXT");
  47.             else printf("B&W TEXT");
  48.             break;
  49.             case 0x01:    printf("CGA graphics");
  50.             break;
  51.             case 0x02:    printf("HGC graphics");
  52.             break;
  53.             case 0x03:    printf("16 color graphics");
  54.             break;
  55.             case 0x04:    printf("256 color Packed Pixel graphics");
  56.             break;
  57.             case 0x05:    printf("Non-Chain 4, 256 color graphics");
  58.             break;
  59.             case 0x06:
  60.             printf("%ld ",(unsigned long)((long)2<<modeinfo.BitsPerPixel-1));
  61.             printf("Direct color graphics" );
  62.             break;
  63.             case 0x07:  printf("YUV");
  64.             break;
  65.             case 0x08:
  66.             case 0x09:
  67.             case 0x0a:
  68.             case 0x0b:
  69.             case 0x0c:
  70.             case 0x0d:
  71.             case 0x0e:
  72.             case 0x0f:    printf("Reserved for VESA");
  73.             break;
  74.             default:    printf("OEM memory model");
  75.             break;
  76.         }
  77.         i = i+1;
  78.         printf("\n");
  79.  
  80.     }
  81. }