1 /*
2 * UAE - The Un*x Amiga Emulator
3 *
4 * Sound emulation stuff
5 *
6 * Copyright 1995, 1996, 1997 Bernd Schmidt
7 */
8
9 #define PERIOD_MAX ULONG_MAX
10
11 extern void AUDxDAT (int nr, uae_u16 value);
12 extern void AUDxVOL (int nr, uae_u16 value);
13 extern void AUDxPER (int nr, uae_u16 value);
14 extern void AUDxLCH (int nr, uae_u16 value);
15 extern void AUDxLCL (int nr, uae_u16 value);
16 extern void AUDxLEN (int nr, uae_u16 value);
17
18 extern int init_audio (void);
19 extern void ahi_install (void);
20 extern void audio_reset (void);
21 extern void update_audio (void);
22 extern void schedule_audio (void);
23 extern void audio_evhandler (void);
24 extern void audio_hsync (int);
25 extern void update_adkmasks (void);
26 extern void update_sound (unsigned int freq);
27 extern void led_filter_audio (void);
28
29 /* Must match the stereomode array in cfgfile.c. */
30 enum {
31 SND_MONO, SND_STEREO, SND_NONE
32 };
33
get_audio_nativechannels(void)34 STATIC_INLINE int get_audio_nativechannels (void)
35 {
36 int ch[] = { 1, 2, 0 };
37 return ch[currprefs.sound_stereo];
38 }
39
get_audio_amigachannels(void)40 STATIC_INLINE int get_audio_amigachannels (void)
41 {
42 int ch[] = { 1, 2, 0 };
43 return ch[currprefs.sound_stereo];
44 }
45
get_audio_ismono(void)46 STATIC_INLINE int get_audio_ismono (void)
47 {
48 if (currprefs.sound_stereo == 0)
49 return 1;
50 return 0;
51 }
52
53 #define SOUND_MAX_DELAY_BUFFER 1024
54 #define SOUND_MAX_LOG_DELAY 10
55 #define MIXED_STEREO_MAX 16
56 #define MIXED_STEREO_SCALE 32
57