home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: The Developer …nd Blaster Series Disk 1 / Lowe_TheDeveloperKitForSoundBlasterSeriesDisk1.img / C / MSC / GENERAL / SBCBLST.C next >
Encoding:
C/C++ Source or Header  |  1991-09-26  |  2.4 KB  |  64 lines

  1. /* ------------------------------------------------------------------------ */
  2. /*  @@ Source Documentation                        *** MSC/TC Version ***   */
  3. /*                                                                          */
  4. /*  Copyright (c) Creative Technology Pte Ltd, 1991. All rights reserved.   */
  5. /*                                                                          */
  6. /*   TITLE       : SBCBLST.C                                                */
  7. /*                                                                          */
  8. /*   DESCRIPTION :                                                          */
  9. /*       The program checks the BLASTER environment variable for the Card   */
  10. /*       settings. It also performs a test based on the BLASTER environment */
  11. /*       settings to ensure they tally with the hardware settings on the    */
  12. /*       Card.                                                              */
  13. /*                                                                          */
  14. /* ------------------------------------------------------------------------ */
  15.  
  16. #include <stdio.h>
  17. #include <sbc.h>
  18.  
  19.  
  20. char *CardType[] = {
  21.     "Sound Blaster",
  22.     "Sound Blaster Pro",
  23.     "Sound Blaster 2.0"
  24. };
  25.  
  26.  
  27. main ()
  28. {
  29.     unsigned    wFeature;
  30.  
  31.  
  32.     /* retrieve the BLASTER environment settings */
  33.     if ( ! GetEnvSetting() )
  34.     {
  35.         if ((wFeature = sbc_check_card()) != 0)
  36.         {
  37.             if (sbc_test_int())
  38.             {
  39.                 if (sbc_test_dma() >= 0)
  40.                 {
  41.                     printf("%s card installed at :\n",CardType[wCardID-1]);
  42.                     printf("\tI/O address : %x hex\n", ct_io_addx);
  43.                     printf("\tInterrupt   : %d\n", ct_int_num);
  44.                     printf("\tDMA Channel : %d\n\n", ct_dma_channel);
  45.  
  46.                     if (wFeature & 2)
  47.                         printf("FM music available.\n");
  48.  
  49.                     if (wFeature & 4)
  50.                         printf("Creative voice available.\n");
  51.                 }
  52.                 else
  53.                     printf("Error on DMA channel.\n");
  54.             }
  55.             else
  56.                 printf("Error on interrupt.\n");
  57.         }
  58.         else
  59.             printf("Sound Blaster Card not found or wrong I/O setting.\n") ;
  60.     }
  61.     else
  62.         printf("BLASTER environment variable not set or incomplete or invalid.\n");
  63. }
  64.