diff --git a/src/CxbxKrnl/HLEDataBase.h b/src/CxbxKrnl/HLEDataBase.h index df07bf782..49f8836cd 100644 --- a/src/CxbxKrnl/HLEDataBase.h +++ b/src/CxbxKrnl/HLEDataBase.h @@ -282,6 +282,7 @@ enum XRefDataBaseOffset XREF_CMcpxBuffer_Play2, XREF_CDirectSoundVoice_Use3DVoiceData, XREF_CDirectSoundBuffer_Use3DVoiceData, + XREF_CDirectSoundStream_Use3DVoiceData, XREF_CDirectSound_SetEffectData, XREF_CDirectSound_GetSpeakerConfig, XREF_CDirectSound_DownloadEffectsImage, @@ -302,12 +303,15 @@ enum XRefDataBaseOffset XREF_CMcpxVoiceClient_GetVoiceProperties, XREF_CDirectSoundBuffer_GetVoiceProperties, XREF_CDirectSoundStream_GetVoiceProperties, + XREF_CDirectSoundVoice_Set3DVoiceData, + XREF_CDirectSoundBuffer_Set3DVoiceData, XREF_CDirectSoundStream_Set3DVoiceData, - XREF_CDirectSoundStream_Use3DVoiceData, XREF_CDirectSound3DCalculator_GetVoiceData, XREF_CDirectSound3DCalculator_GetPanData, XREF_CDirectSound3DCalculator_GetMixBinVolumes, XREF_CDirectSound3DCalculator_Calculate3D, + XREF_CDirectSound_UnmapBufferData, + XREF_CDirectSound_MapBufferData, // XACT // +s XREF_XACT_CEngine_RegisterWaveBank, diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl index 72b4a9155..dfdb15d06 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl @@ -1119,15 +1119,18 @@ OOVPA_END; // ****************************************************************** // * XWaveFileCreateMediaObject // ****************************************************************** -OOVPA_NO_XREF(XWaveFileCreateMediaObject, 4627, 7) +OOVPA_NO_XREF(XWaveFileCreateMediaObject, 4627, 10) { 0x0D, 0x0B }, { 0x1C, 0xF7 }, { 0x2B, 0x07 }, { 0x3A, 0xF0 }, + { 0x3F, 0x83 }, { 0x49, 0x10 }, { 0x5C, 0x8B }, { 0x67, 0x07 }, + { 0x70, 0xC2 }, + { 0x71, 0x0C }, OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl index 95bc77aa9..517c31eba 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5344.inl @@ -1730,6 +1730,159 @@ OOVPA_XREF(IDirectSound3DCalculator_Calculate3D, 5344, 1+1, { 0x00, 0xE9 }, OOVPA_END; +// ****************************************************************** +// * XAudioSetEffectData +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(XAudioSetEffectData, 5344, 2+3, + + XRefNoSaveIndex, + XRefTwo) + + // XAudioSetEffectData+0x79 : call [CDirectSound_GetEffectData] + XREF_ENTRY(0x07A, XREF_CDirectSound_GetEffectData), + + // XAudioSetEffectData+0xC1 : call [CDirectSound_SetEffectData] + XREF_ENTRY(0x0C2, XREF_CDirectSound_SetEffectData), + + { 0x00, 0x55 }, + { 0x01, 0x8B }, + { 0x03, 0x81 }, +OOVPA_END; + +// ****************************************************************** +// * XWaveFileCreateMediaObjectEx +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(XWaveFileCreateMediaObjectEx, 5344, 10, + + XRefNoSaveIndex, + XRefZero) + + { 0x0D, 0x0B }, + { 0x1C, 0xF7 }, + { 0x2B, 0x07 }, + { 0x2F, 0x83 }, + { 0x41, 0x0A }, + { 0x45, 0x10 }, + { 0x58, 0x8B }, + { 0x63, 0x07 }, + { 0x6C, 0xC2 }, + { 0x6D, 0x0C }, +OOVPA_END; + +// ****************************************************************** +// * XFileCreateMediaObject +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(XFileCreateMediaObject, 5344, 10, + + XRefNoSaveIndex, + XRefZero) + + { 0x00, 0x55 }, + { 0x01, 0x8B }, + { 0x03, 0x56 }, + + { 0x34, 0x18 }, + { 0x37, 0x14 }, + { 0x3A, 0x10 }, + { 0x3D, 0x0C }, + { 0x40, 0x08 }, + + { 0x67, 0xC2 }, + { 0x68, 0x18 }, +OOVPA_END; + +// ****************************************************************** +// * CDirectSound_MapBufferData +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(CDirectSound_MapBufferData, 5344, 10, + + XREF_CDirectSound_MapBufferData, + XRefZero) + + { 0x00, 0x56 }, + { 0x0C, 0x00 }, + + { 0x2B, 0x08 }, + { 0x2E, 0x0C }, + + { 0x34, 0x83 }, + { 0x35, 0xC1 }, + { 0x36, 0x60 }, + + { 0x47, 0x18 }, + + { 0x66, 0xC2 }, + { 0x67, 0x10 }, +OOVPA_END; + +// ****************************************************************** +// * IDirectSound_MapBufferData +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(IDirectSound_MapBufferData, 5344, 1+6, + + XRefNoSaveIndex, + XRefOne) + + // IDirectSound_MapBufferData+0x1C : call [CDirectSound_MapBufferData] + XREF_ENTRY(0x01D, XREF_CDirectSound_MapBufferData), + + { 0x00, 0xFF }, + { 0x02, 0x24 }, + { 0x06, 0x24 }, + { 0x14, 0xF8 }, + { 0x21, 0xC2 }, + { 0x22, 0x10 }, +OOVPA_END; + +// ****************************************************************** +// * CDirectSound_UnmapBufferData +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(CDirectSound_UnmapBufferData, 5344, 10, + + XREF_CDirectSound_UnmapBufferData, + XRefZero) + + { 0x00, 0x56 }, + { 0x0C, 0x00 }, + + { 0x2B, 0x08 }, + { 0x2E, 0x0C }, + { 0x32, 0x0C }, + + { 0x33, 0x83 }, + { 0x34, 0xC1 }, + { 0x35, 0x60 }, + + { 0x4D, 0xC2 }, + { 0x4E, 0x08 }, +OOVPA_END; + +// ****************************************************************** +// * IDirectSound_UnmapBufferData +// ****************************************************************** +// Generic OOVPA as of ____? and newer +OOVPA_XREF(IDirectSound_UnmapBufferData, 5344, 1+6, + + XRefNoSaveIndex, + XRefOne) + + // IDirectSound_UmapBufferData+0x14 : call [CDirectSound_UnmapBufferData] + XREF_ENTRY(0x015, XREF_CDirectSound_UnmapBufferData), + + { 0x00, 0x8B }, + { 0x02, 0x24 }, + { 0x06, 0x24 }, + { 0x0C, 0xF8 }, + { 0x19, 0xC2 }, + { 0x1A, 0x08 }, +OOVPA_END; + // ****************************************************************** // * Rollback support signature(s) diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl index 65644bb6f..4b1625e93 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5558.inl @@ -640,22 +640,6 @@ OOVPA_XREF(CDirectSoundStream_Use3DVoiceData, 5558, 1+8, { 0x4E, 0x08 }, OOVPA_END; -// ****************************************************************** -// * IDirectSoundStream_Set3DVoiceData -// ****************************************************************** -// Generic OOVPA as of ____? and newer (note: is not introduced in 5344) -OOVPA_XREF(IDirectSoundStream_Set3DVoiceData, 5558, 1+1, - - XRefNoSaveIndex, - XRefOne) - - // IDirectSoundStream_Set3DVoiceData+0x00 : jmp [CDirectSoundStream_Set3DVoiceData] - XREF_ENTRY(0x01, XREF_CDirectSoundStream_Set3DVoiceData), - - // IDirectSoundStream_Set3DVoiceData+0x00 : jmp 0x........ - { 0x00, 0xE9 }, -OOVPA_END; - // ****************************************************************** // * IDirectSoundStream_Use3DVoiceData // ****************************************************************** @@ -671,3 +655,99 @@ OOVPA_XREF(IDirectSoundStream_Use3DVoiceData, 5558, 1+1, // IDirectSoundStream_Use3DVoiceData+0x00 : jmp 0x........ { 0x00, 0xE9 }, OOVPA_END; + +// ****************************************************************** +// * DirectSound::CDirectSoundVoice::Set3DVoiceData +// ****************************************************************** +OOVPA_XREF(CDirectSoundVoice_Set3DVoiceData, 5558, 9, + + XREF_CDirectSoundVoice_Set3DVoiceData, + XRefZero) + + { 0x00, 0x8B }, + { 0x04, 0x8B }, + + { 0x28, 0x01 }, + { 0x3C, 0x02 }, + { 0x50, 0x04 }, + { 0x73, 0x08 }, + { 0x96, 0x10 }, + { 0xB9, 0x20 }, + { 0xCD, 0x40 }, +OOVPA_END; + +// ****************************************************************** +// * DirectSound::CDirectSoundBuffer::Set3DVoiceData +// ****************************************************************** +OOVPA_XREF(CDirectSoundBuffer_Set3DVoiceData, 5558, 1+8, + + XREF_CDirectSoundBuffer_Set3DVoiceData, + XRefOne) + + XREF_ENTRY( 0x32, XREF_CDirectSoundVoice_Set3DVoiceData ), + + { 0x00, 0x56 }, + { 0x11, 0x16 }, + { 0x16, 0x68 }, + { 0x36, 0x85 }, + { 0x3A, 0x74 }, + { 0x3C, 0x68 }, + { 0x4B, 0xC2 }, + { 0x4C, 0x08 }, +OOVPA_END; + +// ****************************************************************** +// * IDirectSoundBuffer::Set3DVoiceData +// ****************************************************************** +OOVPA_XREF(IDirectSoundBuffer_Set3DVoiceData, 5558, 1+8, + + XRefNoSaveIndex, + XRefOne) + + XREF_ENTRY( 0x15, XREF_CDirectSoundBuffer_Set3DVoiceData ), + + { 0x06, 0x24 }, + { 0x08, 0x8B }, + { 0x0C, 0xE4 }, + { 0x0E, 0xD9 }, + { 0x11, 0x23 }, + { 0x14, 0xE8 }, + { 0x19, 0xC2 }, + { 0x1A, 0x08 }, +OOVPA_END; + +// ****************************************************************** +// * DirectSound::CDirectSoundStream::Set3DVoiceData +// ****************************************************************** +OOVPA_XREF(CDirectSoundStream_Set3DVoiceData, 5558, 1+8, + + XREF_CDirectSoundStream_Set3DVoiceData, + XRefOne) + + XREF_ENTRY( 0x36, XREF_CDirectSoundVoice_Set3DVoiceData ), + + { 0x00, 0x56 }, + { 0x11, 0x16 }, + { 0x16, 0x68 }, + { 0x35, 0xE8 }, + { 0x3E, 0x74 }, + { 0x40, 0x68 }, + { 0x4F, 0xC2 }, + { 0x50, 0x08 }, +OOVPA_END; + +// ****************************************************************** +// * IDirectSoundStream_Set3DVoiceData +// ****************************************************************** +// Generic OOVPA as of ____? and newer (note: is not introduced in 5344) +OOVPA_XREF(IDirectSoundStream_Set3DVoiceData, 5558, 1+1, + + XRefNoSaveIndex, + XRefOne) + + // IDirectSoundStream_Set3DVoiceData+0x00 : jmp [CDirectSoundStream_Set3DVoiceData] + XREF_ENTRY(0x01, XREF_CDirectSoundStream_Set3DVoiceData), + + // IDirectSoundStream_Set3DVoiceData+0x00 : jmp 0x........ + { 0x00, 0xE9 }, +OOVPA_END; diff --git a/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl b/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl index c2d12ab7e..a0d8c1a96 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.OOVPA.inl @@ -263,6 +263,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundVoiceSettings_SetMixBinVolumes, XREF, 4039, 4134), REGISTER_OOVPAS(CDirectSoundVoice_CommitDeferredSettings, XREF, 5455), REGISTER_OOVPAS(CDirectSoundVoice_GetVoiceProperties, XREF, 5344), + REGISTER_OOVPAS(CDirectSoundVoice_Set3DVoiceData, XREF, 5558), REGISTER_OOVPAS(CDirectSoundVoice_SetAllParameters, XREF, 3911, 4039, 4134, 5344, 5558), REGISTER_OOVPAS(CDirectSoundVoice_SetConeAngles, XREF, 3911, 4039, 4134, 5344), REGISTER_OOVPAS(CDirectSoundVoice_SetConeOrientation, XREF, 3911, 4039, 4134, 5344), @@ -301,6 +302,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundBuffer_PauseEx, XREF, 5344), REGISTER_OOVPAS(CDirectSoundBuffer_Play, XREF, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_PlayEx, XREF, 3911, 4361), + REGISTER_OOVPAS(CDirectSoundBuffer_Set3DVoiceData, XREF, 5558), REGISTER_OOVPAS(CDirectSoundBuffer_SetAllParameters, XREF, 4039, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_SetBufferData, XREF, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundBuffer_SetConeAngles, XREF, 4039, 4134), @@ -345,6 +347,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSoundStream_PauseEx, PATCH, 5344), REGISTER_OOVPAS(CDirectSoundStream_Process, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_Release, PATCH, 3911, 4039, 4134), + REGISTER_OOVPAS(CDirectSoundStream_Set3DVoiceData, XREF, 5558), REGISTER_OOVPAS(CDirectSoundStream_SetAllParameters, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_SetConeAngles, PATCH, 3911, 4039, 4134), REGISTER_OOVPAS(CDirectSoundStream_SetConeOrientation, PATCH, 3911, 4039, 4134), @@ -384,6 +387,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSound_GetOutputLevels, XREF, 4627), REGISTER_OOVPAS(CDirectSound_GetSpeakerConfig, PATCH, 3911, 4627, 5455), REGISTER_OOVPAS(CDirectSound_GetTime, XREF, 3911), + REGISTER_OOVPAS(CDirectSound_MapBufferData, XREF, 5344), REGISTER_OOVPAS(CDirectSound_SetAllParameters, XREF, 3911, 4134, 4831, 5558), //TODO: Need to improvise after 4134 REGISTER_OOVPAS(CDirectSound_SetAllParametersA, XREF, 4627, 4721, 4831), //TODO: Need to improvise after 4134 then move in CDirectSound_SetAllParameters REGISTER_OOVPAS(CDirectSound_SetDistanceFactor, XREF, 3911, 4039, 4134, 4627, 5344), @@ -396,6 +400,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(CDirectSound_SetRolloffFactor, XREF, 3911, 4039, 4134, 5344), REGISTER_OOVPAS(CDirectSound_SetVelocity, XREF, 3911, 4039, 4134, 4627, 5344), REGISTER_OOVPAS(CDirectSound_SynchPlayback, XREF, 5233, 5344), + REGISTER_OOVPAS(CDirectSound_UnmapBufferData, XREF, 5344), REGISTER_OOVPAS(IDirectSound3DCalculator_Calculate3D, UNPATCHED, 5344), // jmp only REGISTER_OOVPAS(IDirectSound3DCalculator_GetMixBinVolumes, UNPATCHED, 5344), // jmp only REGISTER_OOVPAS(IDirectSound3DCalculator_GetPanData, PATCH, 5344), @@ -410,6 +415,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(IDirectSoundBuffer_Play, PATCH, 3911), REGISTER_OOVPAS(IDirectSoundBuffer_PlayEx, PATCH, 3911), REGISTER_OOVPAS(IDirectSoundBuffer_Release, PATCH, 3911), + REGISTER_OOVPAS(IDirectSoundBuffer_Set3DVoiceData, PATCH, 5558), REGISTER_OOVPAS(IDirectSoundBuffer_SetAllParameters, PATCH, 3911, 4039), REGISTER_OOVPAS(IDirectSoundBuffer_SetBufferData, PATCH, 3911), REGISTER_OOVPAS(IDirectSoundBuffer_SetConeAngles, PATCH, 3911, 4039), @@ -488,6 +494,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(IDirectSound_GetOutputLevels, PATCH, 4627), REGISTER_OOVPAS(IDirectSound_GetSpeakerConfig, PATCH, 3911), REGISTER_OOVPAS(IDirectSound_GetTime, UNPATCHED, 3911), + REGISTER_OOVPAS(IDirectSound_MapBufferData, PATCH, 5344), REGISTER_OOVPAS(IDirectSound_Release, PATCH, 3911), REGISTER_OOVPAS(IDirectSound_SetAllParameters, PATCH, 3911), REGISTER_OOVPAS(IDirectSound_SetDistanceFactor, PATCH, 3911 /*, 4134*/), @@ -500,6 +507,7 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(IDirectSound_SetRolloffFactor, PATCH, 3911/*, 4134, 5344*/), REGISTER_OOVPAS(IDirectSound_SetVelocity, PATCH, 3911), REGISTER_OOVPAS(IDirectSound_SynchPlayback, PATCH, 5233), + REGISTER_OOVPAS(IDirectSound_UnmapBufferData, PATCH, 5344), REGISTER_OOVPAS(CFullHRTFSource_GetCenterVolume, XREF, 4039, 4134, 5558), REGISTER_OOVPAS(CHRTFSource_SetFullHRTF5Channel, XREF, 4039, 5344 /*5558*/), // 5558 is currently not in used since OOVPA 5344 is generic. @@ -519,12 +527,15 @@ OOVPATable DSound_OOVPAV2[] = { REGISTER_OOVPAS(WaveFormat_CreateXboxAdpcmFormat, XREF, 5344), REGISTER_OOVPAS(XAudioDownloadEffectsImage, PATCH, 4361), + REGISTER_OOVPAS(XAudioSetEffectData, PATCH, 5344), REGISTER_OOVPAS(IsValidFormat, UNPATCHED, 3911), REGISTER_OOVPAS(XAudioCreatePcmFormat, UNPATCHED, 3911), REGISTER_OOVPAS(XAudioCreateAdpcmFormat, PATCH, 3911, 5344), + REGISTER_OOVPAS(XFileCreateMediaObject, PATCH, 5344), REGISTER_OOVPAS(XFileCreateMediaObjectAsync, PATCH, 5344), REGISTER_OOVPAS(XFileCreateMediaObjectEx, PATCH, 4627, 5028), REGISTER_OOVPAS(XWaveFileCreateMediaObject, PATCH, 4627), + REGISTER_OOVPAS(XWaveFileCreateMediaObjectEx, PATCH, 5344), REGISTER_OOVPAS(DSound_CMemoryManager_PoolAlloc, XREF, 4134, 5455), // For reference purpose only, does not have XREF value. };