sgdk
sound.h
Go to the documentation of this file.
00001 
00030 #ifndef _SOUND_H_
00031 #define _SOUND_H_
00032 
00033 
00038 #define SOUND_PCM_CH_AUTO   0xFF
00039 
00044 #define SOUND_PCM_CH1       Z80_DRV_CH0_SFT
00045 
00049 #define SOUND_PCM_CH2       Z80_DRV_CH1_SFT
00050 
00054 #define SOUND_PCM_CH3       Z80_DRV_CH2_SFT
00055 
00059 #define SOUND_PCM_CH4       Z80_DRV_CH3_SFT
00060 
00065 #define SOUND_PCM_CH1_MSK   Z80_DRV_CH0
00066 
00070 #define SOUND_PCM_CH2_MSK   Z80_DRV_CH1
00071 
00075 #define SOUND_PCM_CH3_MSK   Z80_DRV_CH2
00076 
00080 #define SOUND_PCM_CH4_MSK   Z80_DRV_CH3
00081 
00087 #define SOUND_RATE_32000    0
00088 
00093 #define SOUND_RATE_22050    1
00094 
00098 #define SOUND_RATE_16000    2
00099 
00104 #define SOUND_RATE_13400    3
00105 
00109 #define SOUND_RATE_11025    4
00110 
00115 #define SOUND_RATE_8000     5
00116 
00121 #define SOUND_PAN_LEFT      0x80
00122 
00126 #define SOUND_PAN_RIGHT     0x40
00127 
00131 #define SOUND_PAN_CENTER    0xC0
00132 
00133 
00141 u8   SND_isPlaying_PCM();
00170 void SND_startPlay_PCM(const u8 *sample, const u32 len, const u8 rate, const u8 pan, const u8 loop);
00176 void SND_stopPlay_PCM();
00177 
00178 
00179 // Z80_DRIVER_2ADPCM
00180 
00197 u8 SND_isPlaying_2ADPCM(const u16 channel_mask);
00218 void SND_startPlay_2ADPCM(const u8 *sample, const u32 len, const u16 channel, const u8 loop);
00229 void SND_stopPlay_2ADPCM(const u16 channel);
00230 
00231 
00232 // Z80_DRIVER_4PCM
00233 
00252 u8   SND_isPlaying_4PCM(const u16 channel_mask);
00275 void SND_startPlay_4PCM(const u8 *sample, const u32 len, const u16 channel, const u8 loop);
00288 void SND_stopPlay_4PCM(const u16 channel);
00302 void SND_setVolume_4PCM(const u16 channel, const u8 volume);
00317 u8   SND_getVolume_4PCM(const u16 channel);
00318 
00319 
00320 // just to preserve backward compatibility
00321 #define SND_isPlaying_4PCM_ENV      SND_isPlaying_4PCM
00322 #define SND_startPlay_4PCM_ENV      SND_startPlay_4PCM
00323 #define SND_stopPlay_4PCM_ENV       SND_stopPlay_4PCM
00324 #define SND_getVolume_4PCM_ENV      SND_getVolume_4PCM
00325 #define SND_setVolume_4PCM_ENV      SND_setVolume_4PCM
00326 
00327 
00328 
00329 // Z80_DRIVER_XGM
00330 
00334 u8 SND_isPlaying_XGM();
00338 void SND_startPlay_XGM(const u8 *song);
00342 void SND_stopPlay_XGM();
00346 void SND_pausePlay_XGM();
00350 void SND_resumePlay_XGM();
00351 
00355 u8 SND_isPlayingPCM_XGM(const u16 channel_mask);
00359 void SND_setPCM_XGM(const u8 id, const u8 *sample, const u32 len);
00363 void SND_setPCMFast_XGM(const u8 id, const u8 *sample, const u32 len);
00367 void SND_startPlayPCM_XGM(const u8 id, const u8 priority, const u16 channel);
00371 void SND_stopPlayPCM_XGM(const u16 channel);
00372 
00376 u16 SND_getMusicTempo_XGM();
00380 void SND_setMusicTempo_XGM(u16 value);
00381 
00385 u16 SND_getManualSync_XGM();
00389 void SND_setManualSync_XGM(u16 value);
00393 #define SND_nextFrame_XGM()  SND_nextXFrame_XGM(1)
00394 
00397 void SND_nextXFrame_XGM(u16 num);
00398 
00402 void SND_setLoopNumber_XGM(u8 value);
00403 
00407 void SND_set68KBUSProtection_XGM(u8 value);
00411 u16 SND_getForceDelayDMA_XGM();
00415 void SND_setForceDelayDMA_XGM(u16 value);
00419 u32 SND_getCPULoad_XGM();
00420 
00421 
00422 #endif // _SOUND_H_
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines