From 2627fb142c98330ae4f743f180dd73b91d598455 Mon Sep 17 00:00:00 2001 From: sopskrutt <> Date: Wed, 24 Mar 2004 21:01:20 +0000 Subject: [PATCH] SetFormat --- Include/Win32/CxbxKrnl/EmuDSound.h | 9 ++ Include/Win32/CxbxKrnl/HLEDataBase.h | 2 + Source/Win32/CxbxKrnl/EmuDSound.cpp | 28 ++++++ Source/Win32/CxbxKrnl/HLEDataBase.cpp | 2 + .../CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl | 99 +++++++++++++++++++ 5 files changed, 140 insertions(+) diff --git a/Include/Win32/CxbxKrnl/EmuDSound.h b/Include/Win32/CxbxKrnl/EmuDSound.h index e8579f2d8..652d224c8 100644 --- a/Include/Win32/CxbxKrnl/EmuDSound.h +++ b/Include/Win32/CxbxKrnl/EmuDSound.h @@ -827,4 +827,13 @@ HRESULT WINAPI EmuIDirectSoundBuffer8_SetI3DL2Source ); // +s +// ****************************************************************** +// * func: EmuIDirectSoundBuffer8_SetFormat +// ****************************************************************** +HRESULT WINAPI EmuIDirectSoundBuffer8_SetFormat +( + X_CDirectSoundBuffer *pBuffer, + LPCWAVEFORMATEX pwfxFormat +); + #endif diff --git a/Include/Win32/CxbxKrnl/HLEDataBase.h b/Include/Win32/CxbxKrnl/HLEDataBase.h index d12f482f4..1acf06187 100644 --- a/Include/Win32/CxbxKrnl/HLEDataBase.h +++ b/Include/Win32/CxbxKrnl/HLEDataBase.h @@ -213,6 +213,8 @@ enum XRefDataBaseOffset XREF_DSBUFFERSETVELOCITY, XREF_DSBUFFERSETDOPPLERFACTOR, XREF_DSBUFFERSETI3DL2SOURCE, + XREF_DirectSound_CDirectSoundVoice_SetFormat, + XREF_DirectSound_CDirectSoundBuffer_SetFormat, // XAPI /* not necessary? XREF_XAPIXCALCULATESIGNATUREBEGINEX diff --git a/Source/Win32/CxbxKrnl/EmuDSound.cpp b/Source/Win32/CxbxKrnl/EmuDSound.cpp index 412c40c0c..b5910beb6 100644 --- a/Source/Win32/CxbxKrnl/EmuDSound.cpp +++ b/Source/Win32/CxbxKrnl/EmuDSound.cpp @@ -2381,3 +2381,31 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetI3DL2Source return DS_OK; } // +s +// ****************************************************************** +// * func: EmuIDirectSoundBuffer8_SetFormat +// ****************************************************************** +HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetFormat +( + X_CDirectSoundBuffer *pBuffer, + LPCWAVEFORMATEX pwfxFormat +) +{ + EmuSwapFS(); // Win2k/XP FS + + // debug trace + #ifdef _DEBUG_TRACE + { + printf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetFormat\n" + "(\n" + " pBuffer : 0x%.08X\n" + " pwfxFormat : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), pBuffer,pwfxFormat); + } + #endif + + HRESULT hRet = D3D_OK; + + EmuSwapFS(); // XBox FS + return hRet; +} \ No newline at end of file diff --git a/Source/Win32/CxbxKrnl/HLEDataBase.cpp b/Source/Win32/CxbxKrnl/HLEDataBase.cpp index efe60da9f..15cd95298 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase.cpp +++ b/Source/Win32/CxbxKrnl/HLEDataBase.cpp @@ -334,6 +334,8 @@ extern uint32 XRefDataBase[] = -1, // XREF_DSBUFFERSETVELOCITY -1, // XREF_DSBUFFERSETDOPPLERFACTOR -1, // XREF_DSBUFFERSETI3DL2SOURCE + -1, // XREF_DirectSound_CDirectSoundVoice_SetFormat + -1, // XREF_DirectSound_CDirectSoundBuffer_SetFormat /* not necessary? -1, //XREF_XAPIXCALCULATESIGNATUREBEGINEX //*/ diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl index 5a9438f31..296afe620 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl @@ -1775,6 +1775,77 @@ SOOVPA<11> IDirectSoundBuffer_Stop_1_0_4627 = }; // +s +// ****************************************************************** +// * DirectSound::CDirectSoundVoice::SetFormat +// ****************************************************************** +SOOVPA<8> X_DirectSound_CDirectSoundVoice_SetFormat_1_0_4627 = +{ + 0, // Large == 0 + 8, // Count == 8 + + XREF_DirectSound_CDirectSoundVoice_SetFormat, // Xref Is Saved + 0, // Xref Not Used + + { + { 0x07, 0x4E }, + { 0x10, 0xE8 }, + { 0x19, 0xD8 }, + { 0x22, 0xFF }, + { 0x2B, 0x0C }, + { 0x34, 0xFF }, + { 0x3F, 0x8B }, + { 0x46, 0x00 }, + } +}; + +// ****************************************************************** +// * DirectSound::CDirectSoundBuffer::SetFormat +// ****************************************************************** +SOOVPA<8> X_DirectSound_CDirectSoundBuffer_SetFormat_1_0_4627 = +{ + 0, // Large == 0 + 8, // Count == 8 + + XREF_DirectSound_CDirectSoundBuffer_SetFormat, // Xref Is Saved + 1, // Xref Is Used + + { + { 0x32, XREF_DirectSound_CDirectSoundVoice_SetFormat }, + + { 0x0C, 0x00 }, + { 0x12, 0x85 }, + { 0x1C, 0x15 }, + { 0x26, 0xEB }, + { 0x30, 0x10 }, + { 0x3A, 0x74 }, + { 0x47, 0x8B }, + } +}; + +// ****************************************************************** +// * IDirectSoundBuffer_SetFormat +// ****************************************************************** +SOOVPA<8> X_IDirectSoundBuffer_SetFormat_1_0_4627 = +{ + 0, // Large == 0 + 8, // Count == 8 + + -1, // Xref Not Saved + 1, // Xref Is Used + + { + { 0x15, XREF_DirectSound_CDirectSoundBuffer_SetFormat }, + + { 0x02, 0x24 }, + { 0x06, 0x24 }, + { 0x0A, 0x83 }, + { 0x0E, 0xD9 }, + { 0x12, 0xC8 }, + { 0x19, 0xC2 }, + { 0x1A, 0x08 }, + } +}; + // ****************************************************************** // * Direct_1_0_4627 // ****************************************************************** @@ -2580,6 +2651,34 @@ OOVPATable DSound_1_0_4627[] = #endif }, // +s + // DirectSound::CDirectSoundVoice::SetFormat (XREF) + { + (OOVPA*)&X_DirectSound_CDirectSoundVoice_SetFormat_1_0_4627, + 0, + + #ifdef _DEBUG_TRACE + "DirectSound::CDirectSoundVoice::SetFormat (XREF)" + #endif + }, + // DirectSound::CDirectSoundBuffer::SetFormat (XREF) + { + (OOVPA*)&X_DirectSound_CDirectSoundBuffer_SetFormat_1_0_4627, + 0, + + #ifdef _DEBUG_TRACE + "DirectSound::CDirectSoundBuffer::SetFormat (XREF)" + #endif + }, + // IDirectSoundBuffer_SetFormat + { + (OOVPA*)&X_IDirectSoundBuffer_SetFormat_1_0_4627, + XTL::EmuIDirectSoundBuffer8_SetFormat, + + #ifdef _DEBUG_TRACE + "IDirectSoundBuffer_SetFormat" + #endif + + }, }; // ******************************************************************