From 1d0bc150693c63c7070af03a270428943804608d Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Tue, 31 Oct 2017 05:39:16 -0500 Subject: [PATCH] More DSound Clean Up TODO: XAudioDownloadEffectsImage 5558 has same OOVPA as 4361. Need investigate more of reason why this false detection occur. --- src/CxbxKrnl/HLEDataBase/DSound.1.0.4134.inl | 6 +- src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl | 13 ++- src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl | 5 +- src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl | 16 ++- src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl | 103 ------------------- src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl | 58 ----------- src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl | 18 ++-- 7 files changed, 40 insertions(+), 179 deletions(-) diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4134.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4134.inl index 971d8fd6a..ce818e8e5 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4134.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4134.inl @@ -1506,7 +1506,8 @@ OOVPA_END; // ****************************************************************** // * IDirectSoundBuffer_SetRolloffFactor // ****************************************************************** -OOVPA_XREF(IDirectSoundBuffer_SetRolloffFactor, 4134, 1+9, +// Generic OOVPA as of 4134 and newer +OOVPA_XREF(IDirectSoundBuffer_SetRolloffFactor, 4134, 1+10, XRefNoSaveIndex, XRefOne) @@ -1514,6 +1515,9 @@ OOVPA_XREF(IDirectSoundBuffer_SetRolloffFactor, 4134, 1+9, // IDirectSoundBuffer_SetRolloffFactor+0x1C : call [CDirectSoundBuffer::SetRolloffFactor] XREF_ENTRY( 0x1D, XREF_CDirectSoundBuffer_SetRolloffFactor ), + // IDirectSoundBuffer_SetRolloffFactor+0x00 : push dword ptr [esp+0Ch] + { 0x02, 0x24 }, + // IDirectSoundBuffer_SetRolloffFactor+0x04 : fld [esp+4+arg_4] { 0x04, 0xD9 }, { 0x05, 0x44 }, diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl index e23a4915a..4252a7a79 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl @@ -449,19 +449,25 @@ OOVPA_END; // ****************************************************************** // * DirectSound::CDirectSoundVoice::SetFormat // ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetFormat, 4721, 8, +// Generic OOVPA as of 4721 and newer +OOVPA_XREF(CDirectSoundVoice_SetFormat, 4721, 12, XREF_CDirectSoundVoice_SetFormat, XRefZero) + { 0x00, 0x56 }, + { 0x06, 0x4E }, { 0x0E, 0xE8 }, { 0x18, 0x4E }, { 0x25, 0xFF }, { 0x2E, 0x0C }, + { 0x2F, 0xE8 }, // call CMcpxVoiceClient::SetMixBins { 0x34, 0x85 }, { 0x38, 0x8B }, - { 0x43, 0x00 }, + { 0x3B, 0xE8 }, // call CMcpxVoiceClient::SetPitch + { 0x41, 0xC2 }, + { 0x42, 0x08 }, OOVPA_END; // ****************************************************************** @@ -857,7 +863,8 @@ OOVPA_END; // ****************************************************************** // * XAudioDownloadEffectsImage // ****************************************************************** -OOVPA_NO_XREF(XAudioDownloadEffectsImage, 4627, 8) +// TODO: Need to evaluate with 5558 title, I believe it needs more OVs. +OOVPA_NO_XREF(XAudioDownloadEffectsImage, 4361, 8) { 0x1E, 0xB6 }, { 0x41, 0x83 }, diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl index 3b5df4efb..fd29bb7e8 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl @@ -78,11 +78,14 @@ OOVPA_END; // ****************************************************************** // * CDirectSoundStream_FlushEx // ****************************************************************** -OOVPA_XREF(CDirectSoundStream_FlushEx, 5233, 15, +// Generic OOVPA as of 5233 and newer +OOVPA_XREF(CDirectSoundStream_FlushEx, 5233, 16, XREF_CDirectSoundStream_FlushEx, XRefZero) + { 0x00, 0x55 }, + { 0x24, 0xB8 }, { 0x25, 0x05 }, { 0x26, 0x40 }, diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl index 0c26b82f2..a6cbdd708 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl @@ -332,11 +332,15 @@ OOVPA_END; // ****************************************************************** // * CDirectSoundVoice::SetPosition // ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetPosition, 5344, 8, +// Generic OOVPA as of 5344 and newer +OOVPA_XREF(CDirectSoundVoice_SetPosition, 5344, 9, XREF_CDirectSoundVoice_SetPosition, XRefZero) + // CDirectSoundVoice_SetPosition+0x00 : push ebp + { 0x00, 0x55 }, + // CDirectSoundVoice_SetPosition+0x0F : mov edx, [ebp+arg_4] { 0x0F, 0x8B }, { 0x10, 0x55 }, @@ -581,11 +585,15 @@ OOVPA_END; // ****************************************************************** // * DirectSound::CDirectSoundVoice::SetRolloffFactor // ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetRolloffFactor, 5344, 12, +// Generic OOVPA as of 5344 and newer +OOVPA_XREF(CDirectSoundVoice_SetRolloffFactor, 5344, 13, XREF_CDirectSoundVoice_SetRolloffFactor, XRefZero) + // CDirectSoundVoice_SetRolloffFactor+0x00 : mov ecx,dword ptr [esp+4] + { 0x00, 0x8B }, + // CDirectSoundVoice_SetRolloffFactor+0x0D : mov edx, [esp+arg_4] { 0x0D, 0x8B }, { 0x0E, 0x54 }, @@ -602,8 +610,8 @@ OOVPA_XREF(CDirectSoundVoice_SetRolloffFactor, 5344, 12, { 0x1F, 0x03 }, // CDirectSoundVoice_SetRolloffFactor+0x30 : retn 0Ch - { 0x31, 0x0C }, - { 0x32, 0x00 } + { 0x30, 0xC2 }, + { 0x31, 0x0C } OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl index 74bdcbd19..006061c8a 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl @@ -462,61 +462,6 @@ OOVPA_XREF(CMcpxBuffer_GetStatus, 5558, 11, OOVPA_END; #endif -// ****************************************************************** -// * CDirectSoundVoice::SetFormat -// ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetFormat, 5558, 7, - - XREF_CDirectSoundVoice_SetFormat, - XRefZero) - - { 0x07, 0x10 }, - { 0x13, 0x85 }, - { 0x19, 0x10 }, - { 0x22, 0x0C }, - { 0x2B, 0x14 }, - { 0x34, 0x85 }, - { 0x40, 0x5E }, -OOVPA_END; - -// ****************************************************************** -// * CDirectSoundBuffer::SetFormat -// ****************************************************************** -OOVPA_XREF(CDirectSoundBuffer_SetFormat, 5558, 1+7, - - XREF_CDirectSoundBuffer_SetFormat, - XRefOne) - - XREF_ENTRY( 0x32, XREF_CDirectSoundVoice_SetFormat ), - - { 0x0C, 0x00 }, - { 0x12, 0x85 }, - { 0x1C, 0x15 }, - { 0x26, 0xEB }, - { 0x30, 0x10 }, - { 0x3A, 0x74 }, - { 0x47, 0x8B }, -OOVPA_END; - -// ****************************************************************** -// * IDirectSoundBuffer_SetFormat -// ****************************************************************** -OOVPA_XREF(IDirectSoundBuffer_SetFormat, 5558, 1+7, - - XRefNoSaveIndex, - XRefOne) - - XREF_ENTRY( 0x15, XREF_CDirectSoundBuffer_SetFormat ), - - { 0x02, 0x24 }, - { 0x06, 0x24 }, - { 0x0A, 0x83 }, - { 0x0E, 0xD9 }, - { 0x12, 0xC8 }, - { 0x19, 0xC2 }, - { 0x1A, 0x08 }, -OOVPA_END; - // ****************************************************************** // * CDirectSoundVoice::SetConeAngles // ****************************************************************** @@ -649,23 +594,6 @@ OOVPA_XREF(IDirectSoundBuffer8_SetAllParameters, 5558, 1+8, { 0x1E, 0x0C }, OOVPA_END; -// ****************************************************************** -// * CDirectSoundVoice::SetPosition -// ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetPosition, 5558, 7, - - XREF_CDirectSoundVoice_SetPosition, - XRefZero) - - { 0x09, 0x8B }, - { 0x14, 0x08 }, - { 0x1F, 0x55 }, - { 0x2A, 0x00 }, - { 0x35, 0x10 }, - { 0x40, 0xF6 }, - { 0x4C, 0x33 }, -OOVPA_END; - // ****************************************************************** // * CDirectSoundVoice::SetVelocity // ****************************************************************** @@ -867,37 +795,6 @@ OOVPA_XREF(IDirectSound_GetOutputLevels, 5558, 1+8, { 0x1E, 0x0C }, OOVPA_END; -// ****************************************************************** -// * XAudioDownloadEffectsImage -// ****************************************************************** -OOVPA_NO_XREF(XAudioDownloadEffectsImage, 5558, 8) - - { 0x1E, 0xB6 }, - { 0x41, 0x83 }, - { 0x61, 0x8B }, - { 0x80, 0x85 }, - { 0x9E, 0x8B }, - { 0xBE, 0x6A }, - { 0xDE, 0x07 }, - { 0xFE, 0xF7 }, -OOVPA_END; - -// ****************************************************************** -// * DirectSound::CDirectSound::SetPosition -// ****************************************************************** -OOVPA_XREF(CDirectSound_SetPosition, 5558, 7, - - XREF_CDirectSound_SetPosition, - XRefZero) - - { 0x0F, 0x00 }, - { 0x1E, 0xFF }, - { 0x2B, 0x8B }, - { 0x3A, 0x8B }, - { 0x49, 0x40 }, - { 0x58, 0xE8 }, - { 0x67, 0x15 }, -OOVPA_END; #if 0 // Replaced with generic OOVPA 3911 // ****************************************************************** // * IDirectSound_SetPosition diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl index ee93b4ddd..f21f994f5 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl @@ -289,42 +289,6 @@ OOVPA_XREF(CDirectSoundBuffer_PlayEx, 5788, 1+7, { 0x52, 0x8B }, OOVPA_END; -// ****************************************************************** -// * DirectSound::CDirectSoundVoice::SetRolloffFactor -// ****************************************************************** -OOVPA_XREF(CDirectSoundVoice_SetRolloffFactor, 5788, 7, - - XREF_CDirectSoundVoice_SetRolloffFactor, - XRefZero) - - { 0x05, 0x41 }, - { 0x0C, 0x00 }, - { 0x13, 0x48 }, - { 0x1A, 0x00 }, - { 0x21, 0xF6 }, - { 0x28, 0x51 }, - { 0x2F, 0xC0 }, -OOVPA_END; - -// ****************************************************************** -// * IDirectSoundBuffer_SetRolloffFactor -// ****************************************************************** -OOVPA_XREF(IDirectSoundBuffer_SetRolloffFactor, 5788, 1+7, - - XRefNoSaveIndex, - XRefOne) - - XREF_ENTRY( 0x1D, XREF_CDirectSoundBuffer_SetRolloffFactor ), - - { 0x03, 0x0C }, - { 0x08, 0x8B }, - { 0x0D, 0x8B }, - { 0x12, 0x83 }, - { 0x17, 0x1B }, - { 0x1C, 0xE8 }, - { 0x21, 0xC2 }, -OOVPA_END; - // ****************************************************************** // * IDirectSound_CreateSoundStream // ****************************************************************** @@ -385,23 +349,6 @@ OOVPA_XREF(CMcpxStream_Pause, 5788, 7, OOVPA_END; #endif -// ****************************************************************** -// * DirectSound::CDirectSoundStream::FlushEx -// ****************************************************************** -OOVPA_XREF(CDirectSoundStream_FlushEx, 5788, 7, - - XREF_CDirectSoundStream_FlushEx, - XRefZero) - - { 0x0F, 0x00 }, - { 0x1E, 0xFF }, - { 0x28, 0x80 }, - { 0x36, 0x74 }, - { 0x46, 0x8B }, - { 0x52, 0xFF }, - { 0x62, 0x8B }, -OOVPA_END; - // ****************************************************************** // * DirectSound::CMemoryManager::PoolAlloc // ****************************************************************** @@ -434,8 +381,3 @@ OOVPA_NO_XREF(XFileCreateMediaObjectAsync, 5788, 8) { 0x52, 0x06 }, { 0x5E, 0x0C }, OOVPA_END; - -// ****************************************************************** -// * Rollback support signature(s) -// ****************************************************************** -#define XAudioDownloadEffectsImage_5788 XAudioDownloadEffectsImage_4627 diff --git a/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl b/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl index 5ac211b0a..ed0813760 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl @@ -260,7 +260,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundVoice_SetDopplerFactor, XREF, 4134, 4361, 4627, 5344, 5558), REGISTER_OOVPAS(CDirectSoundVoice_SetEG, XREF, 3911, 4039), REGISTER_OOVPAS(CDirectSoundVoice_SetFilter, XREF, 3911, 4039), - REGISTER_OOVPAS(CDirectSoundVoice_SetFormat, XREF, 4242, 4721, 5558), + REGISTER_OOVPAS(CDirectSoundVoice_SetFormat, XREF, 4242, 4721), REGISTER_OOVPAS(CDirectSoundVoice_SetFrequency, XREF, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundVoice_SetHeadroom, XREF, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundVoice_SetI3DL2Source, XREF, 3911, 4039, 4134, 5344), @@ -272,9 +272,9 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundVoice_SetMode, XREF, 3911, 4039, 4134, 5344), REGISTER_OOVPAS(CDirectSoundVoice_SetOutputBuffer, XREF, 3911, 4039), REGISTER_OOVPAS(CDirectSoundVoice_SetPitch, XREF, 3911, 4039), - REGISTER_OOVPAS(CDirectSoundVoice_SetPosition, XREF, 3911, 4039, 4134, 4627, 5344, 5558), + REGISTER_OOVPAS(CDirectSoundVoice_SetPosition, XREF, 3911, 4039, 4134, 4627, 5344), REGISTER_OOVPAS(CDirectSoundVoice_SetRolloffCurve, XREF, 4627, 5344), - REGISTER_OOVPAS(CDirectSoundVoice_SetRolloffFactor, XREF, 4134, 4361, 5344, 5788), // s+ (from 4134's comment) + REGISTER_OOVPAS(CDirectSoundVoice_SetRolloffFactor, XREF, 4134, 4361, 5344), // s+ (from 4134's comment) REGISTER_OOVPAS(CDirectSoundVoice_SetVelocity, XREF, 3911, 4039, 4134, 5344), REGISTER_OOVPAS(CDirectSoundVoice_SetVolume, XREF, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundVoice_Use3DVoiceData, XREF, 5558), @@ -294,7 +294,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundBuffer_SetDopplerFactor, XREF, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_SetEG, XREF, 4039, 4242), REGISTER_OOVPAS(CDirectSoundBuffer_SetFilter, XREF, 4039, 4134), - REGISTER_OOVPAS(CDirectSoundBuffer_SetFormat, XREF, 4242, 5558), + REGISTER_OOVPAS(CDirectSoundBuffer_SetFormat, XREF, 4242), REGISTER_OOVPAS(CDirectSoundBuffer_SetFrequency, XREF, 4039, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_SetHeadroom, XREF, 4039, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_SetI3DL2Source, XREF, 4039, 4134), @@ -320,7 +320,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundStream_AddRef, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_Discontinuity, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_Flush, PATCH, 3911, 4039, 4134, 5344), - REGISTER_OOVPAS(CDirectSoundStream_FlushEx, XREF, 4627, 5233, 5788), + REGISTER_OOVPAS(CDirectSoundStream_FlushEx, XREF, 4627, 5233), REGISTER_OOVPAS(CDirectSoundStream_GetInfo, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_GetStatus, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_Pause, PATCH, 3911, 4039, 4134 /*, 4361, 5558*/), @@ -371,7 +371,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSound_SetI3DL2Listener, XREF, 3911, 4039, 4134, 5344, 5455), REGISTER_OOVPAS(CDirectSound_SetMixBinHeadroom, XREF, 3911, 4134), REGISTER_OOVPAS(CDirectSound_SetOrientation, XREF, 3911, 4039, 4134), - REGISTER_OOVPAS(CDirectSound_SetPosition, XREF, 3911, 4039, 4134, 4627, 5344, 5558), + REGISTER_OOVPAS(CDirectSound_SetPosition, XREF, 3911, 4039, 4134, 4627, 5344), REGISTER_OOVPAS(CDirectSound_SetRolloffFactor, XREF, 3911, 4039, 4134, 5344, 5558, 5788, 5849), REGISTER_OOVPAS(CDirectSound_SetVelocity, XREF, 3911, 4039, 4134, 4627, 5344, 5558), REGISTER_OOVPAS(CDirectSound_SynchPlayback, XREF, 5233, 5344), @@ -393,7 +393,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(IDirectSoundBuffer_SetDopplerFactor, PATCH, 4134), REGISTER_OOVPAS(IDirectSoundBuffer_SetEG, PATCH, 3911, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_SetFilter, PATCH, 3911, 4039), - REGISTER_OOVPAS(IDirectSoundBuffer_SetFormat, PATCH, 4242, 5558), + REGISTER_OOVPAS(IDirectSoundBuffer_SetFormat, PATCH, 4242), REGISTER_OOVPAS(IDirectSoundBuffer_SetFrequency, PATCH, 3911, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_SetHeadroom, PATCH, 3911, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_SetI3DL2Source, PATCH, 3911, 4039), @@ -411,7 +411,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(IDirectSoundBuffer_SetPlayRegion, PATCH, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_SetPosition, PATCH, 3911), REGISTER_OOVPAS(IDirectSoundBuffer_SetRolloffCurve, PATCH, 4627), - REGISTER_OOVPAS(IDirectSoundBuffer_SetRolloffFactor, PATCH, 4134, 5788), + REGISTER_OOVPAS(IDirectSoundBuffer_SetRolloffFactor, PATCH, 4134), REGISTER_OOVPAS(IDirectSoundBuffer_SetVelocity, PATCH, 3911), REGISTER_OOVPAS(IDirectSoundBuffer_SetVolume, PATCH, 3911, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_Stop, PATCH, 3911), @@ -484,7 +484,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(DirectSoundUseLightHRTF4Channel, PATCH, 5344), REGISTER_OOVPAS(WaveFormat_CreateXboxAdpcmFormat, XREF, 5344), - REGISTER_OOVPAS(XAudioDownloadEffectsImage, PATCH, 4627, 5558, 5788), + REGISTER_OOVPAS(XAudioDownloadEffectsImage, PATCH, 4361), REGISTER_OOVPAS(IsValidFormat, UNPATCHED, 3911), REGISTER_OOVPAS(XAudioCreatePcmFormat, UNPATCHED, 3911), REGISTER_OOVPAS(XAudioCreateAdpcmFormat, PATCH, 3911, 5344),