split classes into their own files

This commit is contained in:
RadWolfie 2020-01-02 22:36:03 -06:00
parent 044d53c74f
commit a57156fe4e
11 changed files with 4484 additions and 4185 deletions

View File

@ -140,6 +140,7 @@ file (GLOB CXBXR_HEADER_EMU
"${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexBuffer.h"
"${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexShader.h"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound.hpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.hpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundInline.hpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.hpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/XbDSoundLogging.hpp"
@ -271,7 +272,12 @@ file (GLOB CXBXR_SOURCE_EMU
"${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexBuffer.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/D3D8/XbVertexShader.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSound3DCalculator.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundBuffer.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundGlobal.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundLogging.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/DirectSoundStream.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/DirectSound/XFileMediaObject.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/DSOUND/XbDSoundLogging.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/Intercept.cpp"
"${CXBXR_ROOT_DIR}/src/core/hle/Patches.cpp"

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2002-2003 Aaron Robinson <caustik@caustik.com>
// * (c) 2017-2018 RadWolfie
// * (c) 2017-2020 RadWolfie
// *
// * All rights reserved
// *

View File

@ -0,0 +1,94 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// ******************************************************************
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2019 Luke Usher
// * (c) 2019-2020 RadWolfie
// *
// * All rights reserved
// *
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSOUND
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables
#include "Logging.h"
#include "DirectSoundLogging.hpp"
#include "..\XbDSoundLogging.hpp"
// TODO: Tasks need to do for DirectSound HLE
// * Ixxxxx_ patch might not be a requirement.
// * IDirectSound3DCalculator_GetMixBinVolumes
// * IDirectSound3DCalculator_GetPanData
#include "DirectSoundInline.hpp"
/* ------------- Sorted relative functions begin ------------------*/
// ******************************************************************
// * patch: CDirectSound3DCalculator_Calculate3D
// ******************************************************************
VOID WINAPI XTL::EMUPATCH(CDirectSound3DCalculator_Calculate3D)
(
DWORD a1,
DWORD a2
)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(a1)
LOG_FUNC_ARG(a2)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
}
// ******************************************************************
// * patch: CDirectSound3DCalculator_GetVoiceData
// ******************************************************************
VOID WINAPI XTL::EMUPATCH(CDirectSound3DCalculator_GetVoiceData)
(
DWORD a1,
DWORD a2,
DWORD a3,
DWORD a4,
DWORD a5
)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(a1)
LOG_FUNC_ARG(a2)
LOG_FUNC_ARG(a3)
LOG_FUNC_ARG(a4)
LOG_FUNC_ARG(a5)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// ******************************************************************
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2017-2020 RadWolfie
// *
// * All rights reserved
// *
// ******************************************************************
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <dsound.h>
#include "DirectSoundGlobal.hpp"
Settings::s_audio g_XBAudio = { 0 };
std::recursive_mutex g_DSoundMutex;
//Currently disabled since below may not be needed since under -6,400 is just silence yet accepting up to -10,000
// Xbox to PC volume ratio format (-10,000 / -6,400 )
//#define XBOX_TO_PC_VOLUME_RATIO 1.5625
vector_ds_buffer g_pDSoundBufferCache;
vector_ds_stream g_pDSoundStreamCache;
LPDIRECTSOUND8 g_pDSound8 = nullptr; //This is necessary in order to allow share with EmuDSoundInline.hpp
LPDIRECTSOUNDBUFFER g_pDSoundPrimaryBuffer = nullptr;
//TODO: RadWolfie - How to implement support if primary does not permit it for DSP usage?
LPDIRECTSOUNDBUFFER8 g_pDSoundPrimaryBuffer8 = nullptr;
LPDIRECTSOUND3DLISTENER8 g_pDSoundPrimary3DListener8 = nullptr;
int g_bDSoundCreateCalled = FALSE;
unsigned int g_iDSoundSynchPlaybackCounter = 0;
// Managed memory xbox audio variables
DWORD g_dwXbMemAllocated = 0;
DWORD g_dwFree2DBuffers = 0;
DWORD g_dwFree3DBuffers = 0;

View File

@ -0,0 +1,75 @@
// ******************************************************************
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2017-2020 RadWolfie
// *
// * All rights reserved
// *
// ******************************************************************
#pragma once
#include <dsound.h>
#include <thread>
#include "core/kernel/support/Emu.h"
#include "common/win32/EmuShared.h"
#include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For D3D_OK
#include "core/hle/DSOUND/DirectSound/DirectSound.hpp"
#include "common/Settings.hpp"
extern Settings::s_audio g_XBAudio;
extern std::recursive_mutex g_DSoundMutex;
#define DSoundMutexGuardLock std::lock_guard<std::recursive_mutex> guard(g_DSoundMutex)
//Currently disabled since below may not be needed since under -6,400 is just silence yet accepting up to -10,000
// Xbox to PC volume ratio format (-10,000 / -6,400 )
//#define XBOX_TO_PC_VOLUME_RATIO 1.5625
// Xbox maximum synch playback audio
#define DSOUND_MAX_SYNCHPLAYBACK_AUDIO 29
#define vector_ds_buffer std::vector<XTL::X_CDirectSoundBuffer*>
#define vector_ds_stream std::vector<XTL::X_CDirectSoundStream*>
extern vector_ds_buffer g_pDSoundBufferCache;
extern vector_ds_stream g_pDSoundStreamCache;
extern LPDIRECTSOUND8 g_pDSound8; //This is necessary in order to allow share with EmuDSoundInline.hpp
extern LPDIRECTSOUNDBUFFER g_pDSoundPrimaryBuffer;
//TODO: RadWolfie - How to implement support if primary does not permit it for DSP usage?
extern LPDIRECTSOUNDBUFFER8 g_pDSoundPrimaryBuffer8;
extern LPDIRECTSOUND3DLISTENER8 g_pDSoundPrimary3DListener8;
extern int g_bDSoundCreateCalled;
extern unsigned int g_iDSoundSynchPlaybackCounter;
// Managed memory xbox audio variables
extern DWORD g_dwXbMemAllocated;
extern DWORD g_dwFree2DBuffers;
extern DWORD g_dwFree3DBuffers;
// size of DirectSound cache max size
#define X_DIRECTSOUND_CACHE_MAX 0x800
#define X_DIRECTSOUND_CACHE_COUNT (g_pDSoundBufferCache.size() + g_pDSoundStreamCache.size())
#define RETURN_RESULT_CHECK(hRet) { \
static bool bPopupShown = false; if (!bPopupShown && hRet) { bPopupShown = true; \
printf("Return result report: 0x%08X\nIn %s (%s)\n", hRet, __func__, __FILE__); \
EmuLog(LOG_LEVEL::WARNING, "An issue has been found. Please report game title and console's output of return result," \
" function, and file name to https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/issues/485"); } return hRet; }
extern void DirectSoundDoWork_Buffer(xboxkrnl::LARGE_INTEGER& time);
extern void DirectSoundDoWork_Stream(xboxkrnl::LARGE_INTEGER& time);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,435 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// ******************************************************************
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2002-2003 Aaron Robinson <caustik@caustik.com>
// * (c) 2020 RadWolfie
// *
// * All rights reserved
// *
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSOUND
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables
#include "Logging.h"
#include "DirectSoundLogging.hpp"
#include "..\XbDSoundLogging.hpp"
#include "DirectSoundInline.hpp"
// TODO: Tasks need to do for DirectSound HLE
// * Need create patches
// * Ac97CreateMediaObject (Need OOVPA)
// - WmaCreateDecoder (Need OOVPA, not require) Test case: WMAStream sample
// - WmaCreateDecoderEx (Is just a forward to WmaCreateDecoder, nothing else)
// - WmaCreateInMemoryDecoder (Need OOVPA, not require) Test case: WMAInMemory sample
// - WmaCreateInMemoryDecoderEx (Is just a forward to WmaCreateInMemoryDecoder, nothing else)
// * XWmaDecoderCreateMediaObject (Need OOVPA)
XTL::X_XFileMediaObject::_vtbl XTL::X_XFileMediaObject::vtbl =
{
&XTL::EMUPATCH(XFileMediaObject_AddRef), // 0x00
&XTL::EMUPATCH(XFileMediaObject_Release), // 0x04
&XTL::EMUPATCH(XFileMediaObject_GetInfo), // 0x08
&XTL::EMUPATCH(XFileMediaObject_GetStatus), // 0x0C
&XTL::EMUPATCH(XFileMediaObject_Process), // 0x10
&XTL::EMUPATCH(XFileMediaObject_Discontinuity), // 0x14
0xBEEFD007, // 0x18
&XTL::EMUPATCH(XFileMediaObject_Seek), // 0x1C
0xBEEFD009, // 0x20
&XTL::EMUPATCH(XFileMediaObject_DoWork), // 0x24
};
/* NOTE: SUCCEEDED define is only checking for is equal or greater than zero value.
And FAILED check for less than zero value. Since DS_OK is only 0 base on DirectSound documentation,
there is chance of failure which contain value greater than 0.
*/
// ******************************************************************
// * patch: XAudioCreateAdpcmFormat
// ******************************************************************
VOID WINAPI XTL::EMUPATCH(XAudioCreateAdpcmFormat)
(
WORD nChannels,
DWORD nSamplesPerSec,
LPXBOXADPCMWAVEFORMAT pwfx)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(nChannels)
LOG_FUNC_ARG(nSamplesPerSec)
LOG_FUNC_ARG(pwfx)
LOG_FUNC_END;
// Fill out the pwfx structure with the appropriate data
pwfx->wfx.wFormatTag = WAVE_FORMAT_XBOX_ADPCM;
pwfx->wfx.nChannels = nChannels;
pwfx->wfx.nSamplesPerSec = nSamplesPerSec;
pwfx->wfx.nAvgBytesPerSec = (nSamplesPerSec*nChannels * 36) / 64;
pwfx->wfx.nBlockAlign = nChannels * 36;
pwfx->wfx.wBitsPerSample = 4;
pwfx->wfx.cbSize = 2;
pwfx->wSamplesPerBlock = 64;
}
// ******************************************************************
// * patch: XAudioDownloadEffectsImage
// ******************************************************************
HRESULT WINAPI XTL::EMUPATCH(XAudioDownloadEffectsImage)
(
LPCSTR pszImageName,
LPVOID pImageLoc,
DWORD dwFlags,
LPVOID* ppImageDesc)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pszImageName)
LOG_FUNC_ARG(pImageLoc)
LOG_FUNC_ARG(dwFlags)
LOG_FUNC_ARG(ppImageDesc)
LOG_FUNC_END;
LOG_NOT_SUPPORTED();
return S_OK;
}
// ******************************************************************
// * patch: XAudioSetEffectData
// ******************************************************************
HRESULT WINAPI XTL::EMUPATCH(XAudioSetEffectData)
(
DWORD dwEffectIndex,
void* pDesc,
void* pRawDesc)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(dwEffectIndex)
LOG_FUNC_ARG(pDesc)
LOG_FUNC_ARG(pRawDesc)
LOG_FUNC_END;
LOG_NOT_SUPPORTED();
return E_FAIL;
}
// ******************************************************************
// * patch: XFileCreaeMediaObject
// ******************************************************************
HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObject)
(
LPCSTR pstrFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
OUT void** ppMediaObject)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pstrFileName)
LOG_FUNC_ARG(dwDesiredAccess)
LOG_FUNC_ARG(dwShareMode)
LOG_FUNC_ARG(dwCreationDisposition)
LOG_FUNC_ARG(dwFlagsAndAttributes)
LOG_FUNC_ARG_OUT(ppMediaObject)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return E_FAIL;
}
// ******************************************************************
// * patch: XFileCreateMediaObjectAsync
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectAsync)
(
HANDLE hFile,
DWORD dwMaxPackets,
OUT void** ppMediaObject)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(hFile)
LOG_FUNC_ARG(dwMaxPackets)
LOG_FUNC_ARG_OUT(ppMediaObject)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
*ppMediaObject = new X_XFileMediaObject();
return S_OK;
}
// ******************************************************************
// * patch: XFileCreaeMediaObjectEx
// ******************************************************************
HRESULT WINAPI XTL::EMUPATCH(XFileCreateMediaObjectEx)
(
HANDLE hFile,
OUT void** ppMediaObject)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(hFile)
LOG_FUNC_ARG_OUT(ppMediaObject)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return E_FAIL;
}
// ******************************************************************
// * patch: XWaveFileCreateMediaObject
// ******************************************************************
// NOTE: Does not require any patch.
HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObject)
(
LPCSTR pszFileName,
LPCWAVEFORMATEX* ppwfxFormat,
OUT void** ppMediaObject) //XFileMediaObject, include XMediaObject interface
{
//
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pszFileName)
LOG_FUNC_ARG(ppwfxFormat)
LOG_FUNC_ARG_OUT(ppMediaObject)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return E_FAIL;
}
// ******************************************************************
// * patch: XWaveFileCreateMediaObjectEx
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XWaveFileCreateMediaObjectEx)
(
LPCSTR pszFileName,
HANDLE hFile,
OUT void** ppMediaObject) //XWaveFileMediaObject, include XFileMediaObject and XMediaObject interfaces
{
//
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pszFileName)
LOG_FUNC_ARG(hFile)
LOG_FUNC_ARG_OUT(ppMediaObject)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return E_FAIL;
}
// ******************************************************************
// * patch: XFileMediaObject_Seek
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Seek)
(
X_XFileMediaObject* pThis,
LONG lOffset,
DWORD dwOrigin,
LPDWORD pdwAbsolute)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pThis)
LOG_FUNC_ARG(lOffset)
LOG_FUNC_ARG(dwOrigin)
LOG_FUNC_ARG(pdwAbsolute)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return S_OK;
}
// ******************************************************************
// * patch: XFileMediaObject_DoWork
// ******************************************************************
// NOTE: Does not require a patch.
VOID WINAPI XTL::EMUPATCH(XFileMediaObject_DoWork)(X_XFileMediaObject* pThis)
{
DSoundMutexGuardLock;
LOG_FUNC_ONE_ARG(pThis);
LOG_UNIMPLEMENTED();
}
// ******************************************************************
// * patch: XFileMediaObject_GetStatus
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetStatus)
(
X_XFileMediaObject* pThis,
OUT LPDWORD pdwStatus)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pThis)
LOG_FUNC_ARG_OUT(pdwStatus)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return DS_OK;
}
// ******************************************************************
// * patch: XFileMediaObject_GetInfo
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_GetInfo)
(
X_XFileMediaObject* pThis,
OUT XMEDIAINFO* pInfo)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pThis)
LOG_FUNC_ARG_OUT(pInfo)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return DS_OK;
}
// ******************************************************************
// * patch: XFileMediaObject_Process
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Process)
(
X_XFileMediaObject* pThis,
LPXMEDIAPACKET pInputBuffer,
LPXMEDIAPACKET pOutputBuffer)
{
DSoundMutexGuardLock;
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pThis)
LOG_FUNC_ARG(pInputBuffer)
LOG_FUNC_ARG(pOutputBuffer)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
return DS_OK;
}
// ******************************************************************
// * patch: XFileMediaObject_AddRef
// ******************************************************************
// NOTE: Does not require a patch.
ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_AddRef)
(
X_XFileMediaObject* pThis)
{
DSoundMutexGuardLock;
LOG_FUNC_ONE_ARG(pThis);
ULONG Ret = 0;
if (pThis) { // TODO : this should be an assert()
Ret = ++(pThis->EmuRefCount);
}
return Ret;
}
// ******************************************************************
// * patch: XFileMediaObject_Release
// ******************************************************************
// NOTE: Does not require a patch.
ULONG WINAPI XTL::EMUPATCH(XFileMediaObject_Release)
(
X_XFileMediaObject* pThis)
{
DSoundMutexGuardLock;
LOG_FUNC_ONE_ARG(pThis);
ULONG Ret = 0;
if (pThis) { // TODO : this should be an assert()
Ret = --(pThis->EmuRefCount);
if (Ret == 0) {
delete pThis;
}
}
return Ret;
}
// ******************************************************************
// * patch: XFileMediaObject_Discontinuity
// ******************************************************************
// NOTE: Does not require a patch.
HRESULT WINAPI XTL::EMUPATCH(XFileMediaObject_Discontinuity)
(
X_XFileMediaObject *pThis)
{
DSoundMutexGuardLock;
LOG_FUNC_ONE_ARG(pThis);
LOG_UNIMPLEMENTED();
return DS_OK;
}

View File

@ -34,6 +34,11 @@ namespace XTL {
// Such as uint32_t, uint16_t, etc.
#define WAVE_FORMAT_XBOX_ADPCM 0x0069
// Xbox SGE Memory layout
#define XTL_DS_SGE_COUNT_MAX 2047
#define XTL_DS_SGE_PAGE_MAX (4 * ONE_KB)
#define XTL_DS_SGE_SIZE_MAX (XTL_DS_SGE_COUNT_MAX * XTL_DS_SGE_PAGE_MAX)
// XDSMIXBIN Flags
#define XDSMIXBIN_FRONT_LEFT 0