1 /* Reconstructed Commander Keen 4-6 Source Code
\r
2 * Copyright (C) 2021 K1n9_Duk3
\r
4 * This file is primarily based on:
\r
5 * Catacomb 3-D Source Code
\r
6 * Copyright (C) 1993-2014 Flat Rock Software
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License along
\r
19 * with this program; if not, write to the Free Software Foundation, Inc.,
\r
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
25 // ID_SD.h - Sound Manager Header
\r
27 // By Jason Blochowiak
\r
31 #include "ID_Types.h"
\r
38 #define __DEBUG_SoundMgr__
\r
41 #define TickBase 70 // 70Hz per tick - used as a base for timer 0
\r
58 #define pcTimer 0x42
\r
59 #define pcTAccess 0x43
\r
60 #define pcSpeaker 0x61
\r
70 // Registers for the Sound Blaster card - needs to be offset by n0
\r
71 #define sbReset 0x206
\r
72 #define sbReadData 0x20a
\r
73 #define sbWriteCmd 0x20c
\r
74 #define sbWriteData 0x20c
\r
75 #define sbWriteStat 0x20c
\r
76 #define sbDataAvail 0x20e
\r
87 // Registers for the AdLib card
\r
90 #define alScale 0x40
\r
91 #define alAttack 0x60
\r
95 #define alFreqL 0xa0
\r
96 #define alFreqH 0xb0
\r
97 #define alFeedCon 0xc0
\r
99 #define alEffects 0xbd
\r
110 // These are only for Muse - these bytes are really unused
\r
118 SoundCommon common;
\r
125 // Sequencing stuff
\r
127 #define sqMaxTracks 10
\r
128 #define sqMaxMoods 1 // DEBUG
\r
130 #define sev_Null 0 // Does nothing
\r
131 #define sev_NoteOff 1 // Turns a note off
\r
132 #define sev_NoteOn 2 // Turns a note on
\r
133 #define sev_NotePitch 3 // Sets the pitch of a currently playing note
\r
134 #define sev_NewInst 4 // Installs a new instrument
\r
135 #define sev_NewPerc 5 // Installs a new percussive instrument
\r
136 #define sev_PercOn 6 // Turns a percussive note on
\r
137 #define sev_PercOff 7 // Turns a percussive note off
\r
138 #define sev_SeqEnd -1 // Terminates a sequence
\r
140 // Flags for MusicGroup.flags
\r
141 #define sf_Melodic 0
\r
142 #define sf_Percussive 1
\r
161 /* This part needs to be set up by the user */
\r
162 word mood,far *moods[sqMaxMoods];
\r
164 /* The rest is set up by the code */
\r
166 boolean percussive;
\r
168 longword nextevent;
\r
171 #define sqmode_Normal 0
\r
172 #define sqmode_FadeIn 1
\r
173 #define sqmode_FadeOut 2
\r
175 #define sqMaxFade 64 // DEBUG
\r
178 // Global variables
\r
179 extern boolean AdLibPresent,
\r
180 NeedsMusic, // For Caching Mgr
\r
182 extern SDMode SoundMode;
\r
183 extern SMMode MusicMode;
\r
184 extern longword TimeCount; // Global time in ticks
\r
186 // Function prototypes
\r
187 extern void SD_Startup(void),
\r
189 SD_Default(boolean gotit,SDMode sd,SMMode sm),
\r
190 SD_PlaySound(soundnames sound),
\r
191 SD_StopSound(void),
\r
192 SD_WaitSoundDone(void),
\r
193 SD_StartMusic(MusicGroup far *music),
\r
196 SD_FadeOutMusic(void),
\r
197 SD_SetUserHook(void (*hook)(void));
\r
198 extern boolean SD_MusicPlaying(void),
\r
199 SD_SetSoundMode(SDMode mode),
\r
200 SD_SetMusicMode(SMMode mode);
\r
201 extern word SD_SoundPlaying(void);
\r
203 #ifdef _MUSE_ // MUSE Goes directly to the lower level routines
\r
204 extern void SDL_PCPlaySound(PCSound far *sound),
\r
205 SDL_PCStopSound(void),
\r
206 SDL_ALPlaySound(AdLibSound far *sound),
\r
207 SDL_ALStopSound(void);
\r