Mercurial > mm7
annotate AIL.cpp @ 2461:ff7f4995aa25
function MakeScreenshot()
author | Ritor1 |
---|---|
date | Tue, 05 Aug 2014 17:00:35 +0600 |
parents | f4af3b203f65 |
children |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
409
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
0 | 6 #include "AIL.h" |
7 | |
8 | |
9 | |
10 | |
11 int (__stdcall *mss32_AIL_startup)() = 0; | |
12 HREDBOOK (__stdcall *mss32_AIL_redbook_open_drive)(long) = 0; | |
13 int (__stdcall *mss32_AIL_set_preference)(unsigned int, int) = 0; | |
14 int (__stdcall *mss32_AIL_waveOutOpen)(HDIGDRIVER *, HWAVEOUT *, int, WAVEFORMAT *) = 0; | |
15 int (__stdcall *mss32_AIL_get_preference)(unsigned int) = 0; | |
16 int (__stdcall *mss32_AIL_digital_configuration)(HDIGDRIVER, int *, int *, char *) = 0; | |
17 HSAMPLE (__stdcall *mss32_AIL_allocate_sample_handle)(HDIGDRIVER) = 0; | |
28 | 18 void (__stdcall *mss32_AIL_3D_provider_attribute)(HPROVIDER, char *, void *) = 0; |
0 | 19 unsigned int (__stdcall *mss32_AIL_redbook_tracks)(HREDBOOK) = 0; |
20 int (__stdcall *mss32_AIL_redbook_volume)(HREDBOOK) = 0; | |
21 unsigned int (__stdcall *mss32_AIL_redbook_stop)(HREDBOOK) = 0; | |
22 void (__stdcall *mss32_AIL_set_digital_master_volume)(HDIGDRIVER, float) = 0; | |
23 int (__stdcall *mss32_AIL_redbook_set_volume)(HREDBOOK, int) = 0; | |
28 | 24 void (__stdcall *mss32_AIL_waveOutClose)(HDIGDRIVER) = 0; |
0 | 25 unsigned int (__stdcall *mss32_AIL_redbook_pause)(HREDBOOK) = 0; |
26 void (__stdcall *mss32_AIL_redbook_track_info)(HREDBOOK, unsigned int, unsigned int *, unsigned int *) = 0; | |
27 unsigned int (__stdcall *mss32_AIL_redbook_play)(HREDBOOK, unsigned int, unsigned int) = 0; | |
28 unsigned int (__stdcall *mss32_AIL_redbook_resume)(HREDBOOK) = 0; | |
29 AIL::Sample::Status (__stdcall *mss32_AIL_sample_status)(HSAMPLE) = 0; | |
30 int (__stdcall *mss32_AIL_sample_volume)(HSAMPLE) = 0; | |
31 int (__stdcall *mss32_AIL_enumerate_3D_providers)(int *, HPROVIDER *, char **) = 0; | |
32 DWORD (__stdcall *mss32_AIL_open_3D_provider)(HPROVIDER) = 0; | |
33 int (__stdcall *mss32_AIL_end_sample)(HSAMPLE) = 0; | |
34 int (__stdcall *mss32_AIL_set_sample_volume)(HSAMPLE, long) = 0; | |
35 int (__stdcall *mss32_AIL_set_sample_pan)(HSAMPLE, long) = 0; | |
36 void (__stdcall *mss32_AIL_end_sequence)(HSEQUENCE) = 0; | |
37 void (__stdcall *mss32_AIL_pause_stream)(HSTREAM, int) = 0; | |
38 void (__stdcall *mss32_AIL_init_sample)(HSAMPLE) = 0; | |
39 int (__stdcall *mss32_AIL_set_sample_file)(HSAMPLE, const void *, int) = 0; | |
40 void (__stdcall *mss32_AIL_set_sample_loop_count)(HSAMPLE, int) = 0; | |
41 void (__stdcall *mss32_AIL_set_sample_playback_rate)(HSAMPLE, int) = 0; | |
42 void (__stdcall *mss32_AIL_sample_ms_position)(HSAMPLE, int *, int *) = 0; | |
388 | 43 int (__stdcall *mss32_AIL_start_sample)(HSAMPLE) = 0; |
0 | 44 AILFILETYPE (__stdcall *mss32_AIL_file_type)(void *, int) = 0; |
45 int (__stdcall *mss32_AIL_WAV_info)(void *, AILSOUNDINFO *) = 0; | |
46 int (__stdcall *mss32_AIL_decompress_ADPCM)(AILSOUNDINFO *, void *, void *) = 0; | |
47 HREDBOOK (__stdcall *mss32_AIL_redbook_open)(int) = 0; | |
28 | 48 void (__stdcall *mss32_AIL_release_sample_handle)(HSAMPLE) = 0; |
0 | 49 void MSS32_DLL_Initialize() |
50 { | |
51 HMODULE pDll = LoadLibraryW(L"mss32.dll"); | |
52 | |
53 mss32_AIL_startup = (int (__stdcall *)())GetProcAddress(pDll, "_AIL_startup@0"); | |
54 mss32_AIL_redbook_open_drive = (HREDBOOK (__stdcall *)(long))GetProcAddress(pDll, "_AIL_redbook_open_drive@4"); | |
55 mss32_AIL_set_preference = (int (__stdcall *)(unsigned int, int))GetProcAddress(pDll, "_AIL_set_preference@8"); | |
56 mss32_AIL_waveOutOpen = (int (__stdcall *)(HDIGDRIVER *, HWAVEOUT *, int, WAVEFORMAT *))GetProcAddress(pDll, "_AIL_waveOutOpen@16"); | |
57 mss32_AIL_get_preference = (int (__stdcall *)(unsigned int))GetProcAddress(pDll, "_AIL_get_preference@4"); | |
58 mss32_AIL_digital_configuration = (int (__stdcall *)(HDIGDRIVER, int *, int *, char *))GetProcAddress(pDll, "_AIL_digital_configuration@16"); | |
59 mss32_AIL_allocate_sample_handle = (HSAMPLE (__stdcall *)(HDIGDRIVER))GetProcAddress(pDll, "_AIL_allocate_sample_handle@4"); | |
28 | 60 mss32_AIL_3D_provider_attribute = (void (__stdcall *)(HPROVIDER,char *, void *))GetProcAddress(pDll, "_AIL_3D_provider_attribute@12"); |
0 | 61 mss32_AIL_redbook_tracks = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_tracks@4"); |
62 mss32_AIL_redbook_volume = (int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_volume@4"); | |
63 mss32_AIL_redbook_stop = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_stop@4"); | |
64 mss32_AIL_set_digital_master_volume = (void (__stdcall *)(HDIGDRIVER, float))GetProcAddress(pDll, "_AIL_set_digital_master_volume@8"); | |
65 mss32_AIL_redbook_set_volume = (int (__stdcall *)(HREDBOOK, int))GetProcAddress(pDll, "_AIL_redbook_set_volume@8"); | |
28 | 66 mss32_AIL_waveOutClose = (void (__stdcall *)(HDIGDRIVER))GetProcAddress(pDll, "_AIL_waveOutClose@4"); |
0 | 67 mss32_AIL_redbook_pause = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_pause@4"); |
68 mss32_AIL_redbook_track_info = (void (__stdcall *)(HREDBOOK, unsigned int, unsigned int *, unsigned int *))GetProcAddress(pDll, "_AIL_redbook_track_info@16"); | |
69 mss32_AIL_redbook_play = (unsigned int (__stdcall *)(HREDBOOK, unsigned int, unsigned int))GetProcAddress(pDll, "_AIL_redbook_play@12"); | |
70 mss32_AIL_redbook_resume = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_resume@4"); | |
71 mss32_AIL_sample_status = (AIL::Sample::Status (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_sample_status@4"); | |
72 mss32_AIL_sample_volume = (int (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_sample_volume@4"); | |
73 mss32_AIL_enumerate_3D_providers = (int (__stdcall *)(int *, HPROVIDER *, char **))GetProcAddress(pDll, "_AIL_enumerate_3D_providers@12"); | |
74 mss32_AIL_open_3D_provider = (DWORD (__stdcall *)(HPROVIDER))GetProcAddress(pDll, "_AIL_open_3D_provider@4"); | |
75 mss32_AIL_end_sample = (int (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_end_sample@4"); | |
76 mss32_AIL_set_sample_volume = (int (__stdcall *)(HSAMPLE, long))GetProcAddress(pDll, "_AIL_set_sample_volume@8"); | |
77 mss32_AIL_set_sample_pan = (int (__stdcall *)(HSAMPLE, long))GetProcAddress(pDll, "_AIL_set_sample_pan@8"); | |
78 mss32_AIL_end_sequence = (void (__stdcall *)(HSEQUENCE))GetProcAddress(pDll, "_AIL_end_sequence@4"); | |
79 mss32_AIL_pause_stream = (void (__stdcall *)(HSTREAM, int))GetProcAddress(pDll, "_AIL_pause_stream@8"); | |
80 mss32_AIL_init_sample = (void (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_init_sample@4"); | |
81 mss32_AIL_set_sample_file = (int (__stdcall *)(HSAMPLE, const void *, int))GetProcAddress(pDll, "_AIL_set_sample_file@12"); | |
82 mss32_AIL_set_sample_loop_count = (void (__stdcall *)(HSAMPLE, int))GetProcAddress(pDll, "_AIL_set_sample_loop_count@8"); | |
83 mss32_AIL_set_sample_playback_rate = (void (__stdcall *)(HSAMPLE, int))GetProcAddress(pDll, "_AIL_set_sample_playback_rate@8"); | |
84 mss32_AIL_sample_ms_position = (void (__stdcall *)(HSAMPLE, int *, int *))GetProcAddress(pDll, "_AIL_sample_ms_position@12"); | |
388 | 85 mss32_AIL_start_sample = (int (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_start_sample@4"); |
0 | 86 mss32_AIL_file_type = (AILFILETYPE (__stdcall *)(void *, int))GetProcAddress(pDll, "_AIL_file_type@8"); |
87 mss32_AIL_WAV_info = (int (__stdcall *)(void *, AILSOUNDINFO *))GetProcAddress(pDll, "_AIL_WAV_info@8"); | |
88 mss32_AIL_decompress_ADPCM = (int (__stdcall *)(AILSOUNDINFO *, void *, void *))GetProcAddress(pDll, "_AIL_decompress_ADPCM@12"); | |
89 mss32_AIL_redbook_open = (HREDBOOK (__stdcall *)(int))GetProcAddress(pDll, "_AIL_redbook_open@4"); | |
28 | 90 mss32_AIL_release_sample_handle = (void (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_release_sample_handle@4"); |
0 | 91 } |
92 | |
93 | |
94 | |
95 unsigned int __stdcall AIL_redbook_play(HREDBOOK hRedbook, unsigned int uStartMS, unsigned int uEndMS) | |
96 { | |
97 return (mss32_AIL_redbook_play)(hRedbook, uStartMS, uEndMS); | |
98 } | |
99 | |
100 void __stdcall AIL_redbook_track_info(HREDBOOK hRedbook, unsigned int uTrackNum, unsigned int *pStartMS, unsigned int *pEndMS) | |
101 { | |
102 (mss32_AIL_redbook_track_info)(hRedbook, uTrackNum, pStartMS, pEndMS); | |
103 } | |
104 | |
105 unsigned int __stdcall AIL_redbook_resume(HREDBOOK hRedbook) | |
106 { | |
107 return (mss32_AIL_redbook_resume)(hRedbook); | |
108 } | |
109 | |
110 int __stdcall AIL_enumerate_3D_providers(int *a1, HPROVIDER *pOutProv, char **pOutName) | |
111 { | |
112 return (mss32_AIL_enumerate_3D_providers)(a1, pOutProv, pOutName); | |
113 } | |
114 HREDBOOK __stdcall AIL_redbook_open(int w) | |
115 { | |
116 return (mss32_AIL_redbook_open)(w); | |
117 } | |
118 | |
119 | |
120 int __stdcall AIL_sample_volume(HSAMPLE s) | |
121 { | |
122 return (mss32_AIL_sample_volume)(s); | |
123 } | |
124 | |
125 AIL::Sample::Status __stdcall AIL_sample_status(HSAMPLE a1) | |
126 { | |
127 return (mss32_AIL_sample_status)(a1); | |
128 } | |
129 | |
130 // sub_4D8304: using guessed type int __stdcall AIL_set_digital_master_volume(_DWORD, _DWORD); | |
131 void __stdcall AIL_set_digital_master_volume(HDIGDRIVER hDrv, float master_volume) | |
132 { | |
133 (mss32_AIL_set_digital_master_volume)(hDrv, master_volume); | |
134 } | |
135 | |
136 // sub_4D8370: using guessed type int __stdcall AIL_allocate_sample_handle(_DWORD); | |
137 HSAMPLE __stdcall AIL_allocate_sample_handle(HDIGDRIVER hDrv) | |
138 { | |
139 return (mss32_AIL_allocate_sample_handle)(hDrv); | |
140 } | |
141 | |
142 // sub_4D8308: using guessed type int __fastcall AIL_redbook_set_volume(_DWORD, _DWORD, _DWORD, _DWORD); | |
143 int __stdcall AIL_redbook_set_volume(HREDBOOK hRedbook, int volume) | |
144 { | |
145 return (mss32_AIL_redbook_set_volume)(hRedbook, volume); | |
146 } | |
147 | |
148 // sub_4D8324: using guessed type int __stdcall AIL_redbook_stop(_DWORD); | |
149 unsigned int __stdcall AIL_redbook_stop(HREDBOOK hRedbook) | |
150 { | |
151 return (mss32_AIL_redbook_stop)(hRedbook); | |
152 } | |
153 | |
154 // sub_4D835C: using guessed type int __stdcall AIL_startup(); | |
155 int __stdcall AIL_startup() | |
156 { | |
157 return (mss32_AIL_startup)(); | |
158 } | |
159 | |
160 // sub_4D8360: using guessed type int __stdcall AIL_redbook_open_drive(_DWORD); | |
161 HREDBOOK __stdcall AIL_redbook_open_drive(long drive) | |
162 { | |
163 return (mss32_AIL_redbook_open_drive)(drive); | |
164 } | |
165 | |
166 // sub_4D834C: using guessed type int __stdcall AIL_waveOutOpen(_DWORD, _DWORD, _DWORD, _DWORD); | |
4 | 167 int __stdcall AIL_waveOutOpen(_DIG_DRIVER **drv, HWAVEOUT *phWaveOut, int wDeviceID, WAVEFORMAT *pFormat) |
0 | 168 { |
169 return (mss32_AIL_waveOutOpen)(drv, phWaveOut, wDeviceID, pFormat); | |
170 } | |
171 | |
172 | |
173 DWORD __stdcall AIL_open_3D_provider(HPROVIDER a2) | |
174 { | |
175 return (mss32_AIL_open_3D_provider)(a2); | |
176 } | |
177 | |
28 | 178 void __stdcall AIL_3D_provider_attribute(HPROVIDER lib, char *name, void *val) |
388 | 179 { |
28 | 180 (mss32_AIL_3D_provider_attribute)(lib,name,val); |
0 | 181 } |
182 | |
183 // sub_4D8374: using guessed type int __stdcall AIL_redbook_tracks(_DWORD); | |
184 unsigned int __stdcall AIL_redbook_tracks(HREDBOOK hRedbook) | |
185 { | |
186 return (mss32_AIL_redbook_tracks)(hRedbook); | |
187 } | |
188 | |
189 // sub_4D83B0: using guessed type int __stdcall AIL_redbook_volume(_DWORD); | |
190 int __stdcall AIL_redbook_volume(HREDBOOK hRedbook) | |
191 { | |
192 return (mss32_AIL_redbook_volume)(hRedbook); | |
193 } | |
194 | |
195 // sub_4D8348: using guessed type int __stdcall AIL_set_preference(_DWORD, _DWORD); | |
196 int __stdcall AIL_set_preference(unsigned int number, int value) | |
197 { | |
198 return (mss32_AIL_set_preference)(number, value); | |
199 } | |
200 | |
201 // sub_4D8350: using guessed type int __stdcall AIL_digital_configuration(_DWORD, _DWORD, _DWORD, _DWORD); | |
202 int __stdcall AIL_digital_configuration(HDIGDRIVER drv, int *rate, int *format, char *string) | |
203 { | |
204 return (mss32_AIL_digital_configuration)(drv, rate, format, string); | |
205 } | |
206 | |
207 // sub_4D8354: using guessed type int __stdcall AIL_get_preference(_DWORD); | |
208 int __stdcall AIL_get_preference(unsigned int number) | |
209 { | |
210 return (mss32_AIL_get_preference)(number); | |
211 } | |
212 | |
28 | 213 void __stdcall AIL_waveOutClose(HDIGDRIVER drvr) |
0 | 214 { |
28 | 215 (mss32_AIL_waveOutClose)(drvr); |
0 | 216 } |
217 | |
218 // sub_4D8320: using guessed type int __stdcall AIL_redbook_pause(_DWORD); | |
219 unsigned int __stdcall AIL_redbook_pause(HREDBOOK hRedbook) | |
220 { | |
221 return (mss32_AIL_redbook_pause)(hRedbook); | |
222 } | |
223 | |
224 int __stdcall AIL_set_3D_provider_preference(HPROVIDER a1, const char *a2, int *a3) | |
225 { | |
226 __asm int 3 | |
227 return 0; | |
228 } | |
229 | |
230 int __stdcall AIL_allocate_3D_sample_handle(HPROVIDER) | |
231 { | |
232 __asm int 3 | |
233 return 0; | |
234 } | |
235 | |
236 int __stdcall AIL_set_3D_sample_float_distances(void *a1, long a2, long a3, long a4, long a5) | |
237 { | |
238 __asm int 3 | |
239 return 0; | |
240 } | |
241 | |
242 int __stdcall AIL_set_3D_sample_volume(void *a1, long a2) | |
243 { | |
244 __asm int 3 | |
245 return 0; | |
246 } | |
247 | |
28 | 248 void __stdcall AIL_release_sample_handle(HSAMPLE s) |
0 | 249 { |
28 | 250 (mss32_AIL_release_sample_handle)(s); |
0 | 251 } |
252 | |
253 int __stdcall AIL_release_3D_sample_handle(void *a1) | |
254 { | |
255 __asm int 3 | |
256 return 0; | |
257 } | |
258 | |
259 int __stdcall AIL_close_3D_provider(HPROVIDER) | |
260 { | |
388 | 261 __asm int 3 |
0 | 262 return 0; |
263 } | |
264 | |
265 int __stdcall AIL_redbook_close(HREDBOOK a1) | |
266 { | |
409 | 267 __asm int 3 |
0 | 268 return 0; |
269 } | |
270 | |
271 // sub_4D8344: using guessed type int __stdcall AIL_shutdown(); | |
272 int __stdcall AIL_shutdown() | |
273 { | |
409 | 274 __asm int 3 |
0 | 275 return 0; |
276 } | |
277 | |
278 int __stdcall AIL_end_sample(HSAMPLE a1) | |
279 { | |
280 return (mss32_AIL_end_sample)(a1); | |
281 } | |
282 | |
283 int __stdcall AIL_end_3D_sample(void *a1) | |
284 { | |
285 __debugbreak(); | |
286 return 0; | |
287 } | |
288 | |
289 | |
290 void __stdcall AIL_end_sequence(HSEQUENCE a1) | |
291 { | |
292 (mss32_AIL_end_sequence)(a1); | |
293 } | |
294 | |
295 void __stdcall AIL_pause_stream(HSTREAM a1, int onoff) | |
296 { | |
297 (mss32_AIL_pause_stream)(a1, onoff); | |
298 } | |
299 | |
300 int __stdcall AIL_set_sample_file(HSAMPLE s, const void *file_image, int block) | |
301 { | |
302 return (mss32_AIL_set_sample_file)(s, file_image, block); | |
303 } | |
304 | |
388 | 305 int __stdcall AIL_start_sample(HSAMPLE s) |
0 | 306 { |
388 | 307 return (mss32_AIL_start_sample)(s); |
0 | 308 } |
309 | |
310 void __stdcall AIL_set_sample_playback_rate(HSAMPLE s, int rate) | |
311 { | |
312 (mss32_AIL_set_sample_playback_rate)(s, rate); | |
313 } | |
314 | |
315 void __stdcall AIL_sample_ms_position(HSAMPLE s, int *pTotalMS, int *pCurrentMS) | |
316 { | |
317 (mss32_AIL_sample_ms_position)(s, pTotalMS, pCurrentMS); | |
318 } | |
319 | |
320 int __stdcall AIL_3D_sample_status(void *a1) | |
321 { | |
322 __asm int 3 | |
323 return 0; | |
324 } | |
325 | |
326 void __stdcall AIL_set_sample_loop_count(HSAMPLE s, int num) | |
327 { | |
328 (mss32_AIL_set_sample_loop_count)(s, num); | |
329 } | |
330 | |
331 int __stdcall AIL_set_sample_volume(HSAMPLE a1, long a2) | |
332 { | |
333 return (mss32_AIL_set_sample_volume)(a1, a2); | |
334 } | |
335 | |
336 int __stdcall AIL_3D_position(void *a1, int *a2, float *a3, long *a4) | |
337 { | |
338 __asm int 3 | |
339 return 0; | |
340 } | |
341 | |
342 int __stdcall AIL_set_3D_sample_file(long a1, void *a2) | |
343 { | |
344 __asm int 3 | |
345 return 0; | |
346 } | |
347 | |
348 int __stdcall AIL_set_3D_sample_loop_count(long a1, long a2) | |
349 { | |
350 __asm int 3 | |
351 return 0; | |
352 } | |
353 | |
354 int __stdcall AIL_start_3D_sample(long a1) | |
355 { | |
356 __asm int 3 | |
357 return 0; | |
358 } | |
359 | |
360 int __stdcall AIL_set_3D_position(void *hSample, long a2, long a3, long a4) | |
361 { | |
362 __asm int 3 | |
363 return 0; | |
364 } | |
365 | |
366 int __stdcall AIL_set_3D_orientation(void *hSample, long a2, long a3, long a4, long a5, long a6, long a7) | |
367 { | |
368 __asm int 3 | |
369 return 0; | |
370 } | |
371 | |
372 void __stdcall AIL_init_sample(HSAMPLE a1) | |
373 { | |
374 (mss32_AIL_init_sample)(a1); | |
375 } | |
376 | |
377 int __stdcall AIL_set_sample_pan(HSAMPLE a1, long a2) | |
378 { | |
379 return (mss32_AIL_set_sample_pan)(a1, a2); | |
380 } | |
381 | |
382 | |
383 AILFILETYPE __stdcall AIL_file_type(void *pSoundBytes, int numBytes) | |
384 { | |
385 return (mss32_AIL_file_type)(pSoundBytes, numBytes); | |
386 } | |
387 | |
388 int __stdcall AIL_WAV_info(void *pSoundBytes, AILSOUNDINFO *pInfo) | |
389 { | |
390 return (mss32_AIL_WAV_info)(pSoundBytes, pInfo); | |
391 } | |
392 | |
393 int __stdcall AIL_decompress_ADPCM(AILSOUNDINFO *pInfo, void *a2, void *a3) | |
394 { | |
395 return (mss32_AIL_decompress_ADPCM)(pInfo, a2, a3); | |
396 } | |
397 | |
398 int __stdcall AIL_mem_free_lock(void *a1) | |
399 { | |
400 __asm int 3 | |
401 return 0; | |
402 } |