Get D3D stuff mostly compiling on Clang

This commit is contained in:
darkf 2020-04-07 01:02:07 -07:00
parent c64cbfe482
commit 4eff9b9dab
7 changed files with 20 additions and 4 deletions

View File

@ -311,7 +311,7 @@ bool DSStream_Packet_Process(
// Is this important or already have it handled by using while statement? // Is this important or already have it handled by using while statement?
if (packetCurrent->bufWrittenBytes == 0) { if (packetCurrent->bufWrittenBytes == 0) {
EmuLog(LOG_LEVEL::INFO, "audio gap detected: %08X; packetCurrent->bufPlayed: %08X; bufPlayed: %08X;\n", EmuLog(LOG_LEVEL::INFO, "audio gap detected: %08X; packetCurrent->bufPlayed: %08X; bufPlayed: %08X;\n",
packetCurrent._Ptr, &*packetCurrent,
packetCurrent->bufPlayed, packetCurrent->bufPlayed,
bufPlayed bufPlayed
); );

View File

@ -47,6 +47,10 @@ namespace xboxkrnl {
#include <process.h> #include <process.h>
#include <clocale> #include <clocale>
#ifndef IID_IDirectSound3DListener8
#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener
#endif
// Temporary APU Timer Functions // Temporary APU Timer Functions
// TODO: Move these to LLE APUDevice once we have one! // TODO: Move these to LLE APUDevice once we have one!

View File

@ -29,6 +29,9 @@
#include "core\kernel\init\CxbxKrnl.h" #include "core\kernel\init\CxbxKrnl.h"
#include "core\hle\DSOUND\XbDSoundTypes.h" #include "core\hle\DSOUND\XbDSoundTypes.h"
typedef struct IDirectSound3DListener8* LPDIRECTSOUND3DLISTENER8;
typedef struct IDirectSound3DBuffer8* LPDIRECTSOUND3DBUFFER8;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -27,6 +27,7 @@
#include <dsound.h> #include <dsound.h>
#include <thread> #include <thread>
#include <mutex>
#include "core/kernel/support/Emu.h" #include "core/kernel/support/Emu.h"
#include "common/win32/EmuShared.h" #include "common/win32/EmuShared.h"
#include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For D3D_OK #include "core/hle/D3D8/Direct3D9/Direct3D9.h" // For D3D_OK

View File

@ -37,6 +37,9 @@
#define DSoundBufferGetPCMBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_SRCSIZE)) * XBOX_ADPCM_DSTSIZE) : size #define DSoundBufferGetPCMBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_SRCSIZE)) * XBOX_ADPCM_DSTSIZE) : size
#define DSoundBufferGetXboxBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_DSTSIZE)) * XBOX_ADPCM_SRCSIZE) : size #define DSoundBufferGetXboxBufferSize(EmuFlags, size) (EmuFlags & DSE_FLAG_XADPCM) > 0 ? DWORD((size / float(XBOX_ADPCM_DSTSIZE)) * XBOX_ADPCM_SRCSIZE) : size
typedef struct IDirectSound3DBuffer8* LPDIRECTSOUND3DBUFFER8;
typedef LONGLONG REFERENCE_TIME;
// Memory managed xbox audio function handler // Memory managed xbox audio function handler
static inline DWORD DSoundSGEFreeBuffer() { static inline DWORD DSoundSGEFreeBuffer() {
int count = (XTL_DS_SGE_SIZE_MAX - g_dwXbMemAllocated); int count = (XTL_DS_SGE_SIZE_MAX - g_dwXbMemAllocated);
@ -1090,7 +1093,7 @@ static inline HRESULT HybridDirectSoundBuffer_SetFormat(
GeneratePCMFormat(BufferDesc, Xb_pwfxFormat, Xb_flags, dwEmuFlags, 0, xbnullptr, X_BufferCacheSize, Xb_VoiceProperties, mixbins_output); GeneratePCMFormat(BufferDesc, Xb_pwfxFormat, Xb_flags, dwEmuFlags, 0, xbnullptr, X_BufferCacheSize, Xb_VoiceProperties, mixbins_output);
} }
HRESULT hRet = DS_OK; HRESULT hRet = DS_OK;
if (g_pDSoundPrimaryBuffer == pDSBuffer) { if ((void*)g_pDSoundPrimaryBuffer == (void*)pDSBuffer) {
hRet = pDSBuffer->SetFormat(BufferDesc.lpwfxFormat); hRet = pDSBuffer->SetFormat(BufferDesc.lpwfxFormat);
} else { } else {
// DSound Stream only // DSound Stream only

View File

@ -28,6 +28,11 @@
#include <mmreg.h> #include <mmreg.h>
#include "..\XbDSoundTypes.h" #include "..\XbDSoundTypes.h"
// For MiNGW
#ifndef DSBCAPS_TRUEPLAYPOSITION
#define DSBCAPS_TRUEPLAYPOSITION 0x00080000
#endif
FLAGS2STR_START(DS_BCAPS) FLAGS2STR_START(DS_BCAPS)
FLAG2STR(DSBCAPS_PRIMARYBUFFER) FLAG2STR(DSBCAPS_PRIMARYBUFFER)
FLAG2STR(DSBCAPS_STATIC) FLAG2STR(DSBCAPS_STATIC)

View File

@ -201,7 +201,7 @@ XMEDIAPACKET, *PXMEDIAPACKET, *LPXMEDIAPACKET;
#define XMP_STATUS_PENDING E_PENDING #define XMP_STATUS_PENDING E_PENDING
#define XMP_STATUS_FLUSHED E_ABORT #define XMP_STATUS_FLUSHED E_ABORT
#define XMP_STATUS_FAILURE E_FAIL #define XMP_STATUS_FAILURE E_FAIL
#define XMP_STATUS_RELEASE_CXBXR 0xFFFFFFFF #define XMP_STATUS_RELEASE_CXBXR -1
// ****************************************************************** // ******************************************************************
// * XMEDIAINFO // * XMEDIAINFO