2019-12-21 16:23:03 +00:00
|
|
|
#include "defconv.h"
|
|
|
|
|
2020-02-18 18:46:34 +00:00
|
|
|
extern char snd_interrupt_if_midi;
|
2020-12-11 20:40:40 +00:00
|
|
|
extern bool snd_midi_possible;
|
2020-02-18 18:46:34 +00:00
|
|
|
#if GAME <= 3
|
|
|
|
typedef enum {
|
|
|
|
SND_BGM_OFF,
|
|
|
|
SND_BGM_FM,
|
|
|
|
SND_BGM_MIDI
|
|
|
|
} snd_bgm_mode_t;
|
|
|
|
|
2020-12-11 20:40:40 +00:00
|
|
|
extern bool snd_active;
|
|
|
|
extern bool snd_midi_active;
|
|
|
|
extern bool snd_fm_possible;
|
2020-12-29 20:05:57 +00:00
|
|
|
|
|
|
|
#define snd_bgm_is_fm() \
|
|
|
|
(snd_midi_active != true)
|
2020-02-18 18:46:34 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int snd_pmd_resident(void);
|
|
|
|
#if GAME != 3
|
|
|
|
int snd_mmd_resident(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int snd_determine_mode(void);
|
|
|
|
int16_t DEFCONV snd_kaja_interrupt(int16_t ax);
|
|
|
|
#define snd_kaja_func(func, param) snd_kaja_interrupt((func) << 8 | (param))
|
|
|
|
|
2020-09-06 16:13:07 +00:00
|
|
|
void snd_delay_until_volume(uint8_t volume);
|
|
|
|
|
2020-12-21 16:22:49 +00:00
|
|
|
#if (GAME == 2)
|
|
|
|
void snd_delay_until_measure(int measure);
|
|
|
|
#endif
|
|
|
|
|
2020-08-05 17:14:38 +00:00
|
|
|
#define SND_LOAD_SONG (kaja_func_t)(KAJA_GET_SONG_ADDRESS << 8)
|
|
|
|
#define SND_LOAD_SE (kaja_func_t)(PMD_GET_SE_ADDRESS << 8)
|
2020-02-18 18:46:34 +00:00
|
|
|
|
2020-09-06 16:13:07 +00:00
|
|
|
#if defined(PMD) && (GAME <= 3) /* requires kaja.h */
|
|
|
|
// Loads a song in .M format ([func] = SND_LOAD_SONG) or a sound effect
|
|
|
|
// bank in EFC format ([func] = SND_LOAD_SE) into the respective work
|
|
|
|
// buffer of the sound driver. If MIDI is used, 'md' is appended to the
|
|
|
|
// file name.
|
|
|
|
void DEFCONV snd_load(const char *fn, kaja_func_t func);
|
2020-02-18 18:46:34 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void snd_se_reset(void);
|
2019-10-13 19:52:02 +00:00
|
|
|
void DEFCONV snd_se_play(int new_se);
|
2020-02-18 18:46:34 +00:00
|
|
|
void snd_se_update(void);
|
2020-09-19 12:30:57 +00:00
|
|
|
|
|
|
|
// Cancels any currently playing sound effect to play the given one.
|
|
|
|
#define snd_se_play_force(new_se) \
|
|
|
|
snd_se_reset(); \
|
|
|
|
snd_se_play(new_se); \
|
|
|
|
snd_se_update();
|