revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / AHI / Device / debug.c
blobe980d2e2cffaa09dd0c25fe1e84bbf58d43e8669
1 /*
2 AHI - Hardware independent audio subsystem
3 Copyright (C) 2017 The AROS Dev Team
4 Copyright (C) 1996-2005 Martin Blom <martin@blom.org>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the
18 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
19 MA 02139, USA.
22 #include <config.h>
24 #include <utility/tagitem.h>
25 #include <proto/exec.h>
26 #include <proto/utility.h>
28 #include "ahi_def.h"
29 #include "debug.h"
31 /******************************************************************************
32 ** Support code ***************************************************************
33 ******************************************************************************/
35 static const char*
36 GetTagName( Tag tag )
38 switch( tag )
40 case AHIA_AudioID: return "AHIA_AudioID";
41 case AHIA_MixFreq: return "AHIA_MixFreq";
42 case AHIA_Channels: return "AHIA_Channels";
43 case AHIA_Sounds: return "AHIA_Sounds";
44 case AHIA_SoundFunc: return "AHIA_SoundFunc";
45 case AHIA_PlayerFunc: return "AHIA_PlayerFunc";
46 case AHIA_PlayerFreq: return "AHIA_PlayerFreq";
47 case AHIA_MinPlayerFreq: return "AHIA_MinPlayerFreq";
48 case AHIA_MaxPlayerFreq: return "AHIA_MaxPlayerFreq";
49 // case AHIA_PlayerFreqUnit: return "AHIA_PlayerFreqUnit";
50 case AHIA_RecordFunc: return "AHIA_RecordFunc";
51 case AHIA_UserData: return "AHIA_UserData";
52 // case AHIA_ErrorFunc: return "AHIA_ErrorFunc";
53 case AHIA_AntiClickSamples: return "AHIA_AntiClickSamples";
54 case AHIP_BeginChannel: return "AHIP_BeginChannel";
55 case AHIP_EndChannel: return "AHIP_EndChannel";
56 case AHIP_Freq: return "AHIP_Freq";
57 case AHIP_Vol: return "AHIP_Vol";
58 case AHIP_Pan: return "AHIP_Pan";
59 case AHIP_Sound: return "AHIP_Sound";
60 case AHIP_Offset: return "AHIP_Offset";
61 case AHIP_Length: return "AHIP_Length";
62 case AHIP_LoopFreq: return "AHIP_LoopFreq";
63 case AHIP_LoopVol: return "AHIP_LoopVol";
64 case AHIP_LoopPan: return "AHIP_LoopPan";
65 case AHIP_LoopSound: return "AHIP_LoopSound";
66 case AHIP_LoopOffset: return "AHIP_LoopOffset";
67 case AHIP_LoopLength: return "AHIP_LoopLength";
68 case AHIC_Play: return "AHIC_Play";
69 case AHIC_Record: return "AHIC_Record";
70 // case AHIC_PausePlay: return "AHIC_PausePlay";
71 // case AHIC_PauseRecord: return "AHIC_PauseRecord";
72 case AHIC_MixFreq_Query: return "AHIC_MixFreq_Query";
73 case AHIC_Input: return "AHIC_Input";
74 case AHIC_Input_Query: return "AHIC_Input_Query";
75 case AHIC_Output: return "AHIC_Output";
76 case AHIC_Output_Query: return "AHIC_Output_Query";
77 // case AHIC_MonitorVolumeLeft: return "AHIC_MonitorVolumeLeft";
78 // case AHIC_MonitorVolumeLeft_Query: return "AHIC_MonitorVolumeLeft_Query";
79 // case AHIC_MonitorVolumeRight: return "AHIC_MonitorVolumeRight";
80 // case AHIC_MonitorVolumeRight_Query: return "AHIC_MonitorVolumeRight_Query";
81 // case AHIC_OutputVolumeLeft: return "AHIC_OutputVolumeLeft";
82 // case AHIC_OutputVolumeLeft_Query: return "AHIC_OutputVolumeLeft_Query";
83 // case AHIC_OutputVolumeRight: return "AHIC_OutputVolumeRight";
84 // case AHIC_OutputVolumeRight_Query: return "AHIC_OutputVolumeRight_Query";
85 // case AHIC_InputGainLeft: return "AHIC_InputGainLeft";
86 // case AHIC_InputGainLeft_Query: return "AHIC_InputGainLeft_Query";
87 // case AHIC_InputGainRight: return "AHIC_InputGainRight";
88 // case AHIC_InputGainRight_Query: return "AHIC_InputGainRight_Query";
89 // case AHIC_PlaySampleFormat: return "AHIC_PlaySampleFormat";
90 // case AHIC_PlaySampleFormat_Query: return "AHIC_PlaySampleFormat_Query";
91 // case AHIC_RecordSampleFormat: return "AHIC_RecordSampleFormat";
92 // case AHIC_RecordSampleFormat_Query: return "AHIC_RecordSampleFormat_Query";
93 case AHIDB_AudioID: return "AHIDB_AudioID";
94 case AHIDB_BufferLen: return "AHIDB_BufferLen";
95 case AHIDB_Driver: return "AHIDB_Driver";
96 case AHIDB_Author: return "AHIDB_Author";
97 case AHIDB_Copyright: return "AHIDB_Copyright";
98 case AHIDB_Version: return "AHIDB_Version";
99 case AHIDB_Annotation: return "AHIDB_Annotation";
100 case AHIDB_Name: return "AHIDB_Name";
101 case AHIDB_Data: return "AHIDB_Data";
102 case AHIDB_Flags: return "AHIDB_Flags";
103 // case AHIDB_Play: return "AHIDB_Play";
104 case AHIDB_Record: return "AHIDB_Record";
105 // case AHIDB_Direct: return "AHIDB_Direct";
106 case AHIDB_Volume: return "AHIDB_Volume";
107 case AHIDB_Stereo: return "AHIDB_Stereo";
108 case AHIDB_Panning: return "AHIDB_Panning";
109 // case AHIDB_Surround: return "AHIDB_Surround";
110 case AHIDB_PingPong: return "AHIDB_PingPong";
111 case AHIDB_MultTable: return "AHIDB_MultTable";
112 case AHIDB_MaxChannels: return "AHIDB_MaxChannels";
113 case AHIDB_MaxPlaySamples: return "AHIDB_MaxPlaySamples";
114 case AHIDB_MaxRecordSamples: return "AHIDB_MaxRecordSamples";
115 case AHIDB_Bits: return "AHIDB_Bits";
116 case AHIDB_HiFi: return "AHIDB_HiFi";
117 case AHIDB_Realtime: return "AHIDB_Realtime";
118 case AHIDB_FullDuplex: return "AHIDB_FullDuplex";
119 // case AHIDB_Accelerated: return "AHIDB_Accelerated";
120 // case AHIDB_Available: return "AHIDB_Available";
121 // case AHIDB_Hidden: return "AHIDB_Hidden";
122 case AHIDB_Frequencies: return "AHIDB_Frequencies";
123 case AHIDB_FrequencyArg: return "AHIDB_FrequencyArg";
124 case AHIDB_Frequency: return "AHIDB_Frequency";
125 // case AHIDB_FrequencyArray: return "AHIDB_FrequencyArray";
126 case AHIDB_IndexArg: return "AHIDB_IndexArg";
127 case AHIDB_Index: return "AHIDB_Index";
128 case AHIDB_Inputs: return "AHIDB_Inputs";
129 case AHIDB_InputArg: return "AHIDB_InputArg";
130 case AHIDB_Input: return "AHIDB_Input";
131 // case AHIDB_InputArray: return "AHIDB_InputArray";
132 case AHIDB_Outputs: return "AHIDB_Outputs";
133 case AHIDB_OutputArg: return "AHIDB_OutputArg";
134 case AHIDB_Output: return "AHIDB_Output";
135 case AHIDB_MultiChannel: return "AHIDB_MultiChannel";
136 // case AHIDB_OutputArray: return "AHIDB_OutputArray";
137 // case AHIDB_MonitorVolumesLeft: return "AHIDB_MonitorVolumesLeft";
138 // case AHIDB_MonitorVolumeLeftArg: return "AHIDB_MonitorVolumeLeftArg";
139 // case AHIDB_MonitorVolumeLeft: return "AHIDB_MonitorVolumeLeft";
140 // case AHIDB_MonitorVolumeLeftArray: return "AHIDB_MonitorVolumeLeftArray";
141 // case AHIDB_MonitorVolumesRight: return "AHIDB_MonitorVolumesRight";
142 // case AHIDB_MonitorVolumeRightArg: return "AHIDB_MonitorVolumeRightArg";
143 // case AHIDB_MonitorVolumeRight: return "AHIDB_MonitorVolumeRight";
144 // case AHIDB_MonitorVolumeRightArray: return "AHIDB_MonitorVolumeRightArray";
145 // case AHIDB_OutputVolumesLeft: return "AHIDB_OutputVolumesLeft";
146 // case AHIDB_OutputVolumeLeftArg: return "AHIDB_OutputVolumeLeftArg";
147 // case AHIDB_OutputVolumeLeft: return "AHIDB_OutputVolumeLeft";
148 // case AHIDB_OutputVolumeLeftArray: return "AHIDB_OutputVolumeLeftArray";
149 // case AHIDB_OutputVolumesRight: return "AHIDB_OutputVolumesRight";
150 // case AHIDB_OutputVolumeRightArg: return "AHIDB_OutputVolumeRightArg";
151 // case AHIDB_OutputVolumeRight: return "AHIDB_OutputVolumeRight";
152 // case AHIDB_OutputVolumeRightArray: return "AHIDB_OutputVolumeRightArray";
153 // case AHIDB_InputGainsLeft: return "AHIDB_InputGainsLeft";
154 // case AHIDB_InputGainLeftArg: return "AHIDB_InputGainLeftArg";
155 // case AHIDB_InputGainLeft: return "AHIDB_InputGainLeft";
156 // case AHIDB_InputGainLeftArray: return "AHIDB_InputGainLeftArray";
157 // case AHIDB_InputGainsRight: return "AHIDB_InputGainsRight";
158 // case AHIDB_InputGainRightArg: return "AHIDB_InputGainRightArg";
159 // case AHIDB_InputGainRight: return "AHIDB_InputGainRight";
160 // case AHIDB_InputGainRightArray: return "AHIDB_InputGainRightArray";
161 // case AHIDB_PlaySampleFormats: return "AHIDB_PlaySampleFormats";
162 // case AHIDB_PlaySampleFormatArg: return "AHIDB_PlaySampleFormatArg";
163 // case AHIDB_PlaySampleFormat: return "AHIDB_PlaySampleFormat";
164 // case AHIDB_PlaySampleFormatArray: return "AHIDB_PlaySampleFormatArray";
165 // case AHIDB_RecordSampleFormats: return "AHIDB_RecordSampleFormats";
166 // case AHIDB_RecordSampleFormatArg: return "AHIDB_RecordSampleFormatArg";
167 // case AHIDB_RecordSampleFormat: return "AHIDB_RecordSampleFormat";
168 // case AHIDB_RecordSampleFormatArray: return "AHIDB_RecordSampleFormatArray";
169 case AHIB_Dizzy: return "AHIB_Dizzy";
170 case AHIR_Window: return "AHIR_Window";
171 case AHIR_Screen: return "AHIR_Screen";
172 case AHIR_PubScreenName: return "AHIR_PubScreenName";
173 case AHIR_PrivateIDCMP: return "AHIR_PrivateIDCMP";
174 case AHIR_IntuiMsgFunc: return "AHIR_IntuiMsgFunc";
175 case AHIR_SleepWindow: return "AHIR_SleepWindow";
176 case AHIR_ObsoleteUserData: return "AHIR_ObsoleteUserData";
177 case AHIR_UserData: return "AHIR_UserData";
178 case AHIR_TextAttr: return "AHIR_TextAttr";
179 case AHIR_Locale: return "AHIR_Locale";
180 case AHIR_TitleText: return "AHIR_TitleText";
181 case AHIR_PositiveText: return "AHIR_PositiveText";
182 case AHIR_NegativeText: return "AHIR_NegativeText";
183 case AHIR_InitialLeftEdge: return "AHIR_InitialLeftEdge";
184 case AHIR_InitialTopEdge: return "AHIR_InitialTopEdge";
185 case AHIR_InitialWidth: return "AHIR_InitialWidth";
186 case AHIR_InitialHeight: return "AHIR_InitialHeight";
187 case AHIR_InitialAudioID: return "AHIR_InitialAudioID";
188 case AHIR_InitialMixFreq: return "AHIR_InitialMixFreq";
189 case AHIR_InitialInfoOpened: return "AHIR_InitialInfoOpened";
190 case AHIR_InitialInfoLeftEdge: return "AHIR_InitialInfoLeftEdge";
191 case AHIR_InitialInfoTopEdge: return "AHIR_InitialInfoTopEdge";
192 case AHIR_InitialInfoWidth: return "AHIR_InitialInfoWidth";
193 case AHIR_InitialInfoHeight: return "AHIR_InitialInfoHeight";
194 case AHIR_DoMixFreq: return "AHIR_DoMixFreq";
195 case AHIR_DoDefaultMode: return "AHIR_DoDefaultMode";
196 // case AHIR_DoChannels: return "AHIR_DoChannels";
197 // case AHIR_DoHidden: return "AHIR_DoHidden";
198 // case AHIR_DoDirectModes: return "AHIR_DoDirectModes";
199 case AHIR_FilterTags: return "AHIR_FilterTags";
200 case AHIR_FilterFunc: return "AHIR_FilterFunc";
201 case AHIC_MonitorVolume: return "AHIC_MonitorVolume";
202 case AHIC_MonitorVolume_Query: return "AHIC_MonitorVolume_Query";
203 case AHIC_InputGain: return "AHIC_InputGain";
204 case AHIC_InputGain_Query: return "AHIC_InputGain_Query";
205 case AHIC_OutputVolume: return "AHIC_OutputVolume";
206 case AHIC_OutputVolume_Query: return "AHIC_OutputVolume_Query";
207 case AHIDB_DriverBaseName: return "AHIDB_DriverBaseName";
208 case AHIDB_MinMixFreq: return "AHIDB_MinMixFreq";
209 case AHIDB_MaxMixFreq: return "AHIDB_MaxMixFreq";
210 case AHIDB_MinMonitorVolume: return "AHIDB_MinMonitorVolume";
211 case AHIDB_MaxMonitorVolume: return "AHIDB_MaxMonitorVolume";
212 case AHIDB_MinInputGain: return "AHIDB_MinInputGain";
213 case AHIDB_MaxInputGain: return "AHIDB_MaxInputGain";
214 case AHIDB_MinOutputVolume: return "AHIDB_MinOutputVolume";
215 case AHIDB_MaxOutputVolume: return "AHIDB_MaxOutputVolume";
217 default:
218 return "Unknown";
222 enum Datatype
224 dt_Ptr,
225 dt_Hex,
226 dt_Dec,
227 dt_Boolean,
228 dt_String,
229 dt_Fixed
232 static enum Datatype
233 GetDatatype( Tag tag )
235 switch( tag )
237 case AHIA_AudioID: return dt_Hex;
238 case AHIA_MixFreq: return dt_Dec;
239 case AHIA_Channels: return dt_Dec;
240 case AHIA_Sounds: return dt_Dec;
241 case AHIA_SoundFunc: return dt_Ptr;
242 case AHIA_PlayerFunc: return dt_Ptr;
243 case AHIA_PlayerFreq: return dt_Fixed;
244 case AHIA_MinPlayerFreq: return dt_Fixed;
245 case AHIA_MaxPlayerFreq: return dt_Fixed;
246 // case AHIA_PlayerFreqUnit: return dt_Hex;
247 case AHIA_RecordFunc: return dt_Ptr;
248 case AHIA_UserData: return dt_Ptr;
249 // case AHIA_ErrorFunc: return dt_Hex;
250 case AHIA_AntiClickSamples: return dt_Dec;
251 case AHIP_BeginChannel: return dt_Dec;
252 case AHIP_EndChannel: return dt_Dec;
253 case AHIP_Freq: return dt_Dec;
254 case AHIP_Vol: return dt_Fixed;
255 case AHIP_Pan: return dt_Fixed;
256 case AHIP_Sound: return dt_Dec;
257 case AHIP_Offset: return dt_Hex;
258 case AHIP_Length: return dt_Hex;
259 case AHIP_LoopFreq: return dt_Dec;
260 case AHIP_LoopVol: return dt_Fixed;
261 case AHIP_LoopPan: return dt_Fixed;
262 case AHIP_LoopSound: return dt_Dec;
263 case AHIP_LoopOffset: return dt_Hex;
264 case AHIP_LoopLength: return dt_Hex;
265 case AHIC_Play: return dt_Boolean;
266 case AHIC_Record: return dt_Boolean;
267 // case AHIC_PausePlay: return dt_Boolean;
268 // case AHIC_PauseRecord: return dt_Boolean;
269 case AHIC_MixFreq_Query: return dt_Hex;
270 case AHIC_Input: return dt_Dec;
271 case AHIC_Input_Query: return dt_Hex;
272 case AHIC_Output: return dt_Dec;
273 case AHIC_Output_Query: return dt_Hex;
274 // case AHIC_MonitorVolumeLeft: return dt_Fixed;
275 // case AHIC_MonitorVolumeLeft_Query: return dt_Hex;
276 // case AHIC_MonitorVolumeRight: return dt_Fixed;
277 // case AHIC_MonitorVolumeRight_Query: return dt_Hex;
278 // case AHIC_OutputVolumeLeft: return dt_Fixed;
279 // case AHIC_OutputVolumeLeft_Query: return dt_Hex;
280 // case AHIC_OutputVolumeRight: return dt_Fixed;
281 // case AHIC_OutputVolumeRight_Query: return dt_Hex;
282 // case AHIC_InputGainLeft: return dt_Fixed;
283 // case AHIC_InputGainLeft_Query: return dt_Hex;
284 // case AHIC_InputGainRight: return dt_Fixed;
285 // case AHIC_InputGainRight_Query: return dt_Hex;
286 // case AHIC_PlaySampleFormat: return dt_Hex;
287 // case AHIC_PlaySampleFormat_Query: return dt_Hex;
288 // case AHIC_RecordSampleFormat: return dt_Hex;
289 // case AHIC_RecordSampleFormat_Query: return dt_Dec;
290 case AHIDB_AudioID: return dt_Hex;
291 case AHIDB_BufferLen: return dt_Dec;
292 case AHIDB_Driver: return dt_Ptr;
293 case AHIDB_Author: return dt_Hex;
294 case AHIDB_Copyright: return dt_Ptr;
295 case AHIDB_Version: return dt_Hex;
296 case AHIDB_Annotation: return dt_Ptr;
297 case AHIDB_Name: return dt_Ptr;
298 case AHIDB_Data: return dt_Ptr;
299 case AHIDB_Flags: return dt_Hex;
300 // case AHIDB_Play: return dt_Hex;
301 case AHIDB_Record: return dt_Hex;
302 // case AHIDB_Direct: return dt_Hex;
303 case AHIDB_Volume: return dt_Hex;
304 case AHIDB_Stereo: return dt_Hex;
305 case AHIDB_Panning: return dt_Hex;
306 // case AHIDB_Surround: return dt_Hex;
307 case AHIDB_PingPong: return dt_Hex;
308 case AHIDB_MultTable: return dt_Hex;
309 case AHIDB_MaxChannels: return dt_Hex;
310 case AHIDB_MaxPlaySamples: return dt_Hex;
311 case AHIDB_MaxRecordSamples: return dt_Hex;
312 case AHIDB_Bits: return dt_Hex;
313 case AHIDB_HiFi: return dt_Hex;
314 case AHIDB_Realtime: return dt_Hex;
315 case AHIDB_FullDuplex: return dt_Hex;
316 // case AHIDB_Accelerated: return dt_Hex;
317 // case AHIDB_Available: return dt_Hex;
318 // case AHIDB_Hidden: return dt_Hex;
319 case AHIDB_Frequencies: return dt_Hex;
320 case AHIDB_FrequencyArg: return dt_Dec;
321 case AHIDB_Frequency: return dt_Hex;
322 // case AHIDB_FrequencyArray: return dt_Hex;
323 case AHIDB_IndexArg: return dt_Dec;
324 case AHIDB_Index: return dt_Hex;
325 case AHIDB_Inputs: return dt_Hex;
326 case AHIDB_InputArg: return dt_Dec;
327 case AHIDB_Input: return dt_Hex;
328 // case AHIDB_InputArray: return dt_Hex;
329 case AHIDB_Outputs: return dt_Hex;
330 case AHIDB_OutputArg: return dt_Dec;
331 case AHIDB_Output: return dt_Hex;
332 case AHIDB_MultiChannel: return dt_Hex;
333 // case AHIDB_OutputArray: return dt_Hex;
334 // case AHIDB_MonitorVolumesLeft: return dt_Hex;
335 // case AHIDB_MonitorVolumeLeftArg: return dt_Dec;
336 // case AHIDB_MonitorVolumeLeft: return dt_Hex;
337 // case AHIDB_MonitorVolumeLeftArray: return dt_Hex;
338 // case AHIDB_MonitorVolumesRight: return dt_Hex;
339 // case AHIDB_MonitorVolumeRightArg: return dt_Dec;
340 // case AHIDB_MonitorVolumeRight: return dt_Hex;
341 // case AHIDB_MonitorVolumeRightArray: return dt_Hex;
342 // case AHIDB_OutputVolumesLeft: return dt_Hex;
343 // case AHIDB_OutputVolumeLeftArg: return dt_Dec;
344 // case AHIDB_OutputVolumeLeft: return dt_Hex;
345 // case AHIDB_OutputVolumeLeftArray: return dt_Hex;
346 // case AHIDB_OutputVolumesRight: return dt_Hex;
347 // case AHIDB_OutputVolumeRightArg: return dt_Dec;
348 // case AHIDB_OutputVolumeRight: return dt_Hex;
349 // case AHIDB_OutputVolumeRightArray: return dt_Hex;
350 // case AHIDB_InputGainsLeft: return dt_Hex;
351 // case AHIDB_InputGainLeftArg: return dt_Dec;
352 // case AHIDB_InputGainLeft: return dt_Hex;
353 // case AHIDB_InputGainLeftArray: return dt_Hex;
354 // case AHIDB_InputGainsRight: return dt_Hex;
355 // case AHIDB_InputGainRightArg: return dt_Dec;
356 // case AHIDB_InputGainRight: return dt_Hex;
357 // case AHIDB_InputGainRightArray: return dt_Hex;
358 // case AHIDB_PlaySampleFormats: return dt_Hex;
359 // case AHIDB_PlaySampleFormatArg: return dt_Dec;
360 // case AHIDB_PlaySampleFormat: return dt_Hex;
361 // case AHIDB_PlaySampleFormatArray: return dt_Hex;
362 // case AHIDB_RecordSampleFormats: return dt_Hex;
363 // case AHIDB_RecordSampleFormatArg: return dt_Dec;
364 // case AHIDB_RecordSampleFormat: return dt_Hex;
365 // case AHIDB_RecordSampleFormatArray: return dt_Hex;
366 case AHIB_Dizzy: return dt_Boolean;
367 case AHIR_Window: return dt_Hex;
368 case AHIR_Screen: return dt_Hex;
369 case AHIR_PubScreenName: return dt_String;
370 case AHIR_PrivateIDCMP: return dt_Hex;
371 case AHIR_IntuiMsgFunc: return dt_Hex;
372 case AHIR_SleepWindow: return dt_Boolean;
373 case AHIR_ObsoleteUserData: return dt_Hex;
374 case AHIR_UserData: return dt_Hex;
375 case AHIR_TextAttr: return dt_Hex;
376 case AHIR_Locale: return dt_Hex;
377 case AHIR_TitleText: return dt_String;
378 case AHIR_PositiveText: return dt_String;
379 case AHIR_NegativeText: return dt_String;
380 case AHIR_InitialLeftEdge: return dt_Dec;
381 case AHIR_InitialTopEdge: return dt_Dec;
382 case AHIR_InitialWidth: return dt_Dec;
383 case AHIR_InitialHeight: return dt_Dec;
384 case AHIR_InitialAudioID: return dt_Hex;
385 case AHIR_InitialMixFreq: return dt_Dec;
386 case AHIR_InitialInfoOpened: return dt_Boolean;
387 case AHIR_InitialInfoLeftEdge: return dt_Dec;
388 case AHIR_InitialInfoTopEdge: return dt_Dec;
389 case AHIR_InitialInfoWidth: return dt_Dec;
390 case AHIR_InitialInfoHeight: return dt_Dec;
391 case AHIR_DoMixFreq: return dt_Boolean;
392 case AHIR_DoDefaultMode: return dt_Boolean;
393 // case AHIR_DoChannels: return dt_Boolean;
394 // case AHIR_DoHidden: return dt_Boolean;
395 // case AHIR_DoDirectModes: return dt_Boolean;
396 case AHIR_FilterTags: return dt_Hex;
397 case AHIR_FilterFunc: return dt_Hex;
398 case AHIC_MonitorVolume: return dt_Fixed;
399 case AHIC_MonitorVolume_Query: return dt_Hex;
400 case AHIC_InputGain: return dt_Fixed;
401 case AHIC_InputGain_Query: return dt_Hex;
402 case AHIC_OutputVolume: return dt_Fixed;
403 case AHIC_OutputVolume_Query: return dt_Hex;
404 case AHIDB_DriverBaseName: return dt_Ptr;
405 case AHIDB_MinMixFreq: return dt_Dec;
406 case AHIDB_MaxMixFreq: return dt_Dec;
407 case AHIDB_MinMonitorVolume: return dt_Hex;
408 case AHIDB_MaxMonitorVolume: return dt_Hex;
409 case AHIDB_MinInputGain: return dt_Hex;
410 case AHIDB_MaxInputGain: return dt_Hex;
411 case AHIDB_MinOutputVolume: return dt_Hex;
412 case AHIDB_MaxOutputVolume: return dt_Hex;
414 default:
415 return dt_Hex;
420 // tags may be NULL
422 static void
423 PrintTagList(struct TagItem *tags)
425 struct TagItem *tstate;
426 struct TagItem *tag;
428 if( tags == NULL )
430 KPrintF( "No taglist!\n" );
432 else
434 tstate = tags;
436 while( ( tag = NextTagItem( &tstate ) ) )
438 switch( GetDatatype( tag->ti_Tag ) )
440 case dt_Ptr:
441 KPrintF( "\n %30s, 0x%p,",
442 (IPTR)GetTagName( tag->ti_Tag ), tag->ti_Data );
443 break;
445 case dt_Hex:
446 KPrintF( "\n %30s, 0x%08x,",
447 (IPTR)GetTagName( tag->ti_Tag ), tag->ti_Data );
448 break;
450 case dt_Dec:
451 KPrintF( "\n %30s, %ld,",
452 (IPTR)GetTagName( tag->ti_Tag ), tag->ti_Data );
453 break;
455 case dt_Boolean:
456 KPrintF( "\n %30s, %s,",
457 (IPTR)GetTagName( tag->ti_Tag ),
458 (IPTR)(tag->ti_Data ? "TRUE" : "FALSE") );
459 break;
461 case dt_String:
462 KPrintF( "\n %30s, %s,",
463 (IPTR)GetTagName( tag->ti_Tag ),
464 tag->ti_Data != 0 ? tag->ti_Data : (IPTR)"(null)" );
465 break;
467 case dt_Fixed:
469 KPrintF( "\n %30s, %ld.%ld,",
470 (IPTR)GetTagName( tag->ti_Tag ),
471 tag->ti_Data >> 16,
472 ( ( tag->ti_Data & 0xffff ) * 1000 ) >> 16 );
473 break;
478 KPrintF("\n TAG_DONE)");
483 /******************************************************************************
484 ** Send debug to serial port **************************************************
485 ******************************************************************************/
487 #ifndef __AMIGAOS4__
488 #if defined( __AROS__ ) && !defined( __mc68000__ )
490 #include <aros/asmcall.h>
492 AROS_UFH2( void,
493 rawputchar_m68k,
494 AROS_UFHA( UBYTE, c, D0 ),
495 AROS_UFHA( struct ExecBase*, SysBase, A3 ) )
497 AROS_USERFUNC_INIT
498 RawPutChar( c );
499 AROS_USERFUNC_EXIT
502 #else
504 static const UWORD rawputchar_m68k[] =
506 0x2C4B, // MOVEA.L A3,A6
507 0x4EAE, 0xFDFC, // JSR -$0204(A6)
508 0x4E75 // RTS
511 #endif
513 void
514 KPrintFArgs( UBYTE* fmt,
515 #if defined(__AROS__)
516 RAWARG args )
517 #else
518 ULONG * args )
519 #endif
521 RawDoFmt( fmt, args, (void(*)(void)) rawputchar_m68k, SysBase );
523 #endif
526 /******************************************************************************
527 ** All functions **************************************************************
528 ******************************************************************************/
531 void
532 Debug_AllocAudioA( struct TagItem *tags )
534 KPrintF("AHI_AllocAudioA(");
535 PrintTagList(tags);
538 void
539 Debug_FreeAudio( struct AHIPrivAudioCtrl *audioctrl )
541 KPrintF("AHI_FreeAudio(0x%p)\n", (IPTR)audioctrl);
544 void
545 Debug_KillAudio( void )
547 KPrintF("AHI_KillAudio()\n");
550 void
551 Debug_ControlAudioA( struct AHIPrivAudioCtrl *audioctrl, struct TagItem *tags )
553 KPrintF("AHI_ControlAudioA(0x%p,", (IPTR)audioctrl);
554 PrintTagList(tags);
558 void
559 Debug_SetVol( UWORD chan, Fixed vol, sposition pan, struct AHIPrivAudioCtrl *audioctrl, ULONG flags)
561 KPrintF("AHI_SetVol(%ld, 0x%08lx, 0x%08lx, 0x%p, %ld)\n",
562 chan & 0xffff, vol, pan, (IPTR)audioctrl, flags);
565 void
566 Debug_SetFreq( UWORD chan, ULONG freq, struct AHIPrivAudioCtrl *audioctrl, ULONG flags)
568 KPrintF("AHI_SetFreq(%ld, %ld, 0x%p, %ld)\n",
569 chan & 0xffff, freq, (IPTR)audioctrl, flags);
572 void
573 Debug_SetSound( UWORD chan, UWORD sound, ULONG offset, LONG length, struct AHIPrivAudioCtrl *audioctrl, ULONG flags)
575 KPrintF("AHI_SetSound(%ld, %ld, 0x%08lx, 0x%08lx, 0x%p, %ld)\n",
576 chan & 0xffff, sound & 0xffff, offset, length, (IPTR)audioctrl, flags);
579 void
580 Debug_SetEffect( IPTR *effect, struct AHIPrivAudioCtrl *audioctrl )
582 KPrintF("AHI_SetEffect(0x%p (Effect 0x%p), 0x%p)\n",
583 (IPTR)effect, *effect, (IPTR)audioctrl);
586 void
587 Debug_LoadSound( UWORD sound, ULONG type, APTR info, struct AHIPrivAudioCtrl *audioctrl )
589 KPrintF("AHI_LoadSound(%ld, %ld, 0x%p, 0x%p) ", sound, type, (IPTR)info, (IPTR)audioctrl);
591 if(type == AHIST_SAMPLE || type == AHIST_DYNAMICSAMPLE)
593 struct AHISampleInfo *si = (struct AHISampleInfo *) info;
595 KPrintF("[T:0x%08lx A:0x%p L:%ld]", si->ahisi_Type,
596 (IPTR)si->ahisi_Address, si->ahisi_Length);
600 void
601 Debug_UnloadSound( UWORD sound, struct AHIPrivAudioCtrl *audioctrl )
603 KPrintF("AHI_UnloadSound(%ld, 0x%p)\n", sound, (IPTR)audioctrl);
606 void
607 Debug_NextAudioID( IPTR id)
609 KPrintF("AHI_NextAudioID(0x%08lx)", id);
612 void
613 Debug_GetAudioAttrsA( IPTR id, struct AHIPrivAudioCtrl *audioctrl, struct TagItem *tags )
615 KPrintF("AHI_GetAudioAttrsA(0x%08lx, 0x%p,", id, (IPTR)audioctrl);
616 PrintTagList(tags);
619 void
620 Debug_BestAudioIDA( struct TagItem *tags )
622 KPrintF("AHI_BestAudioIDA(");
623 PrintTagList(tags);
626 void
627 Debug_AllocAudioRequestA( struct TagItem *tags )
629 KPrintF("AHI_AllocAudioRequestA(");
630 PrintTagList(tags);
633 void
634 Debug_AudioRequestA( struct AHIAudioModeRequester *req, struct TagItem *tags )
636 KPrintF("AHI_AudioRequestA(0x%p,", (IPTR)req);
637 PrintTagList(tags);
640 void
641 Debug_FreeAudioRequest( struct AHIAudioModeRequester *req )
643 KPrintF("AHI_FreeAudioRequest(0x%p)\n", (IPTR)req);
646 void
647 Debug_PlayA( struct AHIPrivAudioCtrl *audioctrl, struct TagItem *tags )
649 KPrintF("AHI_PlayA(0x%p,", (IPTR)audioctrl);
650 PrintTagList(tags);
651 KPrintF("\n");
654 void
655 Debug_SampleFrameSize( ULONG sampletype)
657 KPrintF("AHI_SampleFrameSize(%ld)", sampletype);
660 void
661 Debug_AddAudioMode(struct TagItem *tags )
663 KPrintF("AHI_AddAudioMode(");
664 PrintTagList(tags);
667 void
668 Debug_RemoveAudioMode( IPTR id)
670 KPrintF("AHI_RemoveAudioMode(0x%08lx)", id);
673 void
674 Debug_LoadModeFile( STRPTR name)
676 KPrintF("AHI_LoadModeFile(%s)", (IPTR)name);