From 6acc0483d400cec2aaf926f187a9c2f1b971d343 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Fri, 16 Jun 2017 16:10:42 -0500 Subject: [PATCH] Rename DSoundBufferUnlockXboxAdpcm Changed DSoundBufferUnlockXboxAdpcm to DSoundBufferXboxAdpcmDecoder since it is performing a decode in locked memory and new buffer. --- src/CxbxKrnl/EmuDSound.cpp | 8 ++++---- src/CxbxKrnl/EmuDSoundInline.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CxbxKrnl/EmuDSound.cpp b/src/CxbxKrnl/EmuDSound.cpp index f2bdda940..64e36b27c 100644 --- a/src/CxbxKrnl/EmuDSound.cpp +++ b/src/CxbxKrnl/EmuDSound.cpp @@ -994,7 +994,7 @@ HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_SetBufferData) ResizeIDirectSoundBuffer(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pThis->EmuFlags, dwBufferBytes, pThis->EmuDirectSound3DBuffer8); if (pThis->EmuFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pvBufferData, dwBufferBytes, NULL, 0, false); + DSoundBufferXboxAdpcmDecoder(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pvBufferData, dwBufferBytes, NULL, 0, false); } leaveCriticalSection; @@ -1082,7 +1082,7 @@ HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Lock) if (pThis->EmuLockPtr1 != 0) { //TODO: This is not really recommended place since new sound data are going to be replace anyway. if (pThis->EmuFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis->EmuDirectSoundBuffer8, + DSoundBufferXboxAdpcmDecoder(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pThis->EmuLockPtr1, pThis->EmuLockBytes1, @@ -1360,7 +1360,7 @@ HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer_Play) // close any existing locks if (pThis->EmuLockPtr1 != 0) { if (pThis->EmuFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis->EmuDirectSoundBuffer8, + DSoundBufferXboxAdpcmDecoder(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pThis->EmuLockPtr1, pThis->EmuLockBytes1, @@ -1851,7 +1851,7 @@ HRESULT WINAPI XTL::EMUPATCH(CDirectSoundStream_Process) //NOTE : XADPCM audio has occurred in Rayman Arena first intro video, all other title's intro videos are PCM so far. if (pThis->EmuFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis->EmuDirectSoundBuffer8, + DSoundBufferXboxAdpcmDecoder(pThis->EmuDirectSoundBuffer8, pThis->EmuBufferDesc, pThis->EmuBuffer, pInputBuffer->dwMaxSize, diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/CxbxKrnl/EmuDSoundInline.hpp index 3b7b1e9cd..fbf259235 100644 --- a/src/CxbxKrnl/EmuDSoundInline.hpp +++ b/src/CxbxKrnl/EmuDSoundInline.hpp @@ -49,7 +49,7 @@ CRITICAL_SECTION g_DSoundCriticalSection; #define leaveCriticalSection LeaveCriticalSection(&g_DSoundCriticalSection) //Xbox Audio Decoder by blueshogun96 and revised by RadWolfie -void DSoundBufferUnlockXboxAdpcm( +void DSoundBufferXboxAdpcmDecoder( IDirectSoundBuffer* pDSBuffer, DSBUFFERDESC* pDSBufferDesc, LPVOID pAudioPtr, @@ -386,7 +386,7 @@ inline void DSoundBufferUpdate( // unlock existing lock if (pLockPtr1 != 0) { if (dwFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis, + DSoundBufferXboxAdpcmDecoder(pThis, pDSBufferDesc, pLockPtr1, dwLockBytes1, @@ -399,7 +399,7 @@ inline void DSoundBufferUpdate( pLockPtr1 = 0; } if (dwFlags & DSB_FLAG_ADPCM) { - DSoundBufferUnlockXboxAdpcm(pThis, pDSBufferDesc, pBuffer, pDSBufferDesc->dwBufferBytes, 0, 0, false); + DSoundBufferXboxAdpcmDecoder(pThis, pDSBufferDesc, pBuffer, pDSBufferDesc->dwBufferBytes, 0, 0, false); } else { HRESULT hRet = pThis->Lock(0, pDSBufferDesc->dwBufferBytes, &pAudioPtr, &dwAudioBytes, &pAudioPtr2, &dwAudioBytes2, 0);