1 /* Catacomb 3-D Source Code
\r
2 * Copyright (C) 1993-2014 Flat Rock Software
\r
4 * This program is free software; you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation; either version 2 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License along
\r
15 * with this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 // ID_SD.c - Sound Manager
\r
23 // By Jason Blochowiak
\r
27 // This module handles dealing with generating sound on the appropriate
\r
30 // Depends on: User Mgr (for parm checking)
\r
34 // SoundSourcePresent - Sound Source thingie present?
\r
35 // SoundBlasterPresent - SoundBlaster card present?
\r
36 // AdLibPresent - AdLib card present?
\r
37 // SoundMode - What device is used for sound effects
\r
38 // (Use SM_SetSoundMode() to set)
\r
39 // MusicMode - What device is used for music
\r
40 // (Use SM_SetMusicMode() to set)
\r
42 // NeedsDigitized - load digitized sounds?
\r
43 // NeedsMusic - load music?
\r
46 #pragma hdrstop // Wierdo thing with MUSE
\r
50 #ifdef _MUSE_ // Will be defined in ID_Types.h
\r
53 #include "ID_HEADS.H"
\r
58 #define SDL_SoundFinished() {SoundNumber = SoundPriority = 0;}
\r
60 // Macros for AdLib stuff
\r
61 #define selreg(n) outportb(alFMAddr,n)
\r
62 #define writereg(n) outportb(alFMData,n)
\r
63 #define readstat() inportb(alFMStatus)
\r
66 boolean SoundSourcePresent,SoundBlasterPresent,AdLibPresent,
\r
67 NeedsDigitized,NeedsMusic;
\r
72 word *SoundTable; // Really * _seg *SoundTable, but that don't work
\r
76 // Internal variables
\r
77 static boolean SD_Started;
\r
79 word TimerVal,TimerDelay10,TimerDelay25,TimerDelay100;
\r
80 dword TimerDivisor,TimerCount;
\r
81 static char *ParmStrings[] =
\r
86 static void (*SoundUserHook)(void);
\r
87 word SoundNumber,SoundPriority;
\r
88 void interrupt (*t0OldService)(void);
\r
89 // word t0CountTable[] = {8,8,8,8,40,40};
\r
92 // PC Sound variables
\r
93 volatile byte pcLastSample,far *pcSound;
\r
95 word pcSoundLookup[255];
\r
101 dword alLengthLeft;
\r
103 Instrument alZeroInst;
\r
105 // This table maps channel numbers to carrier and modulator op cells
\r
106 static byte carriers[9] = { 3, 4, 5,11,12,13,19,20,21},
\r
107 modifiers[9] = { 0, 1, 2, 8, 9,10,16,17,18},
\r
108 // This table maps percussive voice numbers to op cells
\r
109 pcarriers[5] = {19,0xff,0xff,0xff,0xff},
\r
110 pmodifiers[5] = {16,17,18,20,21};
\r
112 // Sequencer variables
\r
114 static word alFXReg;
\r
115 static ActiveTrack *tracks[sqMaxTracks],
\r
116 mytracks[sqMaxTracks];
\r
117 static word sqMode,sqFadeStep;
\r
118 word far *sqHack,far *sqHackPtr,sqHackLen,sqHackSeqLen;
\r
121 // Internal routines
\r
123 ///////////////////////////////////////////////////////////////////////////
\r
125 // SDL_SetTimer0() - Sets system timer 0 to the specified speed
\r
127 ///////////////////////////////////////////////////////////////////////////
\r
130 SDL_SetTimer0(word speed)
\r
132 #ifndef TPROF // If using Borland's profiling, don't screw with the timer
\r
133 outportb(0x43,0x36); // Change timer 0
\r
134 outportb(0x40,speed);
\r
135 outportb(0x40,speed >> 8);
\r
136 TimerDivisor = speed;
\r
138 TimerDivisor = 0x10000;
\r
142 ///////////////////////////////////////////////////////////////////////////
\r
144 // SDL_SetIntsPerSec() - Uses SDL_SetTimer0() to set the number of
\r
145 // interrupts generated by system timer 0 per second
\r
147 ///////////////////////////////////////////////////////////////////////////
\r
149 SDL_SetIntsPerSec(word ints)
\r
151 SDL_SetTimer0(1192030 / ints);
\r
154 ///////////////////////////////////////////////////////////////////////////
\r
156 // SDL_TimingService() - Used by SDL_InitDelay() to determine a timing
\r
157 // value for the current system that we're running on
\r
159 ///////////////////////////////////////////////////////////////////////////
\r
160 static void interrupt
\r
161 SDL_TimingService(void)
\r
166 outportb(0x20,0x20); // Ack interrupt
\r
169 ///////////////////////////////////////////////////////////////////////////
\r
171 // SDL_InitDelay() - Sets up TimerDelay's for SDL_Delay()
\r
173 ///////////////////////////////////////////////////////////////////////////
\r
175 SDL_InitDelay(void)
\r
180 setvect(8,SDL_TimingService); // Set to my timer 0 ISR
\r
182 SDL_SetIntsPerSec(1000); // Time 1ms
\r
184 for (i = 0,timer = 0;i < 10;i++) // Do timing test 10 times
\r
186 asm xor dx,dx // Zero DX
\r
187 asm mov cx,0xffff // Put starting value in CX
\r
188 asm mov [TimerDone],cx // TimerDone = false - 1
\r
190 asm or [TimerDone],0
\r
191 asm jnz startloop // Make sure we're at the start
\r
193 asm test [TimerDone],1 // See if TimerDone flag got hit
\r
194 asm jnz done // Yep - drop out of the loop
\r
198 if (0xffff - TimerVal > timer)
\r
199 timer = 0xffff - TimerVal;
\r
201 timer += timer / 2; // Use some slop
\r
202 TimerDelay10 = timer / (1000 / 10);
\r
203 TimerDelay25 = timer / (1000 / 25);
\r
204 TimerDelay100 = timer / (1000 / 100);
\r
206 SDL_SetTimer0(0); // Reset timer 0
\r
208 setvect(8,t0OldService); // Set back to old ISR
\r
211 ///////////////////////////////////////////////////////////////////////////
\r
213 // SDL_Delay() - Delays the specified amount of time
\r
215 ///////////////////////////////////////////////////////////////////////////
\r
217 SDL_Delay(word delay)
\r
224 asm test [TimerDone],0 // Useless code - just for timing equivilency
\r
234 ///////////////////////////////////////////////////////////////////////////
\r
236 // SDL_PCPlaySound() - Plays the specified sound on the PC speaker
\r
238 ///////////////////////////////////////////////////////////////////////////
\r
244 SDL_PCPlaySound(PCSound far *sound)
\r
250 pcLengthLeft = sound->common.length;
\r
251 pcSound = sound->data;
\r
256 ///////////////////////////////////////////////////////////////////////////
\r
258 // SDL_PCStopSound() - Stops the current sound playing on the PC Speaker
\r
260 ///////////////////////////////////////////////////////////////////////////
\r
266 SDL_PCStopSound(void)
\r
273 asm in al,0x61 // Turn the speaker off
\r
274 asm and al,0xfd // ~2
\r
280 ///////////////////////////////////////////////////////////////////////////
\r
282 // SDL_PCService() - Handles playing the next sample in a PC sound
\r
284 ///////////////////////////////////////////////////////////////////////////
\r
286 SDL_PCService(void)
\r
294 if (s != pcLastSample)
\r
300 if (s) // We have a frequency!
\r
302 t = pcSoundLookup[s];
\r
305 asm mov al,0xb6 // Write to channel 2 (speaker) timer
\r
308 asm out 42h,al // Low byte
\r
310 asm out 42h,al // High byte
\r
312 asm in al,0x61 // Turn the speaker & gate on
\r
316 else // Time for some silence
\r
318 asm in al,0x61 // Turn the speaker & gate off
\r
319 asm and al,0xfc // ~3
\r
326 if (!(--pcLengthLeft))
\r
329 SDL_SoundFinished();
\r
334 ///////////////////////////////////////////////////////////////////////////
\r
336 // SDL_ShutPC() - Turns off the pc speaker
\r
338 ///////////////////////////////////////////////////////////////////////////
\r
347 asm in al,0x61 // Turn the speaker & gate off
\r
348 asm and al,0xfc // ~3
\r
356 ///////////////////////////////////////////////////////////////////////////
\r
358 // alOut(n,b) - Puts b in AdLib card register n
\r
360 ///////////////////////////////////////////////////////////////////////////
\r
362 alOut(byte n,byte b)
\r
371 SDL_Delay(TimerDelay10);
\r
388 SDL_Delay(TimerDelay25);
\r
433 ///////////////////////////////////////////////////////////////////////////
\r
435 // SDL_SetInstrument() - Puts an instrument into a generator
\r
437 ///////////////////////////////////////////////////////////////////////////
\r
439 SDL_SetInstrument(int track,int which,Instrument far *inst,boolean percussive)
\r
445 c = pcarriers[which];
\r
446 m = pmodifiers[which];
\r
450 c = carriers[which];
\r
451 m = modifiers[which];
\r
454 tracks[track - 1]->inst = *inst;
\r
455 tracks[track - 1]->percussive = percussive;
\r
457 alOut(m + alChar,inst->mChar);
\r
458 alOut(m + alScale,inst->mScale);
\r
459 alOut(m + alAttack,inst->mAttack);
\r
460 alOut(m + alSus,inst->mSus);
\r
461 alOut(m + alWave,inst->mWave);
\r
463 // Most percussive instruments only use one cell
\r
466 alOut(c + alChar,inst->cChar);
\r
467 alOut(c + alScale,inst->cScale);
\r
468 alOut(c + alAttack,inst->cAttack);
\r
469 alOut(c + alSus,inst->cSus);
\r
470 alOut(c + alWave,inst->cWave);
\r
473 alOut(which + alFeedCon,inst->nConn); // DEBUG - I think this is right
\r
477 ///////////////////////////////////////////////////////////////////////////
\r
479 // SDL_ALStopSound() - Turns off any sound effects playing through the
\r
482 ///////////////////////////////////////////////////////////////////////////
\r
488 SDL_ALStopSound(void)
\r
494 alOut(alFreqH + 0,0);
\r
500 SDL_AlSetFXInst(Instrument far *inst)
\r
506 alOut(m + alChar,inst->mChar);
\r
507 alOut(m + alScale,inst->mScale);
\r
508 alOut(m + alAttack,inst->mAttack);
\r
509 alOut(m + alSus,inst->mSus);
\r
510 alOut(m + alWave,inst->mWave);
\r
511 alOut(c + alChar,inst->cChar);
\r
512 alOut(c + alScale,inst->cScale);
\r
513 alOut(c + alAttack,inst->cAttack);
\r
514 alOut(c + alSus,inst->cSus);
\r
515 alOut(c + alWave,inst->cWave);
\r
516 // DEBUG!!! - I just put this in
\r
517 // alOut(alFeedCon,inst->nConn);
\r
520 ///////////////////////////////////////////////////////////////////////////
\r
522 // SDL_ALPlaySound() - Plays the specified sound on the AdLib card
\r
524 ///////////////////////////////////////////////////////////////////////////
\r
530 SDL_ALPlaySound(AdLibSound far *sound)
\r
532 Instrument far *inst;
\r
539 alLengthLeft = sound->common.length;
\r
540 alSound = sound->data;
\r
541 alBlock = ((sound->block & 7) << 2) | 0x20;
\r
542 inst = &sound->inst;
\r
544 if (!(inst->mSus | inst->cSus))
\r
547 Quit("SDL_ALPlaySound() - Bad instrument");
\r
550 SDL_AlSetFXInst(inst);
\r
555 ///////////////////////////////////////////////////////////////////////////
\r
557 // SDL_ALSoundService() - Plays the next sample out through the AdLib card
\r
559 ///////////////////////////////////////////////////////////////////////////
\r
561 SDL_ALSoundService(void)
\r
569 alOut(alFreqH + 0,0);
\r
572 alOut(alFreqL + 0,s);
\r
573 alOut(alFreqH + 0,alBlock);
\r
576 if (!(--alLengthLeft))
\r
579 alOut(alFreqH + 0,0);
\r
580 SDL_SoundFinished();
\r
586 ///////////////////////////////////////////////////////////////////////////
\r
588 // SDL_SelectMeasure() - sets up sequencing variables for a given track
\r
590 ///////////////////////////////////////////////////////////////////////////
\r
592 SDL_SelectMeasure(ActiveTrack *track)
\r
594 track->seq = track->moods[track->mood];
\r
595 track->nextevent = 0;
\r
600 SDL_ALService(void)
\r
608 while (sqHackLen && (sqHackTime <= alTimeCount))
\r
611 sqHackTime = alTimeCount + *sqHackPtr++;
\r
621 sqHackPtr = (word far *)sqHack;
\r
622 sqHackLen = sqHackSeqLen;
\r
623 alTimeCount = sqHackTime = 0;
\r
627 ///////////////////////////////////////////////////////////////////////////
\r
629 // SDL_ShutAL() - Shuts down the AdLib card for sound effects
\r
631 ///////////////////////////////////////////////////////////////////////////
\r
638 alOut(alEffects,0);
\r
639 alOut(alFreqH + 0,0);
\r
640 SDL_AlSetFXInst(&alZeroInst);
\r
646 ///////////////////////////////////////////////////////////////////////////
\r
648 // SDL_CleanAL() - Totally shuts down the AdLib card
\r
650 ///////////////////////////////////////////////////////////////////////////
\r
659 alOut(alEffects,0);
\r
660 for (i = 1;i < 0xf5;i++)
\r
666 ///////////////////////////////////////////////////////////////////////////
\r
668 // SDL_StartAL() - Starts up the AdLib card for sound effects
\r
670 ///////////////////////////////////////////////////////////////////////////
\r
675 alOut(alEffects,alFXReg);
\r
676 SDL_AlSetFXInst(&alZeroInst);
\r
679 ///////////////////////////////////////////////////////////////////////////
\r
681 // SDL_DetectAdLib() - Determines if there's an AdLib (or SoundBlaster
\r
682 // emulating an AdLib) present
\r
684 ///////////////////////////////////////////////////////////////////////////
\r
686 SDL_DetectAdLib(void)
\r
688 byte status1,status2;
\r
691 alOut(4,0x60); // Reset T1 & T2
\r
692 alOut(4,0x80); // Reset IRQ
\r
693 status1 = readstat();
\r
694 alOut(2,0xff); // Set timer 1
\r
695 alOut(4,0x21); // Start timer 1
\r
696 SDL_Delay(TimerDelay100);
\r
698 status2 = readstat();
\r
702 if (((status1 & 0xe0) == 0x00) && ((status2 & 0xe0) == 0xc0))
\r
704 for (i = 1;i <= 0xf5;i++) // Zero all the registers
\r
707 alOut(1,0x20); // Set WSE=1
\r
708 alOut(8,0); // Set CSM=0 & SEL=0
\r
716 ///////////////////////////////////////////////////////////////////////////
\r
718 // SDL_t0Service() - My timer 0 ISR which handles the different timings and
\r
719 // dispatches to whatever other routines are appropriate
\r
721 ///////////////////////////////////////////////////////////////////////////
\r
722 static void interrupt
\r
723 SDL_t0Service(void)
\r
725 static word count = 1;
\r
727 #if 0 // for debugging
\r
728 asm mov dx,STATUS_REGISTER_1
\r
730 asm mov dx,ATR_INDEX
\r
731 asm mov al,ATR_OVERSCAN
\r
733 asm mov al,4 // red
\r
739 if (MusicMode == smm_AdLib)
\r
742 if (!(++count & 7))
\r
757 SDL_ALSoundService();
\r
764 if (!(++count & 1))
\r
777 SDL_ALSoundService();
\r
782 asm mov ax,[WORD PTR TimerCount]
\r
783 asm add ax,[WORD PTR TimerDivisor]
\r
784 asm mov [WORD PTR TimerCount],ax
\r
786 t0OldService(); // If we overflow a word, time to call old int handler
\r
789 outportb(0x20,0x20); // Ack the interrupt
\r
792 #if 0 // for debugging
\r
793 asm mov dx,STATUS_REGISTER_1
\r
795 asm mov dx,ATR_INDEX
\r
796 asm mov al,ATR_OVERSCAN
\r
798 asm mov al,3 // blue
\r
800 asm mov al,0x20 // normal
\r
805 ////////////////////////////////////////////////////////////////////////////
\r
807 // SDL_ShutDevice() - turns off whatever device was being used for sound fx
\r
809 ////////////////////////////////////////////////////////////////////////////
\r
811 SDL_ShutDevice(void)
\r
822 SoundMode = sdm_Off;
\r
825 ///////////////////////////////////////////////////////////////////////////
\r
827 // SDL_CleanDevice() - totally shuts down all sound devices
\r
829 ///////////////////////////////////////////////////////////////////////////
\r
831 SDL_CleanDevice(void)
\r
833 if ((SoundMode == sdm_AdLib) || (MusicMode == smm_AdLib))
\r
837 ///////////////////////////////////////////////////////////////////////////
\r
839 // SDL_StartDevice() - turns on whatever device is to be used for sound fx
\r
841 ///////////////////////////////////////////////////////////////////////////
\r
843 SDL_StartDevice(void)
\r
851 SoundNumber = SoundPriority = 0;
\r
855 SDL_SetTimerSpeed(void)
\r
859 if (MusicMode == smm_AdLib)
\r
860 rate = TickBase * 8;
\r
862 rate = TickBase * 2;
\r
863 SDL_SetIntsPerSec(rate);
\r
868 ///////////////////////////////////////////////////////////////////////////
\r
870 // SD_SetSoundMode() - Sets which sound hardware to use for sound effects
\r
872 ///////////////////////////////////////////////////////////////////////////
\r
874 SD_SetSoundMode(SDMode mode)
\r
885 NeedsDigitized = false;
\r
889 tableoffset = STARTPCSOUNDS;
\r
890 NeedsDigitized = false;
\r
896 tableoffset = STARTADLIBSOUNDS;
\r
897 NeedsDigitized = false;
\r
907 if (result && (mode != SoundMode))
\r
912 SoundTable = (word *)(&audiosegs[tableoffset]);
\r
917 SDL_SetTimerSpeed();
\r
922 ///////////////////////////////////////////////////////////////////////////
\r
924 // SD_SetMusicMode() - sets the device to use for background music
\r
926 ///////////////////////////////////////////////////////////////////////////
\r
928 SD_SetMusicMode(SMMode mode)
\r
933 while (SD_MusicPlaying())
\r
939 NeedsMusic = false;
\r
957 SDL_SetTimerSpeed();
\r
962 ///////////////////////////////////////////////////////////////////////////
\r
964 // SD_Startup() - starts up the Sound Mgr
\r
965 // Detects all additional sound hardware and installs my ISR
\r
967 ///////////////////////////////////////////////////////////////////////////
\r
979 for (i = 1;i < _argc;i++)
\r
981 switch (US_CheckParm(_argv[i],ParmStrings))
\r
983 case 0: // No AdLib detection
\r
992 t0OldService = getvect(8); // Get old timer 0 ISR
\r
994 SDL_InitDelay(); // SDL_InitDelay() uses t0OldService
\r
996 setvect(8,SDL_t0Service); // Set to my timer 0 ISR
\r
997 LocalTime = TimeCount = alTimeCount = 0;
\r
999 SD_SetSoundMode(sdm_Off);
\r
1000 SD_SetMusicMode(smm_Off);
\r
1003 AdLibPresent = SDL_DetectAdLib();
\r
1005 for (i = 0;i < 255;i++)
\r
1006 pcSoundLookup[i] = i * 60;
\r
1008 SD_Started = true;
\r
1011 ///////////////////////////////////////////////////////////////////////////
\r
1013 // SD_Default() - Sets up the default behaviour for the Sound Mgr whether
\r
1014 // the config file was present or not.
\r
1016 ///////////////////////////////////////////////////////////////////////////
\r
1018 SD_Default(boolean gotit,SDMode sd,SMMode sm)
\r
1020 boolean gotsd,gotsm;
\r
1022 gotsd = gotsm = gotit;
\r
1024 if (gotsd) // Make sure requested sound hardware is available
\r
1029 gotsd = AdLibPresent;
\r
1040 if (sd != SoundMode)
\r
1041 SD_SetSoundMode(sd);
\r
1044 if (gotsm) // Make sure requested music hardware is available
\r
1049 gotsm = AdLibPresent;
\r
1058 if (sm != MusicMode)
\r
1059 SD_SetMusicMode(sm);
\r
1062 ///////////////////////////////////////////////////////////////////////////
\r
1064 // SD_Shutdown() - shuts down the Sound Mgr
\r
1065 // Removes sound ISR and turns off whatever sound hardware was active
\r
1067 ///////////////////////////////////////////////////////////////////////////
\r
1076 SDL_CleanDevice();
\r
1083 setvect(8,t0OldService);
\r
1087 SD_Started = false;
\r
1090 ///////////////////////////////////////////////////////////////////////////
\r
1092 // SD_SetUserHook() - sets the routine that the Sound Mgr calls every 1/70th
\r
1093 // of a second from its timer 0 ISR
\r
1095 ///////////////////////////////////////////////////////////////////////////
\r
1097 SD_SetUserHook(void (* hook)(void))
\r
1099 SoundUserHook = hook;
\r
1102 ///////////////////////////////////////////////////////////////////////////
\r
1104 // SD_PlaySound() - plays the specified sound on the appropriate hardware
\r
1106 ///////////////////////////////////////////////////////////////////////////
\r
1108 SD_PlaySound(soundnames sound)
\r
1110 SoundCommon far *s;
\r
1112 if ((SoundMode == sdm_Off) || (sound == -1))
\r
1115 s = MK_FP(SoundTable[sound],0);
\r
1117 Quit("SD_PlaySound() - Uncached sound");
\r
1119 Quit("SD_PlaySound() - Zero length sound");
\r
1120 if (s->priority < SoundPriority)
\r
1123 switch (SoundMode)
\r
1126 SDL_PCPlaySound((void far *)s);
\r
1129 SDL_ALPlaySound((void far *)s);
\r
1133 SoundNumber = sound;
\r
1134 SoundPriority = s->priority;
\r
1137 ///////////////////////////////////////////////////////////////////////////
\r
1139 // SD_SoundPlaying() - returns the sound number that's playing, or 0 if
\r
1140 // no sound is playing
\r
1142 ///////////////////////////////////////////////////////////////////////////
\r
1144 SD_SoundPlaying(void)
\r
1146 boolean result = false;
\r
1148 switch (SoundMode)
\r
1151 result = pcSound? true : false;
\r
1154 result = alSound? true : false;
\r
1159 return(SoundNumber);
\r
1164 ///////////////////////////////////////////////////////////////////////////
\r
1166 // SD_StopSound() - if a sound is playing, stops it
\r
1168 ///////////////////////////////////////////////////////////////////////////
\r
1170 SD_StopSound(void)
\r
1172 switch (SoundMode)
\r
1175 SDL_PCStopSound();
\r
1178 SDL_ALStopSound();
\r
1182 SDL_SoundFinished();
\r
1185 ///////////////////////////////////////////////////////////////////////////
\r
1187 // SD_WaitSoundDone() - waits until the current sound is done playing
\r
1189 ///////////////////////////////////////////////////////////////////////////
\r
1191 SD_WaitSoundDone(void)
\r
1193 while (SD_SoundPlaying())
\r
1197 ///////////////////////////////////////////////////////////////////////////
\r
1199 // SD_MusicOn() - turns on the sequencer
\r
1201 ///////////////////////////////////////////////////////////////////////////
\r
1208 ///////////////////////////////////////////////////////////////////////////
\r
1210 // SD_MusicOff() - turns off the sequencer and any playing notes
\r
1212 ///////////////////////////////////////////////////////////////////////////
\r
1219 switch (MusicMode)
\r
1223 alOut(alEffects,0);
\r
1224 for (i = 0;i < sqMaxTracks;i++)
\r
1225 alOut(alFreqH + i + 1,0);
\r
1231 ///////////////////////////////////////////////////////////////////////////
\r
1233 // SD_StartMusic() - starts playing the music pointed to
\r
1235 ///////////////////////////////////////////////////////////////////////////
\r
1237 SD_StartMusic(MusicGroup far *music)
\r
1243 if (MusicMode == smm_AdLib)
\r
1245 sqHackPtr = sqHack = music->values;
\r
1246 sqHackSeqLen = sqHackLen = music->length;
\r
1255 ///////////////////////////////////////////////////////////////////////////
\r
1257 // SD_FadeOutMusic() - starts fading out the music. Call SD_MusicPlaying()
\r
1258 // to see if the fadeout is complete
\r
1260 ///////////////////////////////////////////////////////////////////////////
\r
1262 SD_FadeOutMusic(void)
\r
1264 switch (MusicMode)
\r
1267 // DEBUG - quick hack to turn the music off
\r
1273 ///////////////////////////////////////////////////////////////////////////
\r
1275 // SD_MusicPlaying() - returns true if music is currently playing, false if
\r
1278 ///////////////////////////////////////////////////////////////////////////
\r
1280 SD_MusicPlaying(void)
\r
1284 switch (MusicMode)
\r
1288 // DEBUG - not written
\r