From d9e3272dcd550f33ee5f24cce635714b390ada3e Mon Sep 17 00:00:00 2001 From: jarupxx Date: Sun, 23 Apr 2017 19:22:21 +0900 Subject: [PATCH 1/3] Improved the D3DDevice_DrawVerticesUP/D3DDevice_KickOff/XFileCreateMediaObjectEx (4627-5028) Source: Tenerezza, Turok - Evolution --- src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl | 8 ++++---- src/CxbxKrnl/HLEDataBase/D3D8.1.0.5028.inl | 17 ++++++++++++++++- src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl | 19 +++++++++++++++++-- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl index 453643ebb1..617e8e73ce 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.4627.inl @@ -1355,10 +1355,10 @@ OOVPA_NO_XREF(D3DDevice_DrawVerticesUP, 4627, 10) { 0x31, 0x04 }, // (Offset,Value)-Pair #6 { 0x32, 0x08 }, // (Offset,Value)-Pair #7 - // D3DDevice_DrawVerticesUP+0xC2 : cmp esi, 0x80 - { 0xC2, 0x81 }, // (Offset,Value)-Pair #8 - { 0xC3, 0xFE }, // (Offset,Value)-Pair #9 - { 0xC4, 0x80 }, // (Offset,Value)-Pair #10 + // D3DDevice_DrawVerticesUP+0x8A : mov [ebp+arg_C], eax + { 0x8A, 0x89 }, // (Offset,Value)-Pair #8 + { 0x8B, 0x45 }, // (Offset,Value)-Pair #9 + { 0x8C, 0x14 }, // (Offset,Value)-Pair #10 OOVPA_END; // ****************************************************************** diff --git a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5028.inl b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5028.inl index 51b210933f..b8591e9020 100644 --- a/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5028.inl +++ b/src/CxbxKrnl/HLEDataBase/D3D8.1.0.5028.inl @@ -762,6 +762,21 @@ OOVPA_NO_XREF(D3DDevice_GetOverlayUpdateStatus, 5028, 12) { 0x1C, 0xC3 }, // (Offset,Value)-Pair #12 OOVPA_END; +// ****************************************************************** +// * D3D::CDevice::KickOff +// ****************************************************************** +OOVPA_NO_XREF(D3DDevice_KickOff, 5028, 8) + + { 0x07, 0x08 }, + { 0x17, 0xC4 }, + { 0x18, 0x20 }, + { 0x19, 0x75 }, + { 0x1A, 0x63 }, + { 0x1B, 0xA1 }, + { 0x6D, 0x85 }, + { 0x7E, 0xBA }, +OOVPA_END; + // ****************************************************************** // * D3D8_5028 // ****************************************************************** @@ -905,7 +920,7 @@ OOVPATable D3D8_5028[] = { REGISTER_OOVPA(D3D_SetFence, 5028, XREF), REGISTER_OOVPA(D3DDevice_InsertFence, 3925, PATCH), REGISTER_OOVPA(D3DDevice_IsFencePending, 5028, PATCH), - REGISTER_OOVPA(D3DDevice_KickOff, 4627, PATCH), + REGISTER_OOVPA(D3DDevice_KickOff, 5028, PATCH), REGISTER_OOVPA(D3DDevice_SetPixelShaderConstant, 4928, PATCH), REGISTER_OOVPA(D3DDevice_SetRenderState_TwoSidedLighting, 4134, PATCH), // Beware of the typo... REGISTER_OOVPA(D3DDevice_GetTexture2, 4627, PATCH), diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl index 0c47429ca2..9000220bf0 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl @@ -51,7 +51,22 @@ OOVPA_XREF(DirectSound_CDirectSoundVoice_SetFormat, 5028, 8, OOVPA_END; // ****************************************************************** -// * Direct, 5028 +// * XFileCreateMediaObjectEx +// ****************************************************************** +OOVPA_NO_XREF(XFileCreateMediaObjectEx, 5028, 8) + + { 0x03, 0x56 }, + { 0x22, 0x1B }, + { 0x89, 0x1B }, + { 0xA9, 0x85 }, + { 0xAA, 0xF6 }, + { 0xAB, 0x7C }, + { 0xAC, 0x0C }, + { 0xAD, 0x57 }, +OOVPA_END; + +// ****************************************************************** +// * DSound_5028 // ****************************************************************** OOVPATable DSound_5028[] = { @@ -241,7 +256,7 @@ OOVPATable DSound_5028[] = { REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetRolloffCurve, 4627, XREF), REGISTER_OOVPA(DirectSound_CDirectSoundStream_SetRolloffCurve, 4627, XREF), REGISTER_OOVPA(IDirectSoundBuffer_SetRolloffCurve, 4627, PATCH), - REGISTER_OOVPA(XFileCreateMediaObjectEx, 4627, PATCH), + REGISTER_OOVPA(XFileCreateMediaObjectEx, 5028, PATCH), REGISTER_OOVPA(XWaveFileCreateMediaObject, 4627, PATCH), // REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetNotificationPositions, 4627, XREF), // REGISTER_OOVPA(IDirectSoundBuffer_SetNotificationPositions, 4627, XREF), From 88218fcc62fdd2b2d011882a41dc2f6b4981d728 Mon Sep 17 00:00:00 2001 From: jarupxx Date: Sun, 23 Apr 2017 19:37:47 +0900 Subject: [PATCH 2/3] Improved the StopEx (5788-5849) Source: CSI - Crime Scene Investigation --- src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl | 65 ++------------------ src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl | 9 +-- 2 files changed, 10 insertions(+), 64 deletions(-) diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl index cefb7ba76c..edf8c0f620 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5788.inl @@ -194,62 +194,6 @@ OOVPA_XREF(IDirectSoundBuffer_SetCurrentPosition, 5788, 8, { 0x1A, 0x08 }, OOVPA_END; -// ****************************************************************** -// * DirectSound::CMcpxBuffer::Stop -// ****************************************************************** -OOVPA_XREF(DirectSound_CMcpxBuffer_Stop, 5788, 8, - - XREF_DSOUNDSTOP, - XRefZero) - - { 0x06, 0x56 }, - { 0x0E, 0xF1 }, - { 0x16, 0xFF }, - { 0x1D, 0x04 }, - { 0x1E, 0xFF }, - { 0x26, 0x75 }, - { 0x2F, 0x8B }, - { 0x36, 0xC2 }, -OOVPA_END; - -// ****************************************************************** -// * DirectSound::CDirectSoundBuffer::StopEx -// ****************************************************************** -OOVPA_XREF(DirectSound_CDirectSoundBuffer_StopEx, 5788, 8, - - XREF_DSOUNDSTOP2, - XRefOne) - - XREF_ENTRY( 0x3D, XREF_DSOUNDSTOP ), - - { 0x0C, 0x00 }, - { 0x16, 0x68 }, - { 0x22, 0x05 }, - { 0x2E, 0x20 }, - { 0x3A, 0x24 }, - { 0x46, 0x0B }, - { 0x52, 0x8B }, -OOVPA_END; - -// ****************************************************************** -// * IDirectSoundBuffer_StopEx -// ****************************************************************** -OOVPA_XREF(IDirectSoundBuffer_StopEx, 5788, 8, - - XRefNoSaveIndex, - XRefOne) - - XREF_ENTRY( 0x1D, XREF_DSOUNDSTOP2 ), - - { 0x03, 0x10 }, - { 0x08, 0xFF }, - { 0x0D, 0xC8 }, - { 0x12, 0x83 }, - { 0x17, 0x1B }, - { 0x1C, 0xE8 }, - { 0x21, 0xC2 }, -OOVPA_END; - // ****************************************************************** // * DirectSound::CDirectSound::SetRolloffFactor // ****************************************************************** @@ -660,7 +604,7 @@ OOVPA_END; #define IDirectSoundBuffer_SetMode_5788 IDirectSoundBuffer_SetMode_5233 // ****************************************************************** -// * Direct, 5788 +// * DSound_5788 // ****************************************************************** OOVPATable DSound_5788[] = { @@ -706,6 +650,10 @@ OOVPATable DSound_5788[] = { REGISTER_OOVPA(IDirectSoundBuffer_SetMinDistance, 5788, PATCH), REGISTER_OOVPA(DirectSound_CMcpxBuffer_Play, 3925, XREF), // REGISTER_OOVPA(CMcpxBuffer_Play, 5788, XREF), + REGISTER_OOVPA(CMcpxBuffer_Stop, 4361, XREF), + REGISTER_OOVPA(CMcpxBuffer_Stop2, 4361, XREF), + REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_StopEx, 4361, XREF), + REGISTER_OOVPA(IDirectSoundBuffer_StopEx, 4361, PATCH), REGISTER_OOVPA(IDirectSoundBuffer_Stop, 4134, PATCH), // (Possibly weak, but quite OK for 4627 DSOUND) REGISTER_OOVPA(IDirectSoundBuffer_Release, 3936, PATCH), REGISTER_OOVPA(DirectSound_CFullHRTFSource_GetCenterVolume, 5558, XREF), @@ -750,9 +698,6 @@ OOVPATable DSound_5788[] = { REGISTER_OOVPA(IDirectSoundBuffer_SetPlayRegion, 4361, PATCH), REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetLoopRegion, 5558, XREF), REGISTER_OOVPA(IDirectSoundBuffer_SetLoopRegion, 4134, PATCH), - REGISTER_OOVPA(DirectSound_CMcpxBuffer_Stop, 5788, XREF), // TODO: Use XREF ?Stop@CMcpxBuffer@DirectSound@@QAEJK@Z? - REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_StopEx, 5788, XREF), - REGISTER_OOVPA(IDirectSoundBuffer_StopEx, 5788, PATCH), REGISTER_OOVPA(DirectSound_CDirectSound_SetDistanceFactorA, 5558, XREF), REGISTER_OOVPA(IDirectSound_SetDistanceFactor, 4134, PATCH), REGISTER_OOVPA(DirectSound_CDirectSound_SetRolloffFactor, 5788, XREF), diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl index f3f83be953..ad10ab1c2f 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5849.inl @@ -158,7 +158,7 @@ OOVPA_END; #define DirectSound_CDirectSoundVoice_SetAllParameters_5849 DirectSound_CDirectSoundVoice_SetAllParameters_5558 // ****************************************************************** -// * Direct, 5849 +// * DSound_5849 // ****************************************************************** OOVPATable DSound_5849[] = { @@ -202,6 +202,10 @@ OOVPATable DSound_5849[] = { REGISTER_OOVPA(IDirectSoundBuffer_SetMinDistance, 5788, PATCH), REGISTER_OOVPA(DirectSound_CMcpxBuffer_Play, 3925, XREF), // REGISTER_OOVPA(CMcpxBuffer_Play, 5849, XREF), + REGISTER_OOVPA(CMcpxBuffer_Stop, 4361, XREF), + REGISTER_OOVPA(CMcpxBuffer_Stop2, 4361, XREF), + REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_StopEx, 4361, XREF), + REGISTER_OOVPA(IDirectSoundBuffer_StopEx, 4361, PATCH), REGISTER_OOVPA(IDirectSoundBuffer_Stop, 4134, PATCH), // (Possibly weak, but quite OK for 4627 DSOUND) REGISTER_OOVPA(IDirectSoundBuffer_Release, 3936, PATCH), REGISTER_OOVPA(DirectSound_CDirectSoundVoice_SetHeadroom, 5558, XREF), @@ -228,9 +232,6 @@ OOVPATable DSound_5849[] = { REGISTER_OOVPA(IDirectSoundBuffer_GetCurrentPosition, 5558, PATCH), REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetLoopRegion, 5558, XREF), REGISTER_OOVPA(IDirectSoundBuffer_SetLoopRegion, 4134, PATCH), - REGISTER_OOVPA(DirectSound_CMcpxBuffer_Stop, 5788, XREF), // TODO: Use XREF ?Stop@CMcpxBuffer@DirectSound@@QAEJK@Z? - REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_StopEx, 5788, XREF), - REGISTER_OOVPA(IDirectSoundBuffer_StopEx, 5788, PATCH), REGISTER_OOVPA(DirectSound_CDirectSound_SetRolloffFactor, 5849, XREF), REGISTER_OOVPA(IDirectSound_SetRolloffFactor, 4134, PATCH), // TODO : Use 5344? REGISTER_OOVPA(DirectSound_CDirectSound_SetDopplerFactor, 5788, XREF), From a44edd578484e3d3cb224cc28e472b3b11047510 Mon Sep 17 00:00:00 2001 From: jarupxx Date: Sun, 23 Apr 2017 19:38:57 +0900 Subject: [PATCH 3/3] Improved the SetFormat (4721) Source: Dynasty Warriors 3 --- src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl | 19 +++++++++++++++++++ src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl | 20 +------------------- src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl index c8abf67a53..9337f567e4 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.4627.inl @@ -505,6 +505,24 @@ OOVPA_END; // ****************************************************************** #define DirectSound_CDirectSoundVoice_SetFormat_4627 DirectSound_CDirectSoundVoice_SetFormat_4361 +// ****************************************************************** +// * DirectSound::CDirectSoundVoice::SetFormat +// ****************************************************************** +OOVPA_XREF(DirectSound_CDirectSoundVoice_SetFormat, 4721, 8, + + XREF_DirectSound_CDirectSoundVoice_SetFormat, + XRefZero) + + { 0x06, 0x4E }, + { 0x0E, 0xE8 }, + { 0x18, 0x4E }, + { 0x25, 0xFF }, + { 0x2E, 0x0C }, + { 0x34, 0x85 }, + { 0x38, 0x8B }, + { 0x43, 0x00 }, +OOVPA_END; + // ****************************************************************** // * DirectSound::CDirectSoundBuffer::SetFormat // ****************************************************************** @@ -1563,6 +1581,7 @@ OOVPATable DSound_4627[] = { REGISTER_OOVPA(IDirectSoundBuffer_Stop, 4134, PATCH), REGISTER_OOVPA(IDirectSoundBuffer_Release, 3936, PATCH), // +s REGISTER_OOVPA(DirectSound_CDirectSoundVoice_SetFormat, 4627, XREF), + REGISTER_OOVPA(DirectSound_CDirectSoundVoice_SetFormat, 4721, XREF), REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetFormat, 4627, XREF), REGISTER_OOVPA(IDirectSoundBuffer_SetFormat, 4627, PATCH), REGISTER_OOVPA(DirectSound_CDirectSoundStream_SetFormat, 4361, PATCH), diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl index 9000220bf0..d9cb50e123 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5028.inl @@ -32,24 +32,6 @@ // * // ****************************************************************** -// ****************************************************************** -// * DirectSound::CDirectSoundVoice::SetFormat -// ****************************************************************** -OOVPA_XREF(DirectSound_CDirectSoundVoice_SetFormat, 5028, 8, - - XREF_DirectSound_CDirectSoundVoice_SetFormat, - XRefZero) - - { 0x06, 0x4E }, - { 0x0E, 0xE8 }, - { 0x18, 0x4E }, - { 0x25, 0xFF }, - { 0x2E, 0x0C }, - { 0x34, 0x85 }, - { 0x38, 0x8B }, - { 0x43, 0x00 }, -OOVPA_END; - // ****************************************************************** // * XFileCreateMediaObjectEx // ****************************************************************** @@ -198,7 +180,7 @@ OOVPATable DSound_5028[] = { REGISTER_OOVPA(DirectSound_CDirectSoundStream_SetI3DL2Source, 4134, PATCH), REGISTER_OOVPA(IDirectSoundBuffer_Stop, 4134, PATCH), REGISTER_OOVPA(IDirectSoundBuffer_Release, 3936, PATCH), // +s - REGISTER_OOVPA(DirectSound_CDirectSoundVoice_SetFormat, 5028, XREF), + REGISTER_OOVPA(DirectSound_CDirectSoundVoice_SetFormat, 4721, XREF), REGISTER_OOVPA(DirectSound_CDirectSoundBuffer_SetFormat, 4627, XREF), REGISTER_OOVPA(IDirectSoundBuffer_SetFormat, 4627, PATCH), REGISTER_OOVPA(DirectSound_CDirectSound_EnableHeadphones, 4627, XREF), diff --git a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl index 33f22a0e00..8cefecfb75 100644 --- a/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl +++ b/src/CxbxKrnl/HLEDataBase/DSound.1.0.5233.inl @@ -192,7 +192,7 @@ OOVPA_END; // ****************************************************************** // * DirectSound::CDirectSoundVoice::SetFormat // ****************************************************************** -#define DirectSound_CDirectSoundVoice_SetFormat_5233 DirectSound_CDirectSoundVoice_SetFormat_5028 +#define DirectSound_CDirectSoundVoice_SetFormat_5233 DirectSound_CDirectSoundVoice_SetFormat_4721 // ****************************************************************** // DirectSound_CDirectSoundVoice::SetMode