2017-05-30 03:38:38 +02:00
|
|
|
/*
|
2022-02-22 20:28:56 -05:00
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2022-02-22 20:28:56 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2022-02-22 20:28:56 -05:00
|
|
|
* Sound emulation core.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2023-01-06 15:36:29 -05:00
|
|
|
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
2022-02-22 20:28:56 -05:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-11-05 01:57:04 -05:00
|
|
|
*
|
2022-02-22 20:28:56 -05:00
|
|
|
* Copyright 2008-2018 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2018 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2022-02-18 19:47:35 -05:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
#ifndef EMU_SOUND_H
|
2022-02-22 20:28:56 -05:00
|
|
|
#define EMU_SOUND_H
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2023-02-01 02:31:07 -05:00
|
|
|
#define SOUND_CARD_MAX 4 /* currently we support up to 4 sound cards and a standalome MPU401 */
|
|
|
|
|
|
2018-02-11 20:51:42 +01:00
|
|
|
extern int sound_gain;
|
2017-12-10 15:16:24 +01:00
|
|
|
|
2023-04-18 16:16:42 -03:00
|
|
|
#define FREQ_44100 44100
|
|
|
|
|
#define FREQ_48000 48000
|
|
|
|
|
#define FREQ_49716 49716
|
|
|
|
|
#define FREQ_88200 88200
|
|
|
|
|
#define FREQ_96000 96000
|
2017-11-05 01:57:04 -05:00
|
|
|
|
2023-04-18 16:16:42 -03:00
|
|
|
#define SOUND_FREQ FREQ_48000
|
2022-11-06 23:45:35 -05:00
|
|
|
#define SOUNDBUFLEN (SOUND_FREQ / 50)
|
|
|
|
|
|
|
|
|
|
#define CD_FREQ FREQ_44100
|
2022-02-22 20:28:56 -05:00
|
|
|
#define CD_BUFLEN (CD_FREQ / 10)
|
2017-11-05 01:57:04 -05:00
|
|
|
|
2020-05-19 21:15:25 -03:00
|
|
|
enum {
|
|
|
|
|
SOUND_NONE = 0,
|
|
|
|
|
SOUND_INTERNAL
|
|
|
|
|
};
|
|
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern int ppispeakon;
|
2023-05-11 03:02:36 -04:00
|
|
|
extern int gated;
|
|
|
|
|
extern int speakval;
|
|
|
|
|
extern int speakon;
|
2020-05-19 21:15:25 -03:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern int sound_pos_global;
|
2023-02-01 02:31:07 -05:00
|
|
|
extern int sound_card_current[SOUND_CARD_MAX];
|
2017-11-05 01:57:04 -05:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_add_handler(void (*get_buffer)(int32_t *buffer,
|
2023-08-21 20:26:11 -04:00
|
|
|
int len, void *priv),
|
|
|
|
|
void *priv);
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_set_cd_audio_filter(void (*filter)(int channel,
|
2023-08-21 20:26:11 -04:00
|
|
|
double *buffer, void *priv),
|
|
|
|
|
void *priv);
|
2017-11-05 01:57:04 -05:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern int sound_card_available(int card);
|
2017-10-07 00:46:54 -04:00
|
|
|
#ifdef EMU_DEVICE_H
|
2022-02-22 20:28:56 -05:00
|
|
|
extern const device_t *sound_card_getdevice(int card);
|
2017-10-07 00:46:54 -04:00
|
|
|
#endif
|
2023-08-21 20:26:11 -04:00
|
|
|
extern int sound_card_has_config(int card);
|
|
|
|
|
extern const char *sound_card_get_internal_name(int card);
|
|
|
|
|
extern int sound_card_get_from_internal_name(const char *s);
|
|
|
|
|
extern void sound_card_init(void);
|
|
|
|
|
extern void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_speed_changed(void);
|
2017-05-05 01:49:42 +02:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_init(void);
|
|
|
|
|
extern void sound_reset(void);
|
2017-05-05 01:49:42 +02:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_card_reset(void);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void sound_cd_thread_end(void);
|
|
|
|
|
extern void sound_cd_thread_reset(void);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
extern void closeal(void);
|
|
|
|
|
extern void inital(void);
|
|
|
|
|
extern void givealbuffer(void *buf);
|
|
|
|
|
extern void givealbuffer_cd(void *buf);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2023-10-08 06:11:32 +02:00
|
|
|
#define sb_vibra16c_onboard_relocate_base sb_vibra16s_onboard_relocate_base
|
2023-10-08 05:21:12 +02:00
|
|
|
extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv);
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
#ifdef EMU_DEVICE_H
|
|
|
|
|
/* AdLib and AdLib Gold */
|
|
|
|
|
extern const device_t adlib_device;
|
|
|
|
|
extern const device_t adlib_mca_device;
|
|
|
|
|
extern const device_t adgold_device;
|
|
|
|
|
|
2020-03-25 00:49:25 +01:00
|
|
|
/* Aztech Sound Galaxy 16 */
|
|
|
|
|
extern const device_t azt2316a_device;
|
2022-10-29 03:36:48 +02:00
|
|
|
extern const device_t acermagic_s20_device;
|
2022-11-19 12:34:31 +06:00
|
|
|
extern const device_t mirosound_pcm10_device;
|
2020-03-25 00:49:25 +01:00
|
|
|
extern const device_t azt1605_device;
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Ensoniq AudioPCI */
|
|
|
|
|
extern const device_t es1371_device;
|
2020-05-19 21:15:25 -03:00
|
|
|
extern const device_t es1371_onboard_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Creative Labs Game Blaster */
|
|
|
|
|
extern const device_t cms_device;
|
|
|
|
|
|
|
|
|
|
/* Gravis UltraSound and UltraSound Max */
|
|
|
|
|
extern const device_t gus_device;
|
|
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
# if defined(DEV_BRANCH) && defined(USE_PAS16)
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Pro Audio Spectrum 16 */
|
|
|
|
|
extern const device_t pas16_device;
|
2022-02-22 20:28:56 -05:00
|
|
|
# endif
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-01-08 20:15:56 -05:00
|
|
|
/* IBM PS/1 Audio Card */
|
|
|
|
|
extern const device_t ps1snd_device;
|
|
|
|
|
|
2021-05-19 00:46:15 -03:00
|
|
|
/* Tandy PSSJ */
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t pssj_device;
|
2022-01-08 20:14:34 -05:00
|
|
|
extern const device_t pssj_isa_device;
|
2022-09-21 18:14:17 -04:00
|
|
|
|
|
|
|
|
/* Tandy PSG */
|
2022-02-14 05:10:50 +05:00
|
|
|
extern const device_t tndy_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Creative Labs Sound Blaster */
|
|
|
|
|
extern const device_t sb_1_device;
|
|
|
|
|
extern const device_t sb_15_device;
|
|
|
|
|
extern const device_t sb_mcv_device;
|
|
|
|
|
extern const device_t sb_2_device;
|
|
|
|
|
extern const device_t sb_pro_v1_device;
|
|
|
|
|
extern const device_t sb_pro_v2_device;
|
|
|
|
|
extern const device_t sb_pro_mcv_device;
|
2021-07-18 19:03:01 -03:00
|
|
|
extern const device_t sb_pro_compat_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t sb_16_device;
|
2023-10-08 05:21:12 +02:00
|
|
|
extern const device_t sb_vibra16s_onboard_device;
|
2023-10-10 00:18:13 +02:00
|
|
|
extern const device_t sb_vibra16s_device;
|
|
|
|
|
extern const device_t sb_vibra16xv_device;
|
2023-10-08 06:11:32 +02:00
|
|
|
extern const device_t sb_vibra16c_onboard_device;
|
2023-10-10 00:18:13 +02:00
|
|
|
extern const device_t sb_vibra16c_device;
|
2021-03-20 01:21:42 -03:00
|
|
|
extern const device_t sb_16_pnp_device;
|
2022-02-25 19:22:45 -03:00
|
|
|
extern const device_t sb_16_compat_device;
|
2022-03-06 01:29:29 -03:00
|
|
|
extern const device_t sb_16_compat_nompu_device;
|
2022-07-23 23:54:42 +02:00
|
|
|
extern const device_t sb_16_reply_mca_device;
|
2021-03-22 23:16:08 -03:00
|
|
|
extern const device_t sb_32_pnp_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t sb_awe32_device;
|
2021-03-20 01:21:42 -03:00
|
|
|
extern const device_t sb_awe32_pnp_device;
|
2022-02-12 19:08:02 -05:00
|
|
|
extern const device_t sb_awe64_value_device;
|
|
|
|
|
extern const device_t sb_awe64_device;
|
2021-07-25 20:49:27 +05:00
|
|
|
extern const device_t sb_awe64_gold_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Innovation SSI-2001 */
|
|
|
|
|
extern const device_t ssi2001_device;
|
|
|
|
|
|
|
|
|
|
/* Windows Sound System */
|
|
|
|
|
extern const device_t wss_device;
|
|
|
|
|
extern const device_t ncr_business_audio_device;
|
2021-05-19 00:46:15 -03:00
|
|
|
|
|
|
|
|
/* Crystal CS423x */
|
2022-02-18 21:42:05 +01:00
|
|
|
extern const device_t cs4235_device;
|
|
|
|
|
extern const device_t cs4235_onboard_device;
|
2021-05-22 22:29:25 -03:00
|
|
|
extern const device_t cs4236b_device;
|
2021-06-03 01:15:23 -03:00
|
|
|
extern const device_t cs4237b_device;
|
|
|
|
|
extern const device_t cs4238b_device;
|
2022-02-25 19:22:45 -03:00
|
|
|
|
|
|
|
|
/* C-Media CMI8x38 */
|
|
|
|
|
extern const device_t cmi8338_device;
|
2022-02-25 20:26:21 -03:00
|
|
|
extern const device_t cmi8338_onboard_device;
|
2022-02-25 19:22:45 -03:00
|
|
|
extern const device_t cmi8738_device;
|
2022-02-25 20:26:21 -03:00
|
|
|
extern const device_t cmi8738_onboard_device;
|
2022-03-07 10:45:10 -03:00
|
|
|
extern const device_t cmi8738_6ch_onboard_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
#endif
|
|
|
|
|
|
2022-02-22 20:28:56 -05:00
|
|
|
#endif /*EMU_SOUND_H*/
|