1 |
|
/* |
2 |
|
* audio.cpp - Audio support |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2000 Christian Bauer |
5 |
|
* Portions (C) 1997-1999 Marc Hellwig |
6 |
|
* |
7 |
|
* This program is free software; you can redistribute it and/or modify |
48 |
|
|
49 |
|
|
50 |
|
/* |
51 |
+ |
* Reset audio emulation |
52 |
+ |
*/ |
53 |
+ |
|
54 |
+ |
void AudioReset(void) |
55 |
+ |
{ |
56 |
+ |
audio_data = 0; |
57 |
+ |
} |
58 |
+ |
|
59 |
+ |
|
60 |
+ |
/* |
61 |
|
* Get audio info |
62 |
|
*/ |
63 |
|
|
123 |
|
} |
124 |
|
|
125 |
|
case siSpeakerMute: |
126 |
< |
WriteMacInt16(infoPtr, audio_get_main_mute()); |
126 |
> |
WriteMacInt16(infoPtr, audio_get_speaker_mute()); |
127 |
|
break; |
128 |
|
|
129 |
|
case siSpeakerVolume: |
130 |
< |
WriteMacInt32(infoPtr, audio_get_main_volume()); |
130 |
> |
WriteMacInt32(infoPtr, audio_get_speaker_volume()); |
131 |
> |
break; |
132 |
> |
|
133 |
> |
case siHeadphoneMute: |
134 |
> |
WriteMacInt16(infoPtr, 0); |
135 |
> |
break; |
136 |
> |
|
137 |
> |
case siHeadphoneVolume: |
138 |
> |
WriteMacInt32(infoPtr, 0x01000100); |
139 |
> |
break; |
140 |
> |
|
141 |
> |
case siHeadphoneVolumeSteps: |
142 |
> |
WriteMacInt16(infoPtr, 13); |
143 |
|
break; |
144 |
|
|
145 |
|
case siHardwareMute: |
146 |
< |
WriteMacInt16(infoPtr, audio_get_dac_mute()); |
146 |
> |
WriteMacInt16(infoPtr, audio_get_main_mute()); |
147 |
|
break; |
148 |
|
|
149 |
|
case siHardwareVolume: |
150 |
< |
WriteMacInt32(infoPtr, audio_get_dac_volume()); |
150 |
> |
WriteMacInt32(infoPtr, audio_get_main_volume()); |
151 |
|
break; |
152 |
|
|
153 |
< |
case siHardwareBusy: |
154 |
< |
WriteMacInt16(infoPtr, AudioStatus.num_sources != 0); |
153 |
> |
case siHardwareVolumeSteps: |
154 |
> |
WriteMacInt16(infoPtr, 13); |
155 |
|
break; |
156 |
|
|
157 |
< |
case siHardwareVolumeSteps: |
158 |
< |
WriteMacInt16(infoPtr, 64); |
157 |
> |
case siHardwareBusy: |
158 |
> |
WriteMacInt16(infoPtr, AudioStatus.num_sources != 0); |
159 |
|
break; |
160 |
|
|
161 |
|
default: // Delegate to Apple Mixer |
219 |
|
return badChannel; |
220 |
|
|
221 |
|
case siSpeakerMute: |
222 |
< |
audio_set_main_mute((uint16)infoPtr); |
222 |
> |
audio_set_speaker_mute((uint16)infoPtr); |
223 |
|
break; |
224 |
|
|
225 |
|
case siSpeakerVolume: |
226 |
|
D(bug(" set speaker volume %08lx\n", infoPtr)); |
227 |
< |
audio_set_main_volume(infoPtr); |
227 |
> |
audio_set_speaker_volume(infoPtr); |
228 |
> |
break; |
229 |
> |
|
230 |
> |
case siHeadphoneMute: |
231 |
> |
case siHeadphoneVolume: |
232 |
|
break; |
233 |
|
|
234 |
|
case siHardwareMute: |
235 |
< |
audio_set_dac_mute((uint16)infoPtr); |
235 |
> |
audio_set_main_mute((uint16)infoPtr); |
236 |
|
break; |
237 |
|
|
238 |
|
case siHardwareVolume: |
239 |
|
D(bug(" set hardware volume %08lx\n", infoPtr)); |
240 |
< |
audio_set_dac_volume(infoPtr); |
240 |
> |
audio_set_main_volume(infoPtr); |
241 |
|
break; |
242 |
|
|
243 |
|
default: // Delegate to Apple Mixer |
377 |
|
return noErr; |
378 |
|
|
379 |
|
case kComponentVersionSelect: |
380 |
< |
return 0x00010002; |
380 |
> |
return 0x00010003; |
381 |
|
|
382 |
|
case kComponentCloseSelect: |
383 |
|
open_count--; |
404 |
|
|
405 |
|
// Init sound component data |
406 |
|
WriteMacInt32(audio_data + adatData + scd_flags, 0); |
407 |
< |
WriteMacInt32(audio_data + adatData + scd_format, AudioStatus.sample_size == 16 ? 'twos' : 'raw '); |
407 |
> |
WriteMacInt32(audio_data + adatData + scd_format, AudioStatus.sample_size == 16 ? FOURCC('t','w','o','s') : FOURCC('r','a','w',' ')); |
408 |
|
WriteMacInt16(audio_data + adatData + scd_numChannels, AudioStatus.channels); |
409 |
|
WriteMacInt16(audio_data + adatData + scd_sampleSize, AudioStatus.sample_size); |
410 |
|
WriteMacInt32(audio_data + adatData + scd_sampleRate, AudioStatus.sample_rate); |