2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
14 char cdmix32_rcsid[] = "$Id: cdmix32.c,v 1.1.1.1 2001-01-19 03:30:14 bradleyb Exp $";
33 #define _AWE32_8_ST 0xe208
35 #define NUM_OF_CARDS 4
38 DigiDevices SBCards[NUM_OF_CARDS]={
39 {_SOUND_BLASTER_8_MONO , "Sound Blaster" },
40 {_SOUND_BLASTER_8_ST , "Sound Blaster Pro" },
41 {_SB16_8_ST , "Sound Blaster 16/AWE32" },
42 {_AWE32_8_ST , "Sound Blaster AWE32"}
49 char line[100],nosbcard=1;
50 char *ptr,*token,*value;
52 int digiport=0,digiboard=0;
53 short int DataPort=0,AddressPort=0;
58 InFile = fopen("descent.cfg", "rt");
62 while (!feof(InFile)) {
64 fgets(line, 80, InFile);
69 token = strtok(ptr, "=");
70 value = strtok(NULL, "=");
71 if (value[strlen(value)-1] == '\n')
72 value[strlen(value)-1] = 0;
73 if (!strcmp(token, "DigiDeviceID8"))
74 digiboard = strtol(value, NULL, 16);
75 else if (!strncmp(token, "DigiPort",8))
77 digiport = strtol(value, NULL, 16);
79 else if (!strcmp(token, "RedbookVolume"))
80 redvol = strtol(value, NULL, 10);
84 mprintf ((0,"Digiport=0x%x\n",digiport));
85 mprintf ((0,"Digiboard=0x%x\n",digiboard));
86 mprintf ((0,"Redbook volume=%d\n",redvol));
87 for (nosbcard=1,i=0;i<NUM_OF_CARDS;i++)
89 if (SBCards[i].id==digiboard)
91 mprintf ((0,"Sound board=%s\n",SBCards[i].name));
102 mprintf ((0,"No Soundblaster type card was found!"));
106 AddressPort=digiport+4;
109 if (digiboard==0) // Plain SB
110 SetRedSB(AddressPort,DataPort,redvol);
111 else if (digiboard==1) // SB Pro
112 SetRedSBPro(AddressPort,DataPort,redvol);
113 else if (digiboard==2 || digiboard==3) // Sound blaster 16/AWE 32
114 SetRedSB16 (AddressPort,DataPort,redvol);
116 Int3(); // What? Get Jason, this shouldn't have happened
123 void SetRedSB16 (short aport,short dport,char vol)
147 void SetRedSB (short aport,short dport,char vol)
164 void SetRedSBPro (short aport,short dport,char vol)