Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio.h @ 1662:782fd950bd46 SDL-1.3
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 28 May 2006 13:04:16 +0000 |
parents | 14717b52abc0 |
children | 4da1ee79c9af |
comparison
equal
deleted
inserted
replaced
1661:281d3f4870e5 | 1662:782fd950bd46 |
---|---|
35 | 35 |
36 /* Hidden "this" pointer for the audio functions */ | 36 /* Hidden "this" pointer for the audio functions */ |
37 #define _THIS SDL_AudioDevice *this | 37 #define _THIS SDL_AudioDevice *this |
38 | 38 |
39 /* 16 predivisors with 3 clocks max. */ | 39 /* 16 predivisors with 3 clocks max. */ |
40 #define MINTAUDIO_maxfreqs (16*3) | 40 #define MINTAUDIO_maxfreqs (16*3) |
41 | 41 |
42 typedef struct { | 42 typedef struct |
43 Uint32 frequency; | 43 { |
44 Uint32 masterclock; | 44 Uint32 frequency; |
45 Uint32 predivisor; | 45 Uint32 masterclock; |
46 int gpio_bits; /* in case of external clock */ | 46 Uint32 predivisor; |
47 int gpio_bits; /* in case of external clock */ | |
47 } mint_frequency_t; | 48 } mint_frequency_t; |
48 | 49 |
49 struct SDL_PrivateAudioData { | 50 struct SDL_PrivateAudioData |
50 mint_frequency_t frequencies[MINTAUDIO_maxfreqs]; | 51 { |
51 int freq_count; /* Number of frequencies in the array */ | 52 mint_frequency_t frequencies[MINTAUDIO_maxfreqs]; |
52 int numfreq; /* Number of selected frequency */ | 53 int freq_count; /* Number of frequencies in the array */ |
54 int numfreq; /* Number of selected frequency */ | |
53 }; | 55 }; |
54 | 56 |
55 /* Old variable names */ | 57 /* Old variable names */ |
56 | 58 |
57 #define MINTAUDIO_frequencies (this->hidden->frequencies) | 59 #define MINTAUDIO_frequencies (this->hidden->frequencies) |
58 #define MINTAUDIO_freqcount (this->hidden->freq_count) | 60 #define MINTAUDIO_freqcount (this->hidden->freq_count) |
59 #define MINTAUDIO_numfreq (this->hidden->numfreq) | 61 #define MINTAUDIO_numfreq (this->hidden->numfreq) |
60 | 62 |
61 /* _MCH cookie (values>>16) */ | 63 /* _MCH cookie (values>>16) */ |
62 enum { | 64 enum |
63 MCH_ST=0, | 65 { |
64 MCH_STE, | 66 MCH_ST = 0, |
65 MCH_TT, | 67 MCH_STE, |
66 MCH_F30, | 68 MCH_TT, |
67 MCH_CLONE, | 69 MCH_F30, |
68 MCH_ARANYM | 70 MCH_CLONE, |
71 MCH_ARANYM | |
69 }; | 72 }; |
70 | 73 |
71 /* Master clocks for replay frequencies */ | 74 /* Master clocks for replay frequencies */ |
72 #define MASTERCLOCK_STE 8010666 /* Not sure of this one */ | 75 #define MASTERCLOCK_STE 8010666 /* Not sure of this one */ |
73 #define MASTERCLOCK_TT 16107953 /* Not sure of this one */ | 76 #define MASTERCLOCK_TT 16107953 /* Not sure of this one */ |
74 #define MASTERCLOCK_FALCON1 25175000 | 77 #define MASTERCLOCK_FALCON1 25175000 |
75 #define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */ | 78 #define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */ |
76 #define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */ | 79 #define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */ |
77 #define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */ | 80 #define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */ |
78 #define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */ | 81 #define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */ |
79 | 82 |
80 /* Master clock predivisors */ | 83 /* Master clock predivisors */ |
81 #define MASTERPREDIV_STE 160 | 84 #define MASTERPREDIV_STE 160 |
82 #define MASTERPREDIV_TT 320 | 85 #define MASTERPREDIV_TT 320 |
83 #define MASTERPREDIV_FALCON 256 | 86 #define MASTERPREDIV_FALCON 256 |
84 #define MASTERPREDIV_MILAN 256 | 87 #define MASTERPREDIV_MILAN 256 |
85 | 88 |
86 /* MFP 68901 interrupt sources */ | 89 /* MFP 68901 interrupt sources */ |
87 enum { | 90 enum |
88 MFP_PARALLEL=0, | 91 { |
89 MFP_DCD, | 92 MFP_PARALLEL = 0, |
90 MFP_CTS, | 93 MFP_DCD, |
91 MFP_BITBLT, | 94 MFP_CTS, |
92 MFP_TIMERD, | 95 MFP_BITBLT, |
93 MFP_BAUDRATE=MFP_TIMERD, | 96 MFP_TIMERD, |
94 MFP_TIMERC, | 97 MFP_BAUDRATE = MFP_TIMERD, |
95 MFP_200HZ=MFP_TIMERC, | 98 MFP_TIMERC, |
96 MFP_ACIA, | 99 MFP_200HZ = MFP_TIMERC, |
97 MFP_DISK, | 100 MFP_ACIA, |
98 MFP_TIMERB, | 101 MFP_DISK, |
99 MFP_HBLANK=MFP_TIMERB, | 102 MFP_TIMERB, |
100 MFP_TERR, | 103 MFP_HBLANK = MFP_TIMERB, |
101 MFP_TBE, | 104 MFP_TERR, |
102 MFP_RERR, | 105 MFP_TBE, |
103 MFP_RBF, | 106 MFP_RERR, |
104 MFP_TIMERA, | 107 MFP_RBF, |
105 MFP_DMASOUND=MFP_TIMERA, | 108 MFP_TIMERA, |
106 MFP_RING, | 109 MFP_DMASOUND = MFP_TIMERA, |
107 MFP_MONODETECT | 110 MFP_RING, |
111 MFP_MONODETECT | |
108 }; | 112 }; |
109 | 113 |
110 /* Xbtimer() timers */ | 114 /* Xbtimer() timers */ |
111 enum { | 115 enum |
112 XB_TIMERA=0, | 116 { |
113 XB_TIMERB, | 117 XB_TIMERA = 0, |
114 XB_TIMERC, | 118 XB_TIMERB, |
115 XB_TIMERD | 119 XB_TIMERC, |
120 XB_TIMERD | |
116 }; | 121 }; |
117 | 122 |
118 /* Variables */ | 123 /* Variables */ |
119 extern SDL_AudioDevice *SDL_MintAudio_device; | 124 extern SDL_AudioDevice *SDL_MintAudio_device; |
120 extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ | 125 extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ |
121 extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ | 126 extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ |
122 extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ | 127 extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ |
123 extern volatile unsigned short SDL_MintAudio_mutex; | 128 extern volatile unsigned short SDL_MintAudio_mutex; |
124 extern cookie_stfa_t *SDL_MintAudio_stfa; | 129 extern cookie_stfa_t *SDL_MintAudio_stfa; |
125 extern volatile unsigned long SDL_MintAudio_clocktics; | 130 extern volatile unsigned long SDL_MintAudio_clocktics; |
126 | 131 |
127 /* MiNT thread variables */ | 132 /* MiNT thread variables */ |
128 extern SDL_bool SDL_MintAudio_mint_present; | 133 extern SDL_bool SDL_MintAudio_mint_present; |
129 extern SDL_bool SDL_MintAudio_quit_thread; | 134 extern SDL_bool SDL_MintAudio_quit_thread; |
130 extern SDL_bool SDL_MintAudio_thread_finished; | 135 extern SDL_bool SDL_MintAudio_thread_finished; |
131 extern long SDL_MintAudio_thread_pid; | 136 extern long SDL_MintAudio_thread_pid; |
132 | 137 |
133 /* Functions */ | 138 /* Functions */ |
134 void SDL_MintAudio_Callback(void); | 139 void SDL_MintAudio_Callback (void); |
135 void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, | 140 void SDL_MintAudio_AddFrequency (_THIS, Uint32 frequency, Uint32 clock, |
136 Uint32 prediv, int gpio_bits); | 141 Uint32 prediv, int gpio_bits); |
137 int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq); | 142 int SDL_MintAudio_SearchFrequency (_THIS, int desired_freq); |
138 | 143 |
139 /* MiNT thread functions */ | 144 /* MiNT thread functions */ |
140 int SDL_MintAudio_Thread(long param); | 145 int SDL_MintAudio_Thread (long param); |
141 void SDL_MintAudio_WaitThread(void); | 146 void SDL_MintAudio_WaitThread (void); |
142 | 147 |
143 /* ASM interrupt functions */ | 148 /* ASM interrupt functions */ |
144 void SDL_MintAudio_GsxbInterrupt(void); | 149 void SDL_MintAudio_GsxbInterrupt (void); |
145 void SDL_MintAudio_EmptyGsxbInterrupt(void); | 150 void SDL_MintAudio_EmptyGsxbInterrupt (void); |
146 void SDL_MintAudio_XbiosInterruptMeasureClock(void); | 151 void SDL_MintAudio_XbiosInterruptMeasureClock (void); |
147 void SDL_MintAudio_XbiosInterrupt(void); | 152 void SDL_MintAudio_XbiosInterrupt (void); |
148 void SDL_MintAudio_Dma8Interrupt(void); | 153 void SDL_MintAudio_Dma8Interrupt (void); |
149 void SDL_MintAudio_StfaInterrupt(void); | 154 void SDL_MintAudio_StfaInterrupt (void); |
150 | 155 |
151 #endif /* _SDL_mintaudio_h */ | 156 #endif /* _SDL_mintaudio_h */ |
157 /* vi: set ts=4 sw=4 expandtab: */ |