From 020888539dc59eff5f9841494a66e1948ea2baae Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 15 Jul 2017 22:24:41 +0200 Subject: [PATCH] Added patch to use assembly wrapper to call OnVoiceProcessingPassStart callback. --- patches/patchinstall.sh | 19 ++++++ ...sembly-wrapper-to-call-OnVoiceProces.patch | 63 +++++++++++++++++++ .../definition | 1 + 3 files changed, 83 insertions(+) create mode 100644 patches/xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch create mode 100644 patches/xaudio2_7-OnVoiceProcessingPassStart/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 9b830adb..e73265b4 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -493,6 +493,7 @@ patch_enable_all () enable_wuauserv_Dummy_Service="$1" enable_wusa_MSU_Package_Installer="$1" enable_xaudio2_get_al_format="$1" + enable_xaudio2_7_OnVoiceProcessingPassStart="$1" enable_xinput9_1_0_Parentsrc="$1" } @@ -1733,6 +1734,9 @@ patch_enable () xaudio2-get_al_format) enable_xaudio2_get_al_format="$2" ;; + xaudio2_7-OnVoiceProcessingPassStart) + enable_xaudio2_7_OnVoiceProcessingPassStart="$2" + ;; xinput9_1_0-Parentsrc) enable_xinput9_1_0_Parentsrc="$2" ;; @@ -10050,6 +10054,21 @@ if test "$enable_xaudio2_get_al_format" -eq 1; then ) >> "$patchlist" fi +# Patchset xaudio2_7-OnVoiceProcessingPassStart +# | +# | This patchset fixes the following Wine bugs: +# | * [#43358] Use assembly wrapper to call OnVoiceProcessingPassStart callback +# | +# | Modified files: +# | * dlls/xaudio2_7/xaudio_dll.c +# | +if test "$enable_xaudio2_7_OnVoiceProcessingPassStart" -eq 1; then + patch_apply xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "xaudio2_7: Use assembly wrapper to call OnVoiceProcessingPassStart callback.", 1 },'; + ) >> "$patchlist" +fi + # Patchset xinput9_1_0-Parentsrc # | # | This patchset fixes the following Wine bugs: diff --git a/patches/xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch b/patches/xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch new file mode 100644 index 00000000..21891b4f --- /dev/null +++ b/patches/xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch @@ -0,0 +1,63 @@ +From af47a9365411f0b25cd54ad38d152fe4878da10f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 15 Jul 2017 22:20:28 +0200 +Subject: xaudio2_7: Use assembly wrapper to call OnVoiceProcessingPassStart + callback. + +--- + dlls/xaudio2_7/xaudio_dll.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c +index 13f591630fd..5770a99b44c 100644 +--- a/dlls/xaudio2_7/xaudio_dll.c ++++ b/dlls/xaudio2_7/xaudio_dll.c +@@ -17,6 +17,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#include "config.h" + #include + + #define NONAMELESSUNION +@@ -50,6 +51,37 @@ static HINSTANCE instance; + #define COMPAT_E_DEVICE_INVALIDATED XAUDIO2_E_DEVICE_INVALIDATED + #endif + ++#if XAUDIO2_VER != 0 && defined(__i386__) ++/* EVE Online uses an OnVoiceProcessingPassStart callback which corrupts %esi. */ ++#define IXAudio2VoiceCallback_OnVoiceProcessingPassStart(a, b) call_on_voice_processing_pass_start(a, b) ++extern void call_on_voice_processing_pass_start(IXAudio2VoiceCallback *This, UINT32 BytesRequired); ++__ASM_GLOBAL_FUNC( call_on_voice_processing_pass_start, ++ "pushl %ebp\n\t" ++ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") ++ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") ++ "movl %esp,%ebp\n\t" ++ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") ++ "pushl %esi\n\t" ++ __ASM_CFI(".cfi_rel_offset %esi,-4\n\t") ++ "pushl %edi\n\t" ++ __ASM_CFI(".cfi_rel_offset %edi,-8\n\t") ++ "subl $8,%esp\n\t" ++ "pushl 12(%ebp)\n\t" /* BytesRequired */ ++ "pushl 8(%ebp)\n\t" /* This */ ++ "movl 8(%ebp),%eax\n\t" ++ "movl 0(%eax),%eax\n\t" ++ "call *0(%eax)\n\t" /* This->lpVtbl->OnVoiceProcessingPassStart */ ++ "leal -8(%ebp),%esp\n\t" ++ "popl %edi\n\t" ++ __ASM_CFI(".cfi_same_value %edi\n\t") ++ "popl %esi\n\t" ++ __ASM_CFI(".cfi_same_value %esi\n\t") ++ "popl %ebp\n\t" ++ __ASM_CFI(".cfi_def_cfa %esp,4\n\t") ++ __ASM_CFI(".cfi_same_value %ebp\n\t") ++ "ret" ) ++#endif ++ + static void dump_fmt(const WAVEFORMATEX *fmt) + { + TRACE("wFormatTag: 0x%x (", fmt->wFormatTag); +-- +2.13.1 + diff --git a/patches/xaudio2_7-OnVoiceProcessingPassStart/definition b/patches/xaudio2_7-OnVoiceProcessingPassStart/definition new file mode 100644 index 00000000..344d864f --- /dev/null +++ b/patches/xaudio2_7-OnVoiceProcessingPassStart/definition @@ -0,0 +1 @@ +Fixes: [43358] Use assembly wrapper to call OnVoiceProcessingPassStart callback