From a33719afa4304ef1cdf9205a366d5292229692a6 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 19 Feb 2004 06:49:54 +0000 Subject: [PATCH] progressing antz --- Cxbx.opt | Bin 64512 -> 60928 bytes Include/Win32/CxbxKrnl/EmuD3D8.h | 12 + Source/Win32/CxbxKrnl/EmuD3D8.cpp | 71 +++++- Source/Win32/CxbxKrnl/EmuDSound.cpp | 2 +- .../CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl | 84 +++++++ .../CxbxKrnl/HLEDataBase/DSound.1.0.4432.inl | 212 ++++++++++++++++++ .../CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl | 168 +------------- 7 files changed, 387 insertions(+), 162 deletions(-) diff --git a/Cxbx.opt b/Cxbx.opt index 1dba1412c447e0376151c870447f2ba484b2c24d..832865be238b824a263617d5094831cd4e858195 100644 GIT binary patch literal 60928 zcmeHQYiu0V6~1R?>^M&1IEnKnWJ2DAguEP_2O+T?6B9czb`l3LB;(z&y?A$Lncam= zD@sBO0Yn1fjS3Z&+6HK=5~&rBP!*|__|XRye=1&50<;pLQdI#})dJ~vXLhdF!8_Sd zS|C1i_3g}=d+uYtnO$4oz4y!?Um17&`$wmp5T|YHg)TllHByupoF^Phcw4nV{;5;) zIM~Z$oZ{_k#K0%$tBL!j0|rnA$a_8lr~pO+mB1)K-sdscR{>)IJOW}IFdmoy)BqC! z={FhsDZo@<8ZaF=510X*56lFlUn}+(0JDKPz+7M+FdtX|ECenDr0+%8F9wzX7XwRy zWx#S^1+Ws3eygy*1gHa618ab_z&hYkU_EddumO<%_1HH6jld?L3Ah~C3^W5*09$|- zK>AB;!*LsMCD0CZ0Na5bz)qkOkbYNTe>HFo&;?uzTnFq1_5c$0UPK6dVxM5 z23!yH1JW;neG+hh6mSFJ0%;%vWC7_{>eh~$9F#P1dt6SO6to3L%q z!^WIn{NvXo`xp3iqIDNnm&VmtB7*BT!DR-=8IOy=uh`xc8p&r>KD)9X#rz7-YtoPp zE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-aJUC4V zdfOOFr<`=GF#iGMPijtP>|Wb78;9iOLAX>0E~j7AL$Z9Ei-Nd&c66w__X%98{3|}a zbS>eLXl!XQw>lZKN#5Gv;_8tzRpvA&(O+==4ewbpn=CY>yuKw8FIBfX(JU_gGgaJz z%n5jrVZ@GR-68TTWWNGxHseW&`wBQ7*GM{Xd~$0n;yP)kCu24&TJ%|F;U)~Aywl1= z`j!O;%Y%az!NE!)=Hs%~lf1V7Uw~=W|5*QH{ZD>Nd1D5c0cL<1Uwi*@V*Sq-a#{Z?{uVZl|7t^#Pe%3@tRv?5ufzAhXufi0 dfEi#0m;q*h8DIv!J`Aw_$NC@Zf5TV*`wzDPC4&F} delta 1177 zcmb7@%}*0S7{+J2yW>g`88r7!THGC?uOyG&K3mbl&&LGxNSP>wJ@)pYn#|lX~d6 zZ*l5(wOYN-80!X65Cd_L05`x*a0>`s0dpTnf_^Xn2Eh;*1|wh;2<-nTBiwfJv23s26BQ8Pm8oV5>tEk49)m4M}kd@b%-OlJMb-XwK|!v9p3qj5hRnd&)DM;jI_Cj%o@_ zg+!$JHL*pIe#N#!YG-0_r0Z0oXzK+tYlP$aoNnfIGdJx@iE5LmzSLb|D2%b@PSdi( zIm@&QmSO1muG9Ie>1?)Ond!NLHKXV3`E;&$zsL@WYa%&YFpZ-bmFjm;gwxSn{%)d& zC#Ma4zSf09dLet8QBI|0<}k__t@Jq+Xz+(0H2S5!vFvP diff --git a/Include/Win32/CxbxKrnl/EmuD3D8.h b/Include/Win32/CxbxKrnl/EmuD3D8.h index 82d59dc94..134ab5edd 100644 --- a/Include/Win32/CxbxKrnl/EmuD3D8.h +++ b/Include/Win32/CxbxKrnl/EmuD3D8.h @@ -1138,6 +1138,18 @@ VOID WINAPI EmuIDirect3DDevice8_DrawIndexedVertices CONST PWORD pIndexData ); +// ****************************************************************** +// * func: EmuIDirect3DDevice8_DrawIndexedVerticesUP +// ****************************************************************** +VOID WINAPI EmuIDirect3DDevice8_DrawIndexedVerticesUP +( + X_D3DPRIMITIVETYPE PrimitiveType, + UINT VertexCount, + CONST PVOID pIndexData, + CONST PVOID pVertexStreamZeroData, + UINT VertexStreamZeroStride +); + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetLight // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/EmuD3D8.cpp b/Source/Win32/CxbxKrnl/EmuD3D8.cpp index 8baaeeddd..985b85b2c 100644 --- a/Source/Win32/CxbxKrnl/EmuD3D8.cpp +++ b/Source/Win32/CxbxKrnl/EmuD3D8.cpp @@ -4840,7 +4840,7 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_UpdateOverlay int h = g_dwOverlayH; // TODO: sucker the game into rendering directly to the overlay (speed boost) - if(ddsd2.lPitch == w*2 && g_dwOverlayP == w*2) + if( (ddsd2.lPitch == w*2) && ((int)g_dwOverlayP == w*2) ) memcpy(pDest, pSour, h*w*2); else { @@ -6587,6 +6587,75 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_DrawIndexedVertices return; } +// ****************************************************************** +// * func: EmuIDirect3DDevice8_DrawIndexedVerticesUP +// ****************************************************************** +VOID WINAPI XTL::EmuIDirect3DDevice8_DrawIndexedVerticesUP +( + X_D3DPRIMITIVETYPE PrimitiveType, + UINT VertexCount, + CONST PVOID pIndexData, + CONST PVOID pVertexStreamZeroData, + UINT VertexStreamZeroStride +) +{ + EmuSwapFS(); // Win2k/XP FS + + // debug trace + #ifdef _DEBUG_TRACE + { + printf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_DrawIndexedVerticesUP\n" + "(\n" + " PrimitiveType : 0x%.08X\n" + " VertexCount : 0x%.08X\n" + " pIndexData : 0x%.08X\n" + " pVertexStreamZeroData : 0x%.08X\n" + " VertexStreamZeroStride : 0x%.08X\n" + ");\n", + GetCurrentThreadId(), PrimitiveType, VertexCount, pIndexData, pVertexStreamZeroData, VertexStreamZeroStride); + } + + #endif + + // update index buffer, if necessary + if(g_pIndexBuffer != 0 && g_pIndexBuffer->Lock == X_D3DRESOURCE_LOCK_FLAG_NOSIZE) + EmuCleanup("g_pIndexBuffer != 0"); + + EmuUpdateDeferredStates(); + + if((DWORD)PrimitiveType == 0x08 || (DWORD)PrimitiveType == 0x09 || (DWORD)PrimitiveType == 0x10) + EmuWarning("Unsupported PrimitiveType! (%d)", (DWORD)PrimitiveType); + + UINT PrimitiveCount = EmuD3DVertex2PrimitiveCount(PrimitiveType, VertexCount); + + // Convert from Xbox to PC enumeration + D3DPRIMITIVETYPE PCPrimitiveType = EmuPrimitiveType(PrimitiveType); + + IDirect3DVertexBuffer8 *pOrigVertexBuffer8 = 0; + IDirect3DVertexBuffer8 *pHackVertexBuffer8 = 0; + + PVOID pNewVertexStreamZeroData = pVertexStreamZeroData; + + uint32 nStride = EmuFixupVerticesA(PrimitiveType, PrimitiveCount, pOrigVertexBuffer8, pHackVertexBuffer8, 0, pVertexStreamZeroData, VertexStreamZeroStride, &pNewVertexStreamZeroData); + + g_pD3DDevice8->DrawIndexedPrimitiveUP + ( + PCPrimitiveType, 0, VertexCount, PrimitiveCount, pIndexData, D3DFMT_INDEX16, pNewVertexStreamZeroData, VertexStreamZeroStride + ); + + if(nStride != -1) + { + EmuFixupVerticesB(nStride, pOrigVertexBuffer8, pHackVertexBuffer8); + + if(pNewVertexStreamZeroData != 0) + free(pNewVertexStreamZeroData); + } + + EmuSwapFS(); // XBox FS + + return; +} + // ****************************************************************** // * func: EmuIDirect3DDevice8_SetLight // ****************************************************************** diff --git a/Source/Win32/CxbxKrnl/EmuDSound.cpp b/Source/Win32/CxbxKrnl/EmuDSound.cpp index 11c692068..26888ad5c 100644 --- a/Source/Win32/CxbxKrnl/EmuDSound.cpp +++ b/Source/Win32/CxbxKrnl/EmuDSound.cpp @@ -145,7 +145,7 @@ static void HackUpdateSoundStreams() // resize an emulated directsound buffer, if necessary static void EmuResizeIDirectSoundBuffer8(XTL::X_CDirectSoundBuffer *pThis, DWORD dwBytes) { - if(dwBytes == pThis->EmuBufferDesc->dwBufferBytes) + if(dwBytes == pThis->EmuBufferDesc->dwBufferBytes || dwBytes == 0) return; #ifdef _DEBUG_TRACE diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl index fb1e8e5d4..032439751 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/D3D8.1.0.4432.inl @@ -1060,6 +1060,70 @@ SOOVPA<11> IDirect3DDevice8_BlockUntilVerticalBlank_1_0_4432 = } }; +// ****************************************************************** +// * IDirect3DDevice8_SetVerticalBlankCallback +// ****************************************************************** +SOOVPA<12> IDirect3DDevice8_SetVerticalBlankCallback_1_0_4432 = +{ + 0, // Large == 0 + 12, // Count == 12 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_SetVerticalBlankCallback+0x00 : mov eax, [esp+0x04] + { 0x00, 0x8B }, // (Offset,Value)-Pair #1 + { 0x01, 0x44 }, // (Offset,Value)-Pair #2 + { 0x02, 0x24 }, // (Offset,Value)-Pair #3 + { 0x03, 0x04 }, // (Offset,Value)-Pair #4 + + // IDirect3DDevice8_SetVerticalBlankCallback+0x04 : mov ecx, [addr] + { 0x04, 0x8B }, // (Offset,Value)-Pair #5 + { 0x05, 0x0D }, // (Offset,Value)-Pair #6 + + // IDirect3DDevice8_SetVerticalBlankCallback+0x0A : mov [ecx+0x2444], eax + { 0x0A, 0x89 }, // (Offset,Value)-Pair #7 + { 0x0B, 0x81 }, // (Offset,Value)-Pair #8 + { 0x0C, 0x44 }, // (Offset,Value)-Pair #9 + { 0x0D, 0x24 }, // (Offset,Value)-Pair #10 + + // IDirect3DDevice8_SetVerticalBlankCallback+0x10 : retn 0x04 + { 0x10, 0xC2 }, // (Offset,Value)-Pair #11 + { 0x11, 0x04 }, // (Offset,Value)-Pair #12 + } +}; + +// ****************************************************************** +// * IDirect3DDevice8_DrawIndexedVerticesUP +// ****************************************************************** +SOOVPA<10> IDirect3DDevice8_DrawIndexedVerticesUP_1_0_4432 = +{ + 0, // Large == 0 + 10, // Count == 10 + + -1, // XRef Not Saved + 0, // XRef Not Used + + { + // IDirect3DDevice8_DrawIndexedVerticesUP+0x4A : or edx, 0x800 + { 0x4A, 0x81 }, // (Offset,Value)-Pair #1 + { 0x4B, 0xCA }, // (Offset,Value)-Pair #2 + { 0x4C, 0x00 }, // (Offset,Value)-Pair #3 + { 0x4D, 0x08 }, // (Offset,Value)-Pair #4 + + // IDirect3DDevice8_DrawIndexedVerticesUP+0x5C : lea edx, [edi+0x6C4] + { 0x5C, 0x8D }, // (Offset,Value)-Pair #5 + { 0x5D, 0x97 }, // (Offset,Value)-Pair #6 + { 0x5E, 0xC4 }, // (Offset,Value)-Pair #7 + { 0x5F, 0x06 }, // (Offset,Value)-Pair #8 + + // IDirect3DDevice8_DrawIndexedVerticesUP+0x6A : mov eax, 0x10 + { 0x6A, 0xB8 }, // (Offset,Value)-Pair #9 + { 0x6B, 0x10 }, // (Offset,Value)-Pair #10 + } +}; + // ****************************************************************** // * IDirect3DTexture8_GetSurfaceLevel // ****************************************************************** @@ -1677,6 +1741,26 @@ OOVPATable D3D8_1_0_4432[] = "EmuIDirect3DDevice8_BlockUntilVerticalBlank" #endif }, + // IDirect3DDevice8::SetVerticalBlankCallback + { + (OOVPA*)&IDirect3DDevice8_SetVerticalBlankCallback_1_0_4432, + + XTL::EmuIDirect3DDevice8_SetVerticalBlankCallback, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_SetVerticalBlankCallback" + #endif + }, + // IDirect3DDevice8::DrawIndexedVerticesUP + { + (OOVPA*)&IDirect3DDevice8_DrawIndexedVerticesUP_1_0_4432, + + XTL::EmuIDirect3DDevice8_DrawIndexedVerticesUP, + + #ifdef _DEBUG_TRACE + "EmuIDirect3DDevice8_DrawIndexedVerticesUP" + #endif + }, // IDirect3DDevice8::SetStreamSource (* unchanged since 4361 *) { (OOVPA*)&IDirect3DDevice8_SetStreamSource_1_0_4361, diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4432.inl b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4432.inl index 1de91c987..cdc589802 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4432.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4432.inl @@ -321,6 +321,158 @@ SOOVPA<12> IDirectSound8_SetI3DL2Listener_1_0_4432 = } }; +// ****************************************************************** +// * CDirectSoundVoiceSettings::SetMixBins +// ****************************************************************** +SOOVPA<10> CDirectSoundVoiceSettings_SetMixBins_1_0_4432 = +{ + 0, // Large == 0 + 10, // Count == 10 + + XREF_DSSETMIXBINSC, // XRef Is Saved + 0, // XRef Not Used + + { + // CDirectSoundVoiceSettings_SetMixBins+0x06 : jnz +0x1A + { 0x06, 0x75 }, // (Offset,Value)-Pair #1 + { 0x07, 0x1A }, // (Offset,Value)-Pair #2 + + // CDirectSoundVoiceSettings_SetMixBins+0x08 : test byte ptr [ecx+8], 0x10 + { 0x08, 0xF6 }, // (Offset,Value)-Pair #3 + { 0x09, 0x41 }, // (Offset,Value)-Pair #4 + { 0x0A, 0x08 }, // (Offset,Value)-Pair #5 + { 0x0B, 0x10 }, // (Offset,Value)-Pair #6 + + // CDirectSoundVoiceSettings_SetMixBins+0x2B : jbe +0x2B + { 0x2B, 0x76 }, // (Offset,Value)-Pair #7 + { 0x2C, 0x2B }, // (Offset,Value)-Pair #8 + + // CDirectSoundVoiceSettings_SetMixBins+0xB2 : retn 0x04 + { 0xB2, 0xC2 }, // (Offset,Value)-Pair #9 + { 0xB3, 0x04 }, // (Offset,Value)-Pair #10 + } +}; + +// ****************************************************************** +// * CDirectSoundVoice::SetMixBins +// ****************************************************************** +SOOVPA<17> CDirectSoundVoice_SetMixBins_1_0_4432 = +{ + 0, // Large == 0 + 17, // Count == 17 + + XREF_DSSETMIXBINSB, // XRef Is Saved + 1, // XRef Is Used + + { + // CDirectSoundVoice_SetMixBins+0x0D : call [CDirectSoundVoiceSettings::SetMixBins] + { 0x0D, XREF_DSSETMIXBINSC }, // (Offset,Value)-Pair #1 + + // CDirectSoundVoice_SetMixBins+0x01 : mov esi, [esp+8] + { 0x01, 0x8B }, // (Offset,Value)-Pair #2 + { 0x02, 0x74 }, // (Offset,Value)-Pair #3 + { 0x03, 0x24 }, // (Offset,Value)-Pair #4 + { 0x04, 0x08 }, // (Offset,Value)-Pair #5 + + // CDirectSoundVoice_SetMixBins+0x05 : push [esp+0x0C] + { 0x05, 0xFF }, // (Offset,Value)-Pair #6 + { 0x06, 0x74 }, // (Offset,Value)-Pair #7 + { 0x07, 0x24 }, // (Offset,Value)-Pair #8 + { 0x08, 0x0C }, // (Offset,Value)-Pair #9 + + // CDirectSoundVoice_SetMixBins+0x09 : mov ecx, [esi+0x10] + { 0x09, 0x8B }, // (Offset,Value)-Pair #10 + { 0x0A, 0x4E }, // (Offset,Value)-Pair #11 + { 0x0B, 0x10 }, // (Offset,Value)-Pair #12 + + // CDirectSoundVoice_SetMixBins+0x11 : mov ecx, [esi+0x0C] + { 0x11, 0x8B }, // (Offset,Value)-Pair #13 + { 0x12, 0x4E }, // (Offset,Value)-Pair #14 + { 0x13, 0x0C }, // (Offset,Value)-Pair #15 + + // CDirectSoundVoice_SetMixBins+0x1A : retn 0x08 + { 0x1A, 0xC2 }, // (Offset,Value)-Pair #16 + { 0x1B, 0x08 }, // (Offset,Value)-Pair #17 + } +}; + +// ****************************************************************** +// * CDirectSoundBuffer::SetMixBins +// ****************************************************************** +SOOVPA<17> CDirectSoundBuffer_SetMixBins_1_0_4432 = +{ + 0, // Large == 0 + 17, // Count == 17 + + XREF_DSSETMIXBINSA, // XRef Is Saved + 1, // XRef Not Used + + { + // CDirectSoundBuffer_SetMixBins+0x32 : call [CDirectSoundVoice::SetMixBins] + { 0x32, XREF_DSSETMIXBINSB }, // (Offset,Value)-Pair #1 + + // CDirectSoundBuffer_SetMixBins+0x21 : mov eax, 0x80004005 + { 0x21, 0xB8 }, // (Offset,Value)-Pair #2 + { 0x22, 0x05 }, // (Offset,Value)-Pair #3 + { 0x23, 0x40 }, // (Offset,Value)-Pair #4 + { 0x24, 0x00 }, // (Offset,Value)-Pair #5 + { 0x25, 0x80 }, // (Offset,Value)-Pair #6 + + // CDirectSoundBuffer_SetMixBins+0x29 : push [esp+0x10]; push [esp+0x10] + { 0x29, 0xFF }, // (Offset,Value)-Pair #7 + { 0x2A, 0x74 }, // (Offset,Value)-Pair #8 + { 0x2B, 0x24 }, // (Offset,Value)-Pair #9 + { 0x2C, 0x10 }, // (Offset,Value)-Pair #10 + { 0x2D, 0xFF }, // (Offset,Value)-Pair #11 + { 0x2E, 0x74 }, // (Offset,Value)-Pair #12 + { 0x2F, 0x24 }, // (Offset,Value)-Pair #13 + { 0x30, 0x10 }, // (Offset,Value)-Pair #14 + + // CDirectSoundBuffer_SetMixBins+0x49 : pop edi + { 0x49, 0x5F }, // (Offset,Value)-Pair #15 + + // CDirectSoundBuffer_SetMixBins+0x4B : retn 0x08 + { 0x4B, 0xC2 }, // (Offset,Value)-Pair #16 + { 0x4C, 0x08 }, // (Offset,Value)-Pair #17 + } +}; + +// ****************************************************************** +// * IDirectSoundBuffer8_SetMixBins +// ****************************************************************** +SOOVPA<12> IDirectSoundBuffer8_SetMixBins_1_0_4432 = +{ + 0, // Large == 0 + 12, // Count == 12 + + -1, // XRef Not Saved + 1, // XRef Is Used + + { + // IDirectSoundBuffer8_SetMixBins+0x15 : call [CDirectSoundBuffer::SetMixBins] + { 0x15, XREF_DSSETMIXBINSA }, // (Offset,Value)-Pair #1 + + // IDirectSoundBuffer8_SetMixBins+0x04 : push [esp+0x08] + { 0x04, 0xFF }, // (Offset,Value)-Pair #2 + { 0x05, 0x74 }, // (Offset,Value)-Pair #3 + { 0x06, 0x24 }, // (Offset,Value)-Pair #4 + { 0x07, 0x08 }, // (Offset,Value)-Pair #5 + + // IDirectSoundBuffer8_SetMixBins+0x0A : add eax, 0xFFFFFFE4 + { 0x0A, 0x83 }, // (Offset,Value)-Pair #6 + { 0x0B, 0xC0 }, // (Offset,Value)-Pair #7 + { 0x0C, 0xE4 }, // (Offset,Value)-Pair #8 + + // IDirectSoundBuffer8_SetMixBins+0x0F : sbb ecx, ecx + { 0x0F, 0x1B }, // (Offset,Value)-Pair #9 + { 0x10, 0xC9 }, // (Offset,Value)-Pair #10 + + // IDirectSoundBuffer8_SetMixBins+0x11 : and ecx, eax + { 0x11, 0x23 }, // (Offset,Value)-Pair #11 + { 0x12, 0xC8 }, // (Offset,Value)-Pair #12 + } +}; + // ****************************************************************** // * CDirectSound::CommitDeferredSettings // ****************************************************************** @@ -563,6 +715,32 @@ OOVPATable DSound_1_0_4432[] = "IDirectSoundBuffer8_SetCurrentPosition" #endif }, + // CMcpxBuffer::Stop (* unchanged since 4361 *) + { + (OOVPA*)&CMcpxBuffer_Stop_1_0_4361, 0, + + #ifdef _DEBUG_TRACE + "CMcpxBuffer_Stop (XREF)" + #endif + }, + // CDirectSoundBuffer::Stop (* unchanged since 4361 *) + { + (OOVPA*)&CDirectSoundBuffer_Stop_1_0_4361, 0, + + #ifdef _DEBUG_TRACE + "CDirectSoundBuffer_Stop (XREF)" + #endif + }, + // IDirectSoundBuffer8::Stop (* unchanged since 4361 *) + { + (OOVPA*)&IDirectSoundBuffer8_Stop_1_0_4361, + + XTL::EmuIDirectSoundBuffer8_Stop, + + #ifdef _DEBUG_TRACE + "IDirectSoundBuffer8_Stop" + #endif + }, // CDirectSoundVoice::SetMaxDistance (XREF) { (OOVPA*)&CDirectSoundVoice_SetMaxDistance_1_0_4432, 0, @@ -631,6 +809,40 @@ OOVPATable DSound_1_0_4432[] = "EmuIDirectSound8_SetI3DL2Listener" #endif }, + // CDirectSoundVoiceSettings_SetMixBins + { + (OOVPA*)&CDirectSoundVoiceSettings_SetMixBins_1_0_4432, 0, + + #ifdef _DEBUG_TRACE + "CDirectSoundVoiceSettings::SetMixBins (XREF)" + #endif + }, + // CDirectSoundVoice_SetMixBins + { + (OOVPA*)&CDirectSoundVoice_SetMixBins_1_0_4432, 0, + + #ifdef _DEBUG_TRACE + "CDirectSoundVoice::SetMixBins (XREF)" + #endif + }, + // CDirectSoundBuffer_SetMixBins + { + (OOVPA*)&CDirectSoundBuffer_SetMixBins_1_0_4432, 0, + + #ifdef _DEBUG_TRACE + "CDirectSoundBuffer::SetMixBins (XREF)" + #endif + }, + // IDirectSoundBuffer8_SetMixBins + { + (OOVPA*)&IDirectSoundBuffer8_SetMixBins_1_0_4432, + + XTL::EmuIDirectSoundBuffer8_SetMixBins, + + #ifdef _DEBUG_TRACE + "EmuIDirectSoundBuffer8_SetMixBins" + #endif + }, // CDirectSound::CommitDeferredSettings { (OOVPA*)&CDirectSound_CommitDeferredSettings_1_0_4432, diff --git a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl index c7a4e2acc..5a9438f31 100644 --- a/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl +++ b/Source/Win32/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl @@ -179,158 +179,6 @@ SOOVPA<15> CDirectSound_SetVelocity_1_0_4627 = } }; -// ****************************************************************** -// * CDirectSoundVoiceSettings::SetMixBins -// ****************************************************************** -SOOVPA<10> CDirectSoundVoiceSettings_SetMixBins_1_0_4627 = -{ - 0, // Large == 0 - 10, // Count == 10 - - XREF_DSSETMIXBINSC, // XRef Is Saved - 0, // XRef Not Used - - { - // CDirectSoundVoiceSettings_SetMixBins+0x06 : jnz +0x1A - { 0x06, 0x75 }, // (Offset,Value)-Pair #1 - { 0x07, 0x1A }, // (Offset,Value)-Pair #2 - - // CDirectSoundVoiceSettings_SetMixBins+0x08 : test byte ptr [ecx+8], 0x10 - { 0x08, 0xF6 }, // (Offset,Value)-Pair #3 - { 0x09, 0x41 }, // (Offset,Value)-Pair #4 - { 0x0A, 0x08 }, // (Offset,Value)-Pair #5 - { 0x0B, 0x10 }, // (Offset,Value)-Pair #6 - - // CDirectSoundVoiceSettings_SetMixBins+0x2B : jbe +0x2B - { 0x2B, 0x76 }, // (Offset,Value)-Pair #7 - { 0x2C, 0x2B }, // (Offset,Value)-Pair #8 - - // CDirectSoundVoiceSettings_SetMixBins+0xB2 : retn 0x04 - { 0xB2, 0xC2 }, // (Offset,Value)-Pair #9 - { 0xB3, 0x04 }, // (Offset,Value)-Pair #10 - } -}; - -// ****************************************************************** -// * CDirectSoundVoice::SetMixBins -// ****************************************************************** -SOOVPA<17> CDirectSoundVoice_SetMixBins_1_0_4627 = -{ - 0, // Large == 0 - 17, // Count == 17 - - XREF_DSSETMIXBINSB, // XRef Is Saved - 1, // XRef Is Used - - { - // CDirectSoundVoice_SetMixBins+0x0D : call [CDirectSoundVoiceSettings::SetMixBins] - { 0x0D, XREF_DSSETMIXBINSC }, // (Offset,Value)-Pair #1 - - // CDirectSoundVoice_SetMixBins+0x01 : mov esi, [esp+8] - { 0x01, 0x8B }, // (Offset,Value)-Pair #2 - { 0x02, 0x74 }, // (Offset,Value)-Pair #3 - { 0x03, 0x24 }, // (Offset,Value)-Pair #4 - { 0x04, 0x08 }, // (Offset,Value)-Pair #5 - - // CDirectSoundVoice_SetMixBins+0x05 : push [esp+0x0C] - { 0x05, 0xFF }, // (Offset,Value)-Pair #6 - { 0x06, 0x74 }, // (Offset,Value)-Pair #7 - { 0x07, 0x24 }, // (Offset,Value)-Pair #8 - { 0x08, 0x0C }, // (Offset,Value)-Pair #9 - - // CDirectSoundVoice_SetMixBins+0x09 : mov ecx, [esi+0x10] - { 0x09, 0x8B }, // (Offset,Value)-Pair #10 - { 0x0A, 0x4E }, // (Offset,Value)-Pair #11 - { 0x0B, 0x10 }, // (Offset,Value)-Pair #12 - - // CDirectSoundVoice_SetMixBins+0x11 : mov ecx, [esi+0x0C] - { 0x11, 0x8B }, // (Offset,Value)-Pair #13 - { 0x12, 0x4E }, // (Offset,Value)-Pair #14 - { 0x13, 0x0C }, // (Offset,Value)-Pair #15 - - // CDirectSoundVoice_SetMixBins+0x1A : retn 0x08 - { 0x1A, 0xC2 }, // (Offset,Value)-Pair #16 - { 0x1B, 0x08 }, // (Offset,Value)-Pair #17 - } -}; - -// ****************************************************************** -// * CDirectSoundBuffer::SetMixBins -// ****************************************************************** -SOOVPA<17> CDirectSoundBuffer_SetMixBins_1_0_4627 = -{ - 0, // Large == 0 - 17, // Count == 17 - - XREF_DSSETMIXBINSA, // XRef Is Saved - 1, // XRef Not Used - - { - // CDirectSoundBuffer_SetMixBins+0x32 : call [CDirectSoundVoice::SetMixBins] - { 0x32, XREF_DSSETMIXBINSB }, // (Offset,Value)-Pair #1 - - // CDirectSoundBuffer_SetMixBins+0x21 : mov eax, 0x80004005 - { 0x21, 0xB8 }, // (Offset,Value)-Pair #2 - { 0x22, 0x05 }, // (Offset,Value)-Pair #3 - { 0x23, 0x40 }, // (Offset,Value)-Pair #4 - { 0x24, 0x00 }, // (Offset,Value)-Pair #5 - { 0x25, 0x80 }, // (Offset,Value)-Pair #6 - - // CDirectSoundBuffer_SetMixBins+0x29 : push [esp+0x10]; push [esp+0x10] - { 0x29, 0xFF }, // (Offset,Value)-Pair #7 - { 0x2A, 0x74 }, // (Offset,Value)-Pair #8 - { 0x2B, 0x24 }, // (Offset,Value)-Pair #9 - { 0x2C, 0x10 }, // (Offset,Value)-Pair #10 - { 0x2D, 0xFF }, // (Offset,Value)-Pair #11 - { 0x2E, 0x74 }, // (Offset,Value)-Pair #12 - { 0x2F, 0x24 }, // (Offset,Value)-Pair #13 - { 0x30, 0x10 }, // (Offset,Value)-Pair #14 - - // CDirectSoundBuffer_SetMixBins+0x49 : pop edi - { 0x49, 0x5F }, // (Offset,Value)-Pair #15 - - // CDirectSoundBuffer_SetMixBins+0x4B : retn 0x08 - { 0x4B, 0xC2 }, // (Offset,Value)-Pair #16 - { 0x4C, 0x08 }, // (Offset,Value)-Pair #17 - } -}; - -// ****************************************************************** -// * IDirectSoundBuffer8_SetMixBins -// ****************************************************************** -SOOVPA<12> IDirectSoundBuffer8_SetMixBins_1_0_4627 = -{ - 0, // Large == 0 - 12, // Count == 12 - - -1, // XRef Not Saved - 1, // XRef Is Used - - { - // IDirectSoundBuffer8_SetMixBins+0x15 : call [CDirectSoundBuffer::SetMixBins] - { 0x15, XREF_DSSETMIXBINSA }, // (Offset,Value)-Pair #1 - - // IDirectSoundBuffer8_SetMixBins+0x04 : push [esp+0x08] - { 0x04, 0xFF }, // (Offset,Value)-Pair #2 - { 0x05, 0x74 }, // (Offset,Value)-Pair #3 - { 0x06, 0x24 }, // (Offset,Value)-Pair #4 - { 0x07, 0x08 }, // (Offset,Value)-Pair #5 - - // IDirectSoundBuffer8_SetMixBins+0x0A : add eax, 0xFFFFFFE4 - { 0x0A, 0x83 }, // (Offset,Value)-Pair #6 - { 0x0B, 0xC0 }, // (Offset,Value)-Pair #7 - { 0x0C, 0xE4 }, // (Offset,Value)-Pair #8 - - // IDirectSoundBuffer8_SetMixBins+0x0F : sbb ecx, ecx - { 0x0F, 0x1B }, // (Offset,Value)-Pair #9 - { 0x10, 0xC9 }, // (Offset,Value)-Pair #10 - - // IDirectSoundBuffer8_SetMixBins+0x11 : and ecx, eax - { 0x11, 0x23 }, // (Offset,Value)-Pair #11 - { 0x12, 0xC8 }, // (Offset,Value)-Pair #12 - } -}; - // ****************************************************************** // * CDirectSoundVoiceSettings::SetMixBinVolumes // ****************************************************************** @@ -2024,33 +1872,33 @@ OOVPATable DSound_1_0_4627[] = "EmuIDirectSound8_SetVelocity" #endif }, - // CDirectSoundVoiceSettings_SetMixBins + // CDirectSoundVoiceSettings_SetMixBins (* unchanged since 4432 *) { - (OOVPA*)&CDirectSoundVoiceSettings_SetMixBins_1_0_4627, 0, + (OOVPA*)&CDirectSoundVoiceSettings_SetMixBins_1_0_4432, 0, #ifdef _DEBUG_TRACE "CDirectSoundVoiceSettings::SetMixBins (XREF)" #endif }, - // CDirectSoundVoice_SetMixBins + // CDirectSoundVoice_SetMixBins (* unchanged since 4432 *) { - (OOVPA*)&CDirectSoundVoice_SetMixBins_1_0_4627, 0, + (OOVPA*)&CDirectSoundVoice_SetMixBins_1_0_4432, 0, #ifdef _DEBUG_TRACE "CDirectSoundVoice::SetMixBins (XREF)" #endif }, - // CDirectSoundBuffer_SetMixBins + // CDirectSoundBuffer_SetMixBins (* unchanged since 4432 *) { - (OOVPA*)&CDirectSoundBuffer_SetMixBins_1_0_4627, 0, + (OOVPA*)&CDirectSoundBuffer_SetMixBins_1_0_4432, 0, #ifdef _DEBUG_TRACE "CDirectSoundBuffer::SetMixBins (XREF)" #endif }, - // IDirectSoundBuffer8_SetMixBins + // IDirectSoundBuffer8_SetMixBins (* unchanged since 4432 *) { - (OOVPA*)&IDirectSoundBuffer8_SetMixBins_1_0_4627, + (OOVPA*)&IDirectSoundBuffer8_SetMixBins_1_0_4432, XTL::EmuIDirectSoundBuffer8_SetMixBins,