changeset 28:739d8f3b50f9

ReleaseSoundData fix
author zipi@zipi-PC
date Sat, 19 Jan 2013 16:15:06 +0000
parents 7fb7febacb46
children 8a6ba554d341 4c90ae1041aa
files AIL.cpp AIL.h AudioPlayer.cpp OSAPI.cpp
diffstat 4 files changed, 25 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/AIL.cpp	Fri Jan 18 20:17:38 2013 +0600
+++ b/AIL.cpp	Sat Jan 19 16:15:06 2013 +0000
@@ -10,11 +10,13 @@
 int (__stdcall *mss32_AIL_get_preference)(unsigned int) = 0;
 int (__stdcall *mss32_AIL_digital_configuration)(HDIGDRIVER, int *, int *, char *) = 0;
 HSAMPLE (__stdcall *mss32_AIL_allocate_sample_handle)(HDIGDRIVER) = 0;
+void (__stdcall *mss32_AIL_3D_provider_attribute)(HPROVIDER, char *, void *) = 0;
 unsigned int (__stdcall *mss32_AIL_redbook_tracks)(HREDBOOK) = 0;
 int (__stdcall *mss32_AIL_redbook_volume)(HREDBOOK) = 0;
 unsigned int (__stdcall *mss32_AIL_redbook_stop)(HREDBOOK) = 0;
 void (__stdcall *mss32_AIL_set_digital_master_volume)(HDIGDRIVER, float) = 0;
 int (__stdcall *mss32_AIL_redbook_set_volume)(HREDBOOK, int) = 0;
+void (__stdcall *mss32_AIL_waveOutClose)(HDIGDRIVER) = 0;
 unsigned int (__stdcall *mss32_AIL_redbook_pause)(HREDBOOK) = 0;
 void (__stdcall *mss32_AIL_redbook_track_info)(HREDBOOK, unsigned int, unsigned int *, unsigned int *) = 0;
 unsigned int (__stdcall *mss32_AIL_redbook_play)(HREDBOOK, unsigned int, unsigned int) = 0;
@@ -38,6 +40,7 @@
 int (__stdcall *mss32_AIL_WAV_info)(void *, AILSOUNDINFO *) = 0;
 int (__stdcall *mss32_AIL_decompress_ADPCM)(AILSOUNDINFO *, void *, void *) = 0;
 HREDBOOK (__stdcall *mss32_AIL_redbook_open)(int) = 0;
+void (__stdcall *mss32_AIL_release_sample_handle)(HSAMPLE) = 0;
 void MSS32_DLL_Initialize()
 {
  HMODULE pDll = LoadLibraryW(L"mss32.dll");
@@ -49,11 +52,13 @@
  mss32_AIL_get_preference = (int (__stdcall *)(unsigned int))GetProcAddress(pDll, "_AIL_get_preference@4");
  mss32_AIL_digital_configuration = (int (__stdcall *)(HDIGDRIVER, int *, int *, char *))GetProcAddress(pDll, "_AIL_digital_configuration@16");
  mss32_AIL_allocate_sample_handle = (HSAMPLE (__stdcall *)(HDIGDRIVER))GetProcAddress(pDll, "_AIL_allocate_sample_handle@4");
+ mss32_AIL_3D_provider_attribute = (void (__stdcall *)(HPROVIDER,char *, void *))GetProcAddress(pDll, "_AIL_3D_provider_attribute@12");
  mss32_AIL_redbook_tracks = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_tracks@4");
  mss32_AIL_redbook_volume = (int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_volume@4");
  mss32_AIL_redbook_stop = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_stop@4");
  mss32_AIL_set_digital_master_volume = (void (__stdcall *)(HDIGDRIVER, float))GetProcAddress(pDll, "_AIL_set_digital_master_volume@8");
  mss32_AIL_redbook_set_volume = (int (__stdcall *)(HREDBOOK, int))GetProcAddress(pDll, "_AIL_redbook_set_volume@8");
+ mss32_AIL_waveOutClose = (void (__stdcall *)(HDIGDRIVER))GetProcAddress(pDll, "_AIL_waveOutClose@4");
  mss32_AIL_redbook_pause = (unsigned int (__stdcall *)(HREDBOOK))GetProcAddress(pDll, "_AIL_redbook_pause@4");
  mss32_AIL_redbook_track_info = (void (__stdcall *)(HREDBOOK, unsigned int, unsigned int *, unsigned int *))GetProcAddress(pDll, "_AIL_redbook_track_info@16");
  mss32_AIL_redbook_play = (unsigned int (__stdcall *)(HREDBOOK, unsigned int, unsigned int))GetProcAddress(pDll, "_AIL_redbook_play@12");
@@ -77,6 +82,7 @@
  mss32_AIL_WAV_info = (int (__stdcall *)(void *, AILSOUNDINFO *))GetProcAddress(pDll, "_AIL_WAV_info@8");
  mss32_AIL_decompress_ADPCM = (int (__stdcall *)(AILSOUNDINFO *, void *, void *))GetProcAddress(pDll, "_AIL_decompress_ADPCM@12");
  mss32_AIL_redbook_open = (HREDBOOK (__stdcall *)(int))GetProcAddress(pDll, "_AIL_redbook_open@4");
+ mss32_AIL_release_sample_handle = (void (__stdcall *)(HSAMPLE))GetProcAddress(pDll, "_AIL_release_sample_handle@4");
 }
 
 
@@ -164,10 +170,12 @@
  return (mss32_AIL_open_3D_provider)(a2);
 }
 
-int __stdcall AIL_3D_provider_attribute(HPROVIDER a1, const char *a2, int *a3)
+void __stdcall AIL_3D_provider_attribute(HPROVIDER lib, char *name, void *val)
 {
- __asm int 3
- return 0;
+ //__asm int 3
+ //return 0;
+ 
+ (mss32_AIL_3D_provider_attribute)(lib,name,val);
 }
 
 // sub_4D8374: using guessed type int __stdcall AIL_redbook_tracks(_DWORD);
@@ -200,10 +208,12 @@
  return (mss32_AIL_get_preference)(number);
 }
 
-int __stdcall AIL_waveOutClose(_DIG_DRIVER *)
+void __stdcall AIL_waveOutClose(HDIGDRIVER drvr)
 {
- __asm int 3
- return 0;
+ //__asm int 3
+ //return 0;
+
+ (mss32_AIL_waveOutClose)(drvr);
 }
 
 // sub_4D8320: using guessed type int __stdcall AIL_redbook_pause(_DWORD);
@@ -236,10 +246,12 @@
  return 0;
 }
 
-int __stdcall AIL_release_sample_handle(void *a1)
+void __stdcall AIL_release_sample_handle(HSAMPLE s)
 {
  //__asm int 3
- return 0;
+ //return 0;
+
+ (mss32_AIL_release_sample_handle)(s);
 }
 
 int __stdcall AIL_release_3D_sample_handle(void *a1)
--- a/AIL.h	Fri Jan 18 20:17:38 2013 +0600
+++ b/AIL.h	Sat Jan 19 16:15:06 2013 +0000
@@ -246,13 +246,13 @@
 unsigned int __stdcall AIL_redbook_resume(HREDBOOK);
 int __stdcall AIL_enumerate_3D_providers(int *a1, HPROVIDER *pOutProv, char **pOutName);
 DWORD __stdcall AIL_open_3D_provider(HPROVIDER a2);
-int __stdcall AIL_3D_provider_attribute(HPROVIDER a1, const char *a2, int *a3);
+void __stdcall AIL_3D_provider_attribute(HPROVIDER lib, char *name, void *val);
 int __stdcall AIL_set_3D_provider_preference(HPROVIDER a1, const char *a2, int *a3);
-int __stdcall AIL_waveOutClose(_DIG_DRIVER *);
+void __stdcall AIL_waveOutClose(HDIGDRIVER drvr);
 int __stdcall AIL_allocate_3D_sample_handle(HPROVIDER);
 int __stdcall AIL_set_3D_sample_float_distances(void *a1, long a2, long a3, long a4, long a5);
 int __stdcall AIL_set_3D_sample_volume(void *a1, long a2);
-int __stdcall AIL_release_sample_handle(void *a1);
+void __stdcall AIL_release_sample_handle(HSAMPLE s);
 int __stdcall AIL_3D_position(void *a1, int *a2, float *a3, long *a4);
 int __stdcall AIL_set_3D_sample_file(long a1, void *a2);
 int __stdcall AIL_set_3D_sample_loop_count(long a1, long a2);
--- a/AudioPlayer.cpp	Fri Jan 18 20:17:38 2013 +0600
+++ b/AudioPlayer.cpp	Sat Jan 19 16:15:06 2013 +0000
@@ -2525,7 +2525,7 @@
   {
     v2 += 128;
     ++pID;
-    if ( (signed int)v2 >= (signed int)&pAudioPlayer->p3DSamples[6].field_8 )
+	if ( v2 > (void *)&pSounds[2999].pSoundData)//(signed int)&pAudioPlayer->p3DSamples[6].field_8 )
       return;
   }
   pAllocator->FreeChunk(_this);
--- a/OSAPI.cpp	Fri Jan 18 20:17:38 2013 +0600
+++ b/OSAPI.cpp	Sat Jan 19 16:15:06 2013 +0000
@@ -35,6 +35,6 @@
   if (hPrevWindow)
     SetActiveWindow(hPrevWindow);
 
-  __debugbreak();
+  //__debugbreak();
   return 0;
 }