Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio.c @ 1107:856f76a099c7
Can use both clocks of FDI interface on Falcon, plus digital output
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Sun, 07 Aug 2005 12:17:28 +0000 |
parents | 2eca15c3f609 |
children | 12c49532be00 |
comparison
equal
deleted
inserted
replaced
1106:524fd51f5d2c | 1107:856f76a099c7 |
---|---|
74 audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); | 74 audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 /* Add a new frequency/clock/predivisor to the current list */ | 78 /* Add a new frequency/clock/predivisor to the current list */ |
79 void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, Uint32 prediv) | 79 void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, |
80 Uint32 prediv, int gpio_bits) | |
80 { | 81 { |
81 int i, p; | 82 int i, p; |
82 | 83 |
83 if (MINTAUDIO_freqcount==MINTAUDIO_maxfreqs) { | 84 if (MINTAUDIO_freqcount==MINTAUDIO_maxfreqs) { |
84 return; | 85 return; |
92 } | 93 } |
93 | 94 |
94 /* Put all following ones farer */ | 95 /* Put all following ones farer */ |
95 if (MINTAUDIO_freqcount>0) { | 96 if (MINTAUDIO_freqcount>0) { |
96 for (i=MINTAUDIO_freqcount; i>p; i--) { | 97 for (i=MINTAUDIO_freqcount; i>p; i--) { |
97 MINTAUDIO_frequencies[i].frequency = MINTAUDIO_frequencies[i-1].frequency; | 98 memcpy(&MINTAUDIO_frequencies[i], &MINTAUDIO_frequencies[i-1], sizeof(mint_frequency_t)); |
98 MINTAUDIO_frequencies[i].masterclock = MINTAUDIO_frequencies[i-1].masterclock; | |
99 MINTAUDIO_frequencies[i].predivisor = MINTAUDIO_frequencies[i-1].predivisor; | |
100 } | 99 } |
101 } | 100 } |
102 | 101 |
103 /* And insert new one */ | 102 /* And insert new one */ |
104 MINTAUDIO_frequencies[p].frequency = frequency; | 103 MINTAUDIO_frequencies[p].frequency = frequency; |
105 MINTAUDIO_frequencies[p].masterclock = clock; | 104 MINTAUDIO_frequencies[p].masterclock = clock; |
106 MINTAUDIO_frequencies[p].predivisor = prediv; | 105 MINTAUDIO_frequencies[p].predivisor = prediv; |
106 MINTAUDIO_frequencies[p].gpio_bits = gpio_bits; | |
107 | 107 |
108 MINTAUDIO_freqcount++; | 108 MINTAUDIO_freqcount++; |
109 } | 109 } |
110 | 110 |
111 /* Search for the nearest frequency */ | 111 /* Search for the nearest frequency */ |