PVcollib  1.5.0
A devkit for ColecoVision
sound.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  Generic sound functions.
4 
5  Copyright (C) 2018-2019
6  Alekmaul
7 
8  This software is provided 'as-is', without any express or implied
9  warranty. In no event will the authors be held liable for any
10  damages arising from the use of this software.
11 
12  Permission is granted to anyone to use this software for any
13  purpose, including commercial applications, and to alter it and
14  redistribute it freely, subject to the following restrictions:
15 
16  1. The origin of this software must not be misrepresented; you
17  must not claim that you wrote the original software. If you use
18  this software in a product, an acknowledgment in the product
19  documentation would be appreciated but is not required.
20  2. Altered source versions must be plainly marked as such, and
21  must not be misrepresented as being the original software.
22  3. This notice may not be removed or altered from any source
23  distribution.
24 
25 
26 ---------------------------------------------------------------------------------*/
32 #ifndef COL_SOUND_H
33 #define COL_SOUND_H
34 
35 #include <coleco/coltypes.h>
36 
40 typedef struct
41 {
42  void *sound_data;
43  unsigned sound_area;
44 } sound_t;
45 
49 #define SOUNDAREA1 0x702b
50 #define SOUNDAREA2 0x702b+10
51 #define SOUNDAREA3 0x702b+20
52 #define SOUNDAREA4 0x702b+30
53 #define SOUNDAREA5 0x702b+40
54 #define SOUNDAREA6 0x702b+50
55 
60 extern volatile u8 snd_mute;
61 
69 void snd_settable (void *snd_table);
70 
71 /*
72  * \fn snd_startplay (u8 sound_number)
73  * \brief play a sound specified but sound_number
74  *
75  * \param sound_number aid of sound in sound table
76  * \return nothing
77 */
78 void snd_startplay(u8 sound_number);
79 
87 void snd_stopplay(u8 sound_number);
88 
95 void snd_stopall(void);
96 
104 u8 snd_isplaying(u8 sound_number);
105 
106 #endif
volatile u8 snd_mute
put 1 to snd_mute to disable sound update.
void snd_stopplay(u8 sound_number)
stop a sound specified but sound_number
Custom types used by pvcollib.
void snd_settable(void *snd_table)
define the sound table used for playing sound
definition of sound area
Definition: sound.h:40
u8 snd_isplaying(u8 sound_number)
retrieve if channel is playing or not
void snd_stopall(void)
mute all channels