Update with master (partially)

This commit is contained in:
PatrickvL 2016-11-07 11:44:05 +01:00
commit ca08e78699
9 changed files with 550 additions and 1131 deletions

View File

@ -49,6 +49,8 @@ Mutex::Mutex()
// ******************************************************************
void Mutex::Lock()
{
LONG _CurrentProcessId = (LONG) GetCurrentProcessId();
LONG _CurrentThreadId = (LONG) GetCurrentThreadId();
while(true)
{
// Grab the lock, letting us look at the variables
@ -63,8 +65,8 @@ void Mutex::Lock()
if (!m_OwnerProcess)
{
// Take ownership
InterlockedExchange(&m_OwnerProcess, (LONG)GetCurrentProcessId());
InterlockedExchange(&m_OwnerThread, (LONG)GetCurrentThreadId());
InterlockedExchange(&m_OwnerProcess, _CurrentProcessId);
InterlockedExchange(&m_OwnerThread, _CurrentThreadId);
InterlockedExchange(&m_LockCount, 1);
// Unlock the mutex itself
@ -76,13 +78,14 @@ void Mutex::Lock()
// If a different process owns this mutex right now, unlock
// the mutex lock and wait. The reading need not be
// interlocked.
if ((m_OwnerProcess != (LONG) GetCurrentProcessId()) ||
(m_OwnerThread != (LONG) GetCurrentThreadId()))
if ((m_OwnerProcess != _CurrentProcessId) ||
(m_OwnerThread != _CurrentThreadId))
{
// Unlock the mutex itself
InterlockedExchange(&m_MutexLock, 0);
// Wait and try again
// TODO : Improve performance replacing Sleep(1) with YieldProcessor and perhaps an optional SpinLock
Sleep(1);
continue;
}

View File

@ -82,8 +82,6 @@ typedef signed long sint32;
/*! define this to dump textures that are registered */
//#define _DEBUG_DUMP_TEXTURE_REGISTER "D:\\cxbx\\_textures\\"
#include "Version.h"
/*! version string dependent on trace flag */
#ifndef _DEBUG_TRACE
#define _CXBX_VERSION _GIT_VERSION " ("__DATE__ ")"
@ -105,11 +103,13 @@ extern volatile bool g_bPrintfOn;
#endif
/*! DbgPrintf enabled if _DEBUG_TRACE is set */
#ifdef _DEBUG_TRACE
#define DbgPrintf if(g_bPrintfOn) printf
#else
inline void null_func(...) { }
#define DbgPrintf null_func
#endif
#define DbgPrintf(fmt, ...) do { if (_DEBUG_TRACE) if(g_bPrintfOn) printf(fmt, __VA_ARGS__); } while (0)
// See http://stackoverflow.com/questions/1644868/c-define-macro-for-debug-printing
// TODO : print each argument indented on a separate line
#define DbgFuncArgs(fmt, ...) \
do { if (_DEBUG_TRACE) if(g_bPrintfOn) \
printf(__FILE__ " (0x%X): " __func__ "(" fmt ");\n", GetCurrentThreadID(), __VA_ARGS__); \
} while (0)
#endif

View File

@ -364,7 +364,7 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid)
wcstombs(tAsciiTitle, XbeCert->wszTitleName, 40);
}
sprintf(AsciiTitle, "Cxbx-Reloaded : Emulating %s", tAsciiTitle);
sprintf(AsciiTitle, "Cxbx : Emulating %s", tAsciiTitle);
}
// create the window
@ -2172,10 +2172,6 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_GetBackBuffer
X_D3DSurface **ppBackBuffer
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_GetBackBuffer\n"
"(\n"
" BackBuffer : 0x%.08X\n"
@ -2183,9 +2179,6 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_GetBackBuffer
" ppBackBuffer : 0x%.08X\n"
");\n",
GetCurrentThreadId(), BackBuffer, Type, ppBackBuffer);
}
#endif
*ppBackBuffer = EmuIDirect3DDevice8_GetBackBuffer2(BackBuffer);
@ -2825,19 +2818,12 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstant1
CONST PVOID pConstantData
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexShaderConstant1\n"
"(\n"
" Register : 0x%.08X\n"
" pConstantData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, pConstantData);
}
#endif
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant(Register, pConstantData, 1);
@ -2853,19 +2839,12 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstant4
CONST PVOID pConstantData
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexShaderConstant4\n"
"(\n"
" Register : 0x%.08X\n"
" pConstantData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, pConstantData);
}
#endif
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant(Register, pConstantData, 4);
@ -2882,10 +2861,6 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
DWORD ConstantCount
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexShaderConstantNotInline\n"
"(\n"
" Register : 0x%.08X\n"
@ -2893,9 +2868,6 @@ VOID __fastcall XTL::EmuIDirect3DDevice8_SetVertexShaderConstantNotInline
" ConstantCount : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, pConstantData, ConstantCount);
}
#endif
XTL::EmuIDirect3DDevice8_SetVertexShaderConstant(Register, pConstantData, ConstantCount / 4);
@ -3914,10 +3886,6 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexData2f
FLOAT b
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexData2f >>\n"
"(\n"
" Register : 0x%.08X\n"
@ -3925,9 +3893,6 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexData2f
" b : %f\n"
");\n",
GetCurrentThreadId(), Register, a, b);
}
#endif
return EmuIDirect3DDevice8_SetVertexData4f(Register, a, b, 0.0f, 1.0f);
}
@ -3945,10 +3910,6 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexData2s
SHORT b
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexData2s >>\n"
"(\n"
" Register : 0x%.08X\n"
@ -3956,9 +3917,6 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexData2s
" b : %d\n"
");\n",
GetCurrentThreadId(), Register, a, b);
}
#endif
DWORD dwA = a, dwB = b;
@ -4224,19 +4182,12 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_SetVertexDataColor
D3DCOLOR Color
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuIDirect3DDevice8_SetVertexDataColor >>\n"
"(\n"
" Register : 0x%.08X\n"
" Color : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Register, Color);
}
#endif
FLOAT a = DWtoF((Color & 0xFF000000) >> 24);
FLOAT r = DWtoF((Color & 0x00FF0000) >> 16);
@ -5631,10 +5582,6 @@ VOID WINAPI XTL::EmuGet2DSurfaceDescD
X_D3DSURFACE_DESC *pDesc
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuD3D8 (0x%X): EmuGet2DSurfaceDescD\n"
"(\n"
" pPixelContainer : 0x%.08X\n"
@ -5642,9 +5589,6 @@ VOID WINAPI XTL::EmuGet2DSurfaceDescD
");\n",
GetCurrentThreadId(), pPixelContainer, pDesc);
}
#endif
EmuGet2DSurfaceDesc(pPixelContainer, 0xFEFEFEFE, pDesc);
return;
@ -8700,8 +8644,6 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_GetShaderConstantMode
DWORD *pMode
)
{
#ifdef _DEBUG_TRACE
{
DbgPrintf( "EmuD3D8 (0x%X): EmuIDirect3DDevice8_GetShaderConstantMode\n"
"(\n"
@ -8709,9 +8651,6 @@ VOID WINAPI XTL::EmuIDirect3DDevice8_GetShaderConstantMode
");\n",
GetCurrentThreadId(), pMode);
}
#endif
if(pMode)
{
*pMode = g_VertexShaderConstantMode;

View File

@ -609,10 +609,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetI3DL2Listener
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_SetI3DL2Listener\n"
"(\n"
" pThis : 0x%.08X\n"
@ -620,9 +616,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetI3DL2Listener
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pDummy, dwApply);
}
#endif
// TODO: Actually do something
@ -639,10 +632,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetMixBinHeadroom
DWORD dwHeadroom
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_SetMixBinHeadroom\n"
"(\n"
" pThis : 0x%.08X\n"
@ -650,9 +639,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetMixBinHeadroom
" dwHeadroom : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, dwMixBinMask, dwHeadroom);
}
#endif
// TODO: Actually do something
@ -668,19 +654,12 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetMixBins
PVOID pMixBins
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetMixBins\n"
"(\n"
" pThis : 0x%.08X\n"
" pMixBins : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pMixBins);
}
#endif
// TODO: Actually do something
@ -696,19 +675,12 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetMixBinVolumes
PVOID pMixBins
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetMixBinVolumes\n"
"(\n"
" pThis : 0x%.08X\n"
" pMixBins : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pMixBins);
}
#endif
// TODO: Actually do something
@ -727,10 +699,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetPosition
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_SetPosition\n"
"(\n"
" pThis : 0x%.08X\n"
@ -740,9 +708,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetPosition
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
}
#endif
// TODO: Actually do something
@ -761,10 +726,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetVelocity
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_SetVelocity\n"
"(\n"
" pThis : 0x%.08X\n"
@ -774,9 +735,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetVelocity
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
}
#endif
// TODO: Actually do something
@ -793,10 +751,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetAllParameters
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_SetAllParameters\n"
"(\n"
" pThis : 0x%.08X\n"
@ -804,9 +758,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_SetAllParameters
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pTodo, dwApply);
}
#endif
// TODO: Actually do something
@ -821,8 +772,6 @@ HRESULT WINAPI XTL::EmuCDirectSound_CommitDeferredSettings
X_CDirectSound *pThis
)
{
DbgPrintf("EmuDSound (0x%X): EmuCDirectSound_CommitDeferredSettings\n"
"(\n"
" pThis : 0x%.08X\n"
@ -831,8 +780,6 @@ HRESULT WINAPI XTL::EmuCDirectSound_CommitDeferredSettings
// TODO: Translate params, then make the PC DirectSound call
return DS_OK;
}
@ -845,8 +792,6 @@ HRESULT WINAPI XTL::EmuDirectSoundCreateBuffer
X_CDirectSoundBuffer **ppBuffer
)
{
DbgPrintf("EmuDSound (0x%X): EmuDirectSoundCreateBuffer\n"
"(\n"
" pdsbd : 0x%.08X\n"
@ -1021,10 +966,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateBuffer
PVOID pUnknown
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_CreateBuffer\n"
"(\n"
" pThis : 0x%.08X\n"
@ -1033,9 +974,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateBuffer
" pUnknown : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pdssd, ppBuffer, pUnknown);
}
#endif
EmuDirectSoundCreateBuffer(pdssd, ppBuffer);
@ -1053,10 +991,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateSoundBuffer
LPUNKNOWN pUnkOuter
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_CreateSoundBuffer\n"
"(\n"
" pdsbd : 0x%.08X\n"
@ -1064,9 +998,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateSoundBuffer
" pUnkOuter : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pdsbd, ppBuffer, pUnkOuter);
}
#endif
return EmuDirectSoundCreateBuffer(pdsbd, ppBuffer);
}
@ -1756,10 +1687,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateStream
PVOID pUnknown
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSound8_CreateStream\n"
"(\n"
" pThis : 0x%.08X\n"
@ -1768,9 +1695,6 @@ HRESULT WINAPI XTL::EmuIDirectSound8_CreateStream
" pUnknown : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pdssd, ppStream, pUnknown);
}
#endif
EmuDirectSoundCreateStream(pdssd, ppStream);
@ -2453,20 +2377,12 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetMaxDistance
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetMaxDistance\n"
"(\n"
" pThis : 0x%.08X\n"
" flMaxDistance : %f\n"
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, flMaxDistance, dwApply);
}
#endif
// TODO: Actually do something
@ -2483,10 +2399,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetMinDistance
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetMinDistance\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2494,9 +2406,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetMinDistance
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, flMinDistance, dwApply);
}
#endif
// TODO: Actually do something
@ -2513,10 +2422,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffFactor
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetRolloffFactor\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2524,9 +2429,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetRolloffFactor
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, flRolloffFactor, dwApply);
}
#endif
// TODO: Actually do something
@ -2543,10 +2445,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetDistanceFactor
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetDistanceFactor\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2554,9 +2452,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetDistanceFactor
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, flDistanceFactor, dwApply);
}
#endif
// TODO: Actually do something
@ -2574,10 +2469,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeAngles
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetConeAngles\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2587,9 +2478,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeAngles
");\n",
GetCurrentThreadId(), pThis, dwInsideConeAngle,
dwOutsideConeAngle, dwApply);
}
#endif
// TODO: Actually do something
@ -2608,10 +2496,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeOrientation
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetConeOrientation\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2621,9 +2505,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeOrientation
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
}
#endif
// TODO: Actually do something
@ -2640,10 +2521,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeOutsideVolume
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetConeOutsideVolume\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2651,9 +2528,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetConeOutsideVolume
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, lConeOutsideVolume, dwApply);
}
#endif
// TODO: Actually do something
@ -2672,10 +2546,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetPosition
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetPosition\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2685,9 +2555,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetPosition
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
}
#endif
// TODO: Actually do something
@ -2706,10 +2573,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetVelocity
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetVelocity\n"
"(\n"
" pThis : 0x%.08X\n"
@ -2719,9 +2582,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetVelocity
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
}
#endif
// TODO: Actually do something
@ -2738,9 +2598,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetDopplerFactor
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetConeOutsideVolume\n"
"(\n"
@ -2750,8 +2607,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetDopplerFactor
");\n",
GetCurrentThreadId(), pThis, flDopplerFactor, dwApply);
}
#endif
// TODO: Actually do something
@ -2768,9 +2623,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetI3DL2Source
DWORD dwApply
)
{
// debug trace
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetI3DL2Source\n"
"(\n"
@ -2780,8 +2632,6 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetI3DL2Source
");\n",
GetCurrentThreadId(), pThis, pds3db, dwApply);
}
#endif
// TODO: Actually do something
@ -2829,17 +2679,12 @@ HRESULT WINAPI XTL::EmuIDirectSoundBuffer8_SetFormat
{
// debug trace
#ifdef _DEBUG_TRACE
{
printf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetFormat\n"
DbgPrintf("EmuDSound (0x%X): EmuIDirectSoundBuffer8_SetFormat\n"
"(\n"
" pBuffer : 0x%.08X\n"
" pwfxFormat : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pBuffer,pwfxFormat);
}
#endif
HRESULT hRet = DS_OK;

File diff suppressed because it is too large Load Diff

View File

@ -58,20 +58,9 @@ PVOID WINAPI XTL::EmuXGIsSwizzledFormat
XTL::D3DFORMAT Format
)
{
// ******************************************************************
// * debug trace
// ******************************************************************
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuXapi (0x%X): EmuXGIsSwizzledFormat\n"
"(\n"
" Format : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Format);
}
#endif
DbgFuncArgs(
" Format : 0x%.08X\n",
Format);
return FALSE;
}
@ -93,8 +82,7 @@ VOID WINAPI XTL::EmuXGSwizzleRect
{
DbgPrintf("EmuXapi (0x%X): EmuXGSwizzleRect\n"
"(\n"
DbgFuncArgs(
" pSource : 0x%.08X\n"
" Pitch : 0x%.08X\n"
" pRect : 0x%.08X\n"
@ -102,9 +90,8 @@ VOID WINAPI XTL::EmuXGSwizzleRect
" Width : 0x%.08X\n"
" Height : 0x%.08X\n"
" pPoint : 0x%.08X\n"
" BytesPerPixel : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pSource, Pitch, pRect, pDest, Width, Height,
" BytesPerPixel : 0x%.08X\n",
pSource, Pitch, pRect, pDest, Width, Height,
pPoint, BytesPerPixel);
if(pRect == NULL && pPoint == NULL && Pitch == 0)
@ -163,8 +150,7 @@ VOID WINAPI XTL::EmuXGSwizzleBox
{
DbgPrintf("EmuXapi (0x%X): EmuXGSwizzleBox\n"
"(\n"
DbgFuncArgs(
" pSource : 0x%.08X\n"
" RowPitch : 0x%.08X\n"
" SlicePitch : 0x%.08X\n"
@ -174,9 +160,8 @@ VOID WINAPI XTL::EmuXGSwizzleBox
" Height : 0x%.08X\n"
" Depth : 0x%.08X\n"
" pPoint : 0x%.08X\n"
" BytesPerPixel : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pSource, RowPitch, SlicePitch, pBox, pDest, Width, Height,
" BytesPerPixel : 0x%.08X\n",
pSource, RowPitch, SlicePitch, pBox, pDest, Width, Height,
Depth, pPoint, BytesPerPixel);
if(pDest != (LPVOID) 0x80000000)
@ -339,13 +324,11 @@ HRESULT WINAPI XTL::EmuXGWriteSurfaceOrTextureToXPR
{
DbgPrintf("EmuXapi (0x%X): EmuXGWriteSurfaceOrTextureToXPR\n"
"(\n"
DbgFuncArgs(
" pResource : 0x%.08X\n"
" cPath : 0x%.08X\n"
" bWriteSurfaceAsTexture : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pResource, cPath, bWriteSurfaceAsTexture);
" bWriteSurfaceAsTexture : 0x%.08X\n",
pResource, cPath, bWriteSurfaceAsTexture);
// TODO: If necessary, either reverse the .xbx and .xpr file formats
// and write the surface/texture to a file, or output a generic .xbx
@ -376,8 +359,7 @@ VOID WINAPI XTL::EmuXGSetTextureHeader
{
DbgPrintf("EmuXapi (0x%X): EmuXGSetTextureHeader\n"
"(\n"
DbgFuncArgs(
" Width : 0x%.08X\n"
" Height : 0x%.08X\n"
" Levels : 0x%.08X\n"
@ -386,9 +368,8 @@ VOID WINAPI XTL::EmuXGSetTextureHeader
" Pool : 0x%.08X\n"
" pTexture : 0x%.08X\n"
" Data : 0x%.08X\n"
" Pitch : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Width, Height, Levels, Usage,
" Pitch : 0x%.08X\n",
Width, Height, Levels, Usage,
Format, Pool, pTexture, Data, Pitch);
// NOTES: This function simply creates a texture that needs to be registered
@ -454,13 +435,11 @@ VOID WINAPI XTL::EmuXGSetTextureHeader
//{
//
//
// DbgPrintf("EmuXapi (0x%X): EmuXFONT_OpenBitmapFontFromMemory\n"
// "(\n"
// DbgFuncArgs(
// " pFontData : 0x%.08X\n"
// " uFontDataSize : 0x%.08X\n"
// " ppFont : 0x%.08X\n"
// ");\n",
// GetCurrentThreadId(), pFontData, uFontDataSize, ppFont);
// " ppFont : 0x%.08X\n",
// pFontData, uFontDataSize, ppFont);
//
// __asm int 3;
//

View File

@ -58,12 +58,10 @@ int WINAPI XTL::EmuWSAStartup
{
DbgPrintf("EmuXapi (0x%X): EmuWSAStartup\n"
"(\n"
DbgFuncArgs(
" wVersionRequested : 0x%.08X\n"
" lpWSAData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), wVersionRequested, lpWSAData);
" lpWSAData : 0x%.08X\n",
wVersionRequested, lpWSAData);
int ret = WSAStartup(wVersionRequested, lpWSAData);
@ -82,11 +80,9 @@ INT WINAPI XTL::EmuXNetStartup
{
DbgPrintf("EmuXapi (0x%X): EmuXNetStartup\n"
"(\n"
" pDummy : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pDummy);
DbgFuncArgs(
" pDummy : 0x%.08X\n",
pDummy);
@ -101,7 +97,7 @@ DWORD WINAPI XTL::EmuXNetGetEthernetLinkStatus()
{
DbgPrintf("EmuXapi (0x%X): EmuXNetGetEthernetLinkStatus();\n", GetCurrentThreadId());
DbgFuncArgs();
@ -121,14 +117,12 @@ SOCKET XTL::EmuThis::Emusocket
{
DbgPrintf("EmuXapi (0x%X): EmuThis::Emusocket\n"
"(\n"
DbgFuncArgs(
" this : 0x%.08X\n"
" af : 0x%.08X\n"
" type : 0x%.08X\n"
" protocol : 0x%.08X\n"
");\n",
GetCurrentThreadId(), this, af, type, protocol);
" protocol : 0x%.08X\n",
this, af, type, protocol);
SOCKET ret = socket(af, type, protocol);
@ -144,14 +138,12 @@ int XTL::EmuThis::Emubind(SOCKET s, const struct sockaddr FAR *name, int namelen
{
DbgPrintf("EmuXapi (0x%X): EmuThis::Emubind\n"
"(\n"
DbgFuncArgs(
" this : 0x%.08X\n"
" s : 0x%.08X\n"
" name : 0x%.08X\n"
" namelen : 0x%.08X\n"
");\n",
GetCurrentThreadId(), this, s, name, namelen);
" namelen : 0x%.08X\n",
this, s, name, namelen);
// TODO: Host-To-Network order if necessary (probably not?)
@ -169,13 +161,11 @@ int XTL::EmuThis::Emulisten(SOCKET s, int backlog)
{
DbgPrintf("EmuXapi (0x%X): EmuThis::Emulisten\n"
"(\n"
DbgFuncArgs(
" this : 0x%.08X\n"
" s : 0x%.08X\n"
" listen : 0x%.08X\n"
");\n",
GetCurrentThreadId(), this, s, backlog);
" listen : 0x%.08X\n",
this, s, backlog);
// TODO: Host-To-Network order if necessary (probably not?)
@ -193,14 +183,12 @@ int XTL::EmuThis::Emuioctlsocket(SOCKET s, long cmd, u_long FAR *argp)
{
DbgPrintf("EmuXapi (0x%X): EmuThis::Emuioctlsocket\n"
"(\n"
DbgFuncArgs(
" this : 0x%.08X\n"
" s : 0x%.08X\n"
" cmd : 0x%.08X\n"
" argp : 0x%.08X\n"
");\n",
GetCurrentThreadId(), this, s, cmd, argp);
" argp : 0x%.08X\n",
this, s, cmd, argp);
int ret = ioctlsocket(s, cmd, argp);
@ -220,12 +208,10 @@ HRESULT WINAPI XOnlineLaunchNewImage
{
DbgPrintf("XOnline (0x%X): EmuXOnlineLaunchNewImage\n"
"(\n"
DbgFuncArgs(
" lpImagePath : 0x%.08X (%s)\n"
" pLaunchData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpImagePath, lpImagePath, pLaunchData);
" pLaunchData : 0x%.08X\n",
lpImagePath, lpImagePath, pLaunchData);
// TODO: Launch another .xbe from Cxbx someday?
@ -248,15 +234,13 @@ HRESULT WINAPI XTL::EmuXOnlineLogon
{
DbgPrintf("XOnline (0x%X): EmuXOnlineLogon\n"
"(\n"
DbgFuncArgs(
" pUsers : 0x%.08X\n"
" pdwServiceIDs : 0x%.08X\n"
" dwServices : 0x%.08X\n"
" hEvent : 0x%.08X\n"
" pHandle : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pUsers, pdwServiceIDs, dwServices, hEvent, pHandle);
" pHandle : 0x%.08X\n",
pUsers, pdwServiceIDs, dwServices, hEvent, pHandle);
// TODO: What will it take to log on to Xbox Live?

View File

@ -70,12 +70,10 @@ HRESULT WINAPI XTL::EmuXACTEngineCreate
{
DbgPrintf("EmuXactEng (0x%X): EmuXACTEngineCreate\n"
"(\n"
DbgFuncArgs(
" pParams : 0x%.08X\n"
" ppEngine : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pParams, ppEngine);
" ppEngine : 0x%.08X\n",
pParams, ppEngine);
// TODO: Any other form of initialization?
@ -93,7 +91,7 @@ void WINAPI XTL::EmuXACTEngineDoWork()
{
DbgPrintf("EmuXactEng (0x%X): EmuXACTEngineCreate()\n", GetCurrentThreadId() );
DbgFuncArgs();
// TODO: Anything else required here?
// AFAIK, this function just calls DirectSoundDoWork()
@ -118,14 +116,12 @@ HRESULT WINAPI XTL::EmuIXACTEngine_RegisterWaveBank
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_RegisterWaveBank\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pvData : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" ppWaveBank : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pvData, dwSize, ppWaveBank);
" ppWaveBank : 0x%.08X\n",
pThis, pvData, dwSize, ppWaveBank);
// TODO: Implement
@ -148,13 +144,11 @@ HRESULT WINAPI XTL::EmuIXACTEngine_RegisterStreamedWaveBank
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_RegisterWaveBank\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pParams : 0x%.08X\n"
" ppWaveBank : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pParams, ppWaveBank);
" ppWaveBank : 0x%.08X\n",
pThis, pParams, ppWaveBank);
// TODO: Implement
@ -178,14 +172,12 @@ HRESULT WINAPI XTL::EmuIXACTEngine_CreateSoundBank
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_CreateSoundBank\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pvData : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" ppSoundBank : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pvData, dwSize, ppSoundBank);
" ppSoundBank : 0x%.08X\n",
pThis, pvData, dwSize, ppSoundBank);
// TODO: Implement
@ -210,15 +202,13 @@ HRESULT WINAPI XTL::EmuIXACTEngine_DownloadEffectsImage
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_DownloadEffectsImage\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pvData : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" pEffectLoc : 0x%.08X\n"
" ppImageDesc : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pvData, dwSize, pEffectLoc, ppImageDesc);
" ppImageDesc : 0x%.08X\n",
pThis, pvData, dwSize, pEffectLoc, ppImageDesc);
// TODO: Implement
@ -239,13 +229,11 @@ HRESULT WINAPI XTL::EmuIXACTEngine_CreateSoundSource
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_CreateSoundSource\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" dwFlags : 0x%.08X\n"
" ppSoundSource : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, dwFlags, ppSoundSource);
" ppSoundSource : 0x%.08X\n",
pThis, dwFlags, ppSoundSource);
*ppSoundSource = (X_XACTSoundSource*) CxbxMalloc( sizeof( X_XACTSoundSource ) );
@ -265,12 +253,10 @@ HRESULT WINAPI XTL::EmuIXACTEngine_EnableHeadphones
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_EnableHeadphones\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" fEnabled : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, fEnabled);
" fEnabled : 0x%.08X\n",
pThis, fEnabled);
@ -294,8 +280,7 @@ HRESULT WINAPI XTL::EmuIXACTEngine_SetListenerOrientation
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_SetListenerOrientation\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" xFront : %f"
" yFront : %f"
@ -303,9 +288,8 @@ HRESULT WINAPI XTL::EmuIXACTEngine_SetListenerOrientation
" xTop : %f"
" yTop : %f"
" zTop : %f"
" dwApply : 0x%.08X"
");\n",
GetCurrentThreadId(), pThis, xFront, yFront, zFront, xTop, yTop, zTop, dwApply);
" dwApply : 0x%.08X",
pThis, xFront, yFront, zFront, xTop, yTop, zTop, dwApply);
@ -326,15 +310,13 @@ HRESULT WINAPI XTL::EmuIXACTEngine_SetListenerPosition
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_SetListenerPosition\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" x : %f"
" y : %f"
" z : %f"
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
" dwApply : 0x%.08X\n",
pThis, x, y, z, dwApply);
@ -355,15 +337,13 @@ HRESULT WINAPI XTL::EmuIXACTEngine_SetListenerVelocity
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_SetListenerVelocity\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" x : %f"
" y : %f"
" z : %f"
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
" dwApply : 0x%.08X\n",
pThis, x, y, z, dwApply);
@ -382,13 +362,11 @@ HRESULT WINAPI XTL::EmuIXACTEngine_SetMasterVolume
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_SetMasterVolume\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" wCategory : 0x%.08X\n"
" lVolume : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, wCategory, lVolume);
" lVolume : 0x%.08X\n",
pThis, wCategory, lVolume);
@ -402,11 +380,9 @@ HRESULT WINAPI XTL::EmuIXACTEngine_CommitDeferredSettings(X_XACTEngine* pThis)
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_CommitDeferredSettings\n"
"(\n"
" pThis : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis);
DbgFuncArgs(
" pThis : 0x%.08X\n",
pThis);
@ -425,13 +401,11 @@ HRESULT WINAPI XTL::EmuIXACTSoundBank_GetSoundCueIndexFromFriendlyName
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTSoundBank_GetSoundCueIndexFromFriendlyName\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pFriendlyName : (%s)\n"
" pdwSoundCueIndex : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pFriendlyName, pdwSoundCueIndex);
" pdwSoundCueIndex : 0x%.08X\n",
pThis, pFriendlyName, pdwSoundCueIndex);
@ -452,15 +426,13 @@ HRESULT WINAPI XTL::EmuIXACTSoundBank_Play
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTSoundBank_Play\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" dwSoundCueIndex : 0x%.08X\n"
" pSoundSource : 0x%.08X\n"
" dwFlags : 0x%.08X\n"
" ppSoundCue : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, dwSoundCueIndex, pSoundSource, dwFlags, ppSoundCue);
" ppSoundCue : 0x%.08X\n",
pThis, dwSoundCueIndex, pSoundSource, dwFlags, ppSoundCue);
@ -480,14 +452,12 @@ HRESULT WINAPI XTL::EmuIXACTSoundBank_Stop
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTSoundBank_Stop\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" dwSoundCueIndex : 0x%.08X\n"
" dwFlags : 0x%.08X\n"
" pSoundCue : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, dwSoundCueIndex, dwFlags, pSoundCue);
" pSoundCue : 0x%.08X\n",
pThis, dwSoundCueIndex, dwFlags, pSoundCue);
@ -508,15 +478,13 @@ HRESULT WINAPI XTL::EmuIXACTSoundSource_SetPosition
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTSoundSource_SetPosition\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" x : %f\n"
" y : %f\n"
" z : %f\n"
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
" dwApply : 0x%.08X\n",
pThis, x, y, z, dwApply);
@ -537,15 +505,13 @@ HRESULT WINAPI XTL::EmuIXACTSoundSource_SetVelocity
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTSoundSource_SetVelocity\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" x : %f\n"
" y : %f\n"
" z : %f\n"
" dwApply : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, x, y, z, dwApply);
" dwApply : 0x%.08X\n",
pThis, x, y, z, dwApply);
@ -563,12 +529,10 @@ HRESULT WINAPI XTL::EmuIXACTEngine_RegisterNotification
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_RegisterNotification\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pNotificationDesc : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pNotificationDesc);
" pNotificationDesc : 0x%.08X\n",
pThis, pNotificationDesc);
@ -587,13 +551,11 @@ HRESULT WINAPI XTL::EmuIXACTEngine_GetNotification
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_GetNotification\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pNotificationDesc : 0x%.08X\n"
" pNotification : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pNotificationDesc, pNotification);
" pNotification : 0x%.08X\n",
pThis, pNotificationDesc, pNotification);
// TODO: The contents of XACT_NOTIFICATION can vary from one XDK to the next.
// The definition for 4627 is different than 5558.
@ -614,12 +576,10 @@ HRESULT WINAPI XTL::EmuIXACTEngine_UnRegisterWaveBank
{
DbgPrintf("EmuXactEng (0x%X): EmuIXACTEngine_UnRegisterWaveBank\n"
"(\n"
DbgFuncArgs(
" pThis : 0x%.08X\n"
" pWaveBank : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThis, pWaveBank);
" pWaveBank : 0x%.08X\n",
pThis, pWaveBank);
// Even though the documentation doesn't tell us much, I'm
// assuming that after this function is called, the pointer

View File

@ -84,11 +84,7 @@ XTL::LAUNCH_DATA g_SavedLaunchData;
// ******************************************************************
BOOL WINAPI XTL::EmuXFormatUtilityDrive()
{
#ifdef _DEBUG_TRACE
DbgPrintf("EmuXapi (0x%X): EmuXFormatUtilityDrive()\n", GetCurrentThreadId());
#endif
DbgFuncArgs();
// TODO: yeah... we'll format... riiiiight
@ -105,11 +101,9 @@ DWORD WINAPI XTL::EmuGetTimeZoneInformation
{
DbgPrintf("EmuXapi (0x%X): EmuGetTimeZoneInformation\n"
"(\n"
" lpTimeZoneInformation : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpTimeZoneInformation);
DbgFuncArgs(
" lpTimeZoneInformation : 0x%.08X\n",
lpTimeZoneInformation);
DWORD dwRet = GetTimeZoneInformation(lpTimeZoneInformation);
@ -128,11 +122,9 @@ BOOL WINAPI XTL::EmuQueryPerformanceCounter
{
DbgPrintf("EmuXapi (0x%X): EmuQueryPerformanceCounter\n"
"(\n"
" lpPerformanceCount : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpPerformanceCount);
DbgFuncArgs(
" lpPerformanceCount : 0x%.08X\n",
lpPerformanceCount);
BOOL bRet = QueryPerformanceCounter(lpPerformanceCount);
@ -154,11 +146,9 @@ BOOL WINAPI XTL::EmuQueryPerformanceFrequency
{
DbgPrintf("EmuXapi (0x%X): EmuQueryPerformanceFrequency\n"
"(\n"
" lpFrequency : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpFrequency);
DbgFuncArgs(
" lpFrequency : 0x%.08X\n",
lpFrequency);
BOOL bRet = QueryPerformanceFrequency(lpFrequency);
@ -175,17 +165,9 @@ BOOL WINAPI XTL::EmuXMountUtilityDrive
BOOL fFormatClean
)
{
#ifdef _DEBUG_TRACE
{
DbgPrintf("EmuXapi (0x%X): EmuXMountUtilityDrive\n"
"(\n"
" fFormatClean : 0x%.08X\n"
");\n",
GetCurrentThreadId(), fFormatClean);
}
#endif
DbgFuncArgs(
" fFormatClean : 0x%.08X\n",
fFormatClean);
CxbxMountUtilityDrive(fFormatClean);
@ -203,12 +185,10 @@ VOID WINAPI XTL::EmuXInitDevices
{
DbgPrintf("EmuXapi (0x%X): EmuXInitDevices\n"
"(\n"
DbgFuncArgs(
" dwPreallocTypeCount : 0x%.08X\n"
" PreallocTypes : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwPreallocTypeCount, PreallocTypes);
" PreallocTypes : 0x%.08X\n",
dwPreallocTypeCount, PreallocTypes);
/*for( DWORD i = 0; i < dwPreallocTypeCount; i++ )
{
@ -247,11 +227,9 @@ DWORD WINAPI XTL::EmuXGetDevices
{
DbgPrintf("EmuXapi (0x%X): EmuXGetDevices\n"
"(\n"
" DeviceType : 0x%.08X\n"
");\n",
GetCurrentThreadId(), DeviceType);
DbgFuncArgs(
" DeviceType : 0x%.08X\n",
DeviceType);
DWORD ret = 0;
@ -277,13 +255,11 @@ BOOL WINAPI XTL::EmuXGetDeviceChanges
{
DbgPrintf("EmuXapi (0x%X): EmuXGetDeviceChanges\n"
"(\n"
DbgFuncArgs(
" DeviceType : 0x%.08X\n"
" pdwInsertions : 0x%.08X\n"
" pdwRemovals : 0x%.08X\n"
");\n",
GetCurrentThreadId(), DeviceType, pdwInsertions, pdwRemovals);
" pdwRemovals : 0x%.08X\n",
DeviceType, pdwInsertions, pdwRemovals);
BOOL bRet = FALSE;
static BOOL bFirst = TRUE;
@ -328,14 +304,12 @@ HANDLE WINAPI XTL::EmuXInputOpen
{
DbgPrintf("EmuXapi (0x%X): EmuXInputOpen\n"
"(\n"
DbgFuncArgs(
" DeviceType : 0x%.08X\n"
" dwPort : 0x%.08X\n"
" dwSlot : 0x%.08X\n"
" pPollingParameters : 0x%.08X\n"
");\n",
GetCurrentThreadId(), DeviceType, dwPort, dwSlot, pPollingParameters);
" pPollingParameters : 0x%.08X\n",
DeviceType, dwPort, dwSlot, pPollingParameters);
POLLING_PARAMETERS_HANDLE *pph = 0;
@ -402,11 +376,9 @@ VOID WINAPI XTL::EmuXInputClose
{
DbgPrintf("EmuXapi (0x%X): EmuXInputClose\n"
"(\n"
" hDevice : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice);
DbgFuncArgs(
" hDevice : 0x%.08X\n",
hDevice);
POLLING_PARAMETERS_HANDLE *pph = (POLLING_PARAMETERS_HANDLE*)hDevice;
@ -450,11 +422,9 @@ DWORD WINAPI XTL::EmuXInputPoll
{
DbgPrintf("EmuXapi (0x%X): EmuXInputPoll\n"
"(\n"
" hDevice : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice);
DbgFuncArgs(
" hDevice : 0x%.08X\n",
hDevice);
POLLING_PARAMETERS_HANDLE *pph = (POLLING_PARAMETERS_HANDLE*)hDevice;
@ -511,12 +481,10 @@ DWORD WINAPI XTL::EmuXInputGetCapabilities
{
DbgPrintf("EmuXapi (0x%X): EmuXInputGetCapabilities\n"
"(\n"
DbgFuncArgs(
" hDevice : 0x%.08X\n"
" pCapabilities : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice, pCapabilities);
" pCapabilities : 0x%.08X\n",
hDevice, pCapabilities);
DWORD ret = ERROR_INVALID_HANDLE;
@ -552,12 +520,10 @@ DWORD WINAPI XTL::EmuXInputGetState
{
DbgPrintf("EmuXapi (0x%X): EmuXInputGetState\n"
"(\n"
DbgFuncArgs(
" hDevice : 0x%.08X\n"
" pState : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice, pState);
" pState : 0x%.08X\n",
hDevice, pState);
DWORD ret = ERROR_INVALID_HANDLE;
@ -610,12 +576,10 @@ DWORD WINAPI XTL::EmuXInputSetState
{
DbgPrintf("EmuXapi (0x%X): EmuXInputSetState\n"
"(\n"
DbgFuncArgs(
" hDevice : 0x%.08X\n"
" pFeedback : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice, pFeedback);
" pFeedback : 0x%.08X\n",
hDevice, pFeedback);
DWORD ret = ERROR_IO_PENDING;
@ -693,12 +657,10 @@ BOOL WINAPI XTL::EmuSetThreadPriorityBoost
{
DbgPrintf("EmuXapi (0x%X): EmuSetThreadPriorityBoost\n"
"(\n"
DbgFuncArgs(
" hThread : 0x%.08X\n"
" DisablePriorityBoost: 0x%.08X\n"
");\n",
GetCurrentThreadId(), hThread, DisablePriorityBoost);
" DisablePriorityBoost: 0x%.08X\n",
hThread, DisablePriorityBoost);
BOOL bRet = SetThreadPriorityBoost(hThread, DisablePriorityBoost);
@ -721,12 +683,10 @@ BOOL WINAPI XTL::EmuSetThreadPriority
{
DbgPrintf("EmuXapi (0x%X): EmuSetThreadPriority\n"
"(\n"
DbgFuncArgs(
" hThread : 0x%.08X\n"
" nPriority : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hThread, nPriority);
" nPriority : 0x%.08X\n",
hThread, nPriority);
BOOL bRet = SetThreadPriority(hThread, nPriority);
@ -749,11 +709,9 @@ int WINAPI XTL::EmuGetThreadPriority
{
DbgPrintf("EmuXapi (0x%X): EmuGetThreadPriority\n"
"(\n"
" hThread : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hThread);
DbgFuncArgs(
" hThread : 0x%.08X\n",
hThread);
int iRet = GetThreadPriority(hThread);
@ -776,12 +734,10 @@ BOOL WINAPI XTL::EmuGetExitCodeThread
{
DbgPrintf("EmuXapi (0x%X): EmuGetExitCodeThread\n"
"(\n"
DbgFuncArgs(
" hThread : 0x%.08X\n"
" lpExitCode : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hThread, lpExitCode);
" lpExitCode : 0x%.08X\n",
hThread, lpExitCode);
BOOL bRet = GetExitCodeThread(hThread, lpExitCode);
@ -801,12 +757,10 @@ VOID WINAPI XTL::EmuXapiThreadStartup
{
DbgPrintf("EmuXapi (0x%X): EmuXapiThreadStartup\n"
"(\n"
DbgFuncArgs(
" dwDummy1 : 0x%.08X\n"
" dwDummy2 : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwDummy1, dwDummy2);
" dwDummy2 : 0x%.08X\n",
dwDummy1, dwDummy2);
@ -842,12 +796,10 @@ VOID WINAPI XTL::EmuXRegisterThreadNotifyRoutine
{
DbgPrintf("EmuXapi (0x%X): EmuXRegisterThreadNotifyRoutine\n"
"(\n"
DbgFuncArgs(
" pThreadNotification : 0x%.08X (0x%.08X)\n"
" fRegister : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pThreadNotification, pThreadNotification->pfnNotifyRoutine, fRegister);
" fRegister : 0x%.08X\n",
pThreadNotification, pThreadNotification->pfnNotifyRoutine, fRegister);
if(fRegister)
{
@ -898,13 +850,11 @@ DWORD WINAPI XTL::EmuQueueUserAPC
{
DbgPrintf("EmuXapi (0x%X): EmuQueueUserAPC\n"
"(\n"
DbgFuncArgs(
" pfnAPC : 0x%.08X\n"
" hThread : 0x%.08X\n"
" dwData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pfnAPC, hThread, dwData);
" dwData : 0x%.08X\n",
pfnAPC, hThread, dwData);
DWORD dwRet = 0;
@ -937,14 +887,12 @@ BOOL WINAPI XTL::EmuGetOverlappedResult
{
DbgPrintf("EmuXapi (0x%X): EmuGetOverlappedResult\n"
"(\n"
DbgFuncArgs(
" hFile : 0x%.08X\n"
" lpOverlapped : 0x%.08X\n"
" lpNumberOfBytesTransformed : 0x%.08X\n"
" bWait : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait);
" bWait : 0x%.08X\n",
hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait);
BOOL bRet = GetOverlappedResult( hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait );
@ -967,12 +915,10 @@ DWORD WINAPI XTL::EmuXLaunchNewImage
{
DbgPrintf("EmuXapi (0x%X): EmuXLaunchNewImage\n"
"(\n"
DbgFuncArgs(
" lpTitlePath : 0x%.08X (%s)\n"
" pLaunchData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpTitlePath, lpTitlePath, pLaunchData);
" pLaunchData : 0x%.08X\n",
lpTitlePath, lpTitlePath, pLaunchData);
// If this function succeeds, it doesn't get a chance to return anything.
DWORD dwRet = ERROR_GEN_FAILURE;
@ -984,7 +930,7 @@ DWORD WINAPI XTL::EmuXLaunchNewImage
sprintf(szDashboardPath, "%s\\xboxdash.xbe", symbolicLinkObject->NativePath.c_str());
if (PathFileExists(szDashboardPath)) {
MessageBox(CxbxKrnl_hEmuParent, "The title is rebooting to dashboard", "Cxbx-Reloaded", 0);
MessageBox(CxbxKrnl_hEmuParent, "The title is rebooting to dashboard", "Cxbx", 0);
char szXboxDashboardPath[MAX_PATH];
sprintf(szXboxDashboardPath, "%c:\\xboxdash.xbe", symbolicLinkObject->DriveLetter);
EmuXLaunchNewImage(szXboxDashboardPath, pLaunchData);
@ -1052,12 +998,10 @@ DWORD WINAPI XTL::EmuXGetLaunchInfo
{
DbgPrintf("EmuXapi (0x%X): EmuXGetLaunchInfo\n"
"(\n"
DbgFuncArgs(
" pdwLaunchDataType : 0x%.08X\n"
" pLaunchData : 0x%.08X\n"
");\n",
GetCurrentThreadId(), pdwLaunchDataType, pLaunchData);
" pLaunchData : 0x%.08X\n",
pdwLaunchDataType, pLaunchData);
// The title was launched by turning on the Xbox console with the title disc already in the DVD drive
DWORD dwRet = ERROR_NOT_FOUND;
@ -1121,11 +1065,9 @@ VOID WINAPI XTL::EmuXSetProcessQuantumLength
{
DbgPrintf("EmuXapi (0x%X): EmuXSetProcessQuantumLength\n"
"(\n"
" dwMilliseconds : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwMilliseconds);
DbgFuncArgs(
" dwMilliseconds : 0x%.08X\n",
dwMilliseconds);
// TODO: Implement?
EmuWarning("XSetProcessQuantumLength is being ignored!");
@ -1140,7 +1082,7 @@ DWORD WINAPI XTL::EmuXGetFileCacheSize()
{
DbgPrintf("EmuXapi (0x%X): EmuXGetFileCacheSize()\n", GetCurrentThreadId());
DbgFuncArgs();
// Return the default cache size for now.
// TODO: Save the file cache size if/when set.
@ -1164,14 +1106,12 @@ DWORD WINAPI XTL::EmuSignalObjectAndWait
{
DbgPrintf("EmuXapi (0x%X): EmuSignalObjectAndWait\n"
"(\n"
DbgFuncArgs(
" hObjectToSignal : 0x%.08X\n"
" hObjectToWaitOn : 0x%.08X\n"
" dwMilliseconds : 0x%.08X\n"
" bAlertable : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hObjectToSignal, hObjectToWaitOn, dwMilliseconds, bAlertable);
" bAlertable : 0x%.08X\n",
hObjectToSignal, hObjectToWaitOn, dwMilliseconds, bAlertable);
DWORD dwRet = SignalObjectAndWait( hObjectToSignal, hObjectToWaitOn, dwMilliseconds, bAlertable );
@ -1187,11 +1127,9 @@ BOOL WINAPI XTL::EmuPulseEvent( HANDLE hEvent )
{
DbgPrintf("EmuXapi (0x%X): EmuPulseEvent\n"
"(\n"
" hEvent : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hEvent);
DbgFuncArgs(
" hEvent : 0x%.08X\n",
hEvent);
// TODO: This function might be a bit too high level. If it is,
// feel free to implement NtPulseEvent in EmuKrnl.cpp
@ -1217,15 +1155,13 @@ MMRESULT WINAPI XTL::EmutimeSetEvent
{
DbgPrintf("EmuXapi (0x%X): EmutimeSetEvent\n"
"(\n"
DbgFuncArgs(
" uDelay : 0x%.08X\n"
" uResolution : 0x%.08X\n"
" fptc : 0x%.08X\n"
" dwUser : 0x%.08X\n"
" fuEvent : 0x%.08X\n"
");\n",
GetCurrentThreadId(), uDelay, uResolution, fptc, dwUser, fuEvent);
" fuEvent : 0x%.08X\n",
uDelay, uResolution, fptc, dwUser, fuEvent);
MMRESULT Ret = timeSetEvent( uDelay, uResolution, fptc, (DWORD_PTR) dwUser, fuEvent );
@ -1244,11 +1180,9 @@ MMRESULT WINAPI XTL::EmutimeKillEvent
{
DbgPrintf("EmuXapi (0x%X): EmuReleaseSemaphore\n"
"(\n"
" uTimerID : 0x%.08X\n"
");\n",
GetCurrentThreadId(), uTimerID);
DbgFuncArgs(
" uTimerID : 0x%.08X\n",
uTimerID);
MMRESULT Ret = timeKillEvent( uTimerID );
@ -1270,14 +1204,12 @@ VOID WINAPI XTL::EmuRaiseException
{
DbgPrintf("EmuXapi (0x%X): EmuRaiseException\n"
"(\n"
DbgFuncArgs(
" dwExceptionCode : 0x%.08X\n"
" dwExceptionFlags : 0x%.08X\n"
" nNumberOfArguments: 0x%.08X\n"
" lpArguments : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwExceptionCode, dwExceptionFlags, nNumberOfArguments, lpArguments);
" lpArguments : 0x%.08X\n",
dwExceptionCode, dwExceptionFlags, nNumberOfArguments, lpArguments);
// TODO: Implement or not?
// RaiseException(dwExceptionCode, dwExceptionFlags, nNumberOfArguments, (*(ULONG_PTR**) &lpArguments));
@ -1295,11 +1227,9 @@ DWORD WINAPI XTL::EmuGetFileAttributesA
{
DbgPrintf("EmuXapi (0x%X): EmuGetFileAttributesA\n"
"(\n"
" lpFileName : (%s)\n"
");\n",
GetCurrentThreadId(), lpFileName);
DbgFuncArgs(
" lpFileName : (%s)\n",
lpFileName);
// Dues Ex...
@ -1338,13 +1268,11 @@ DWORD WINAPI XTL::EmuXMountMUA
{
DbgPrintf("EmuXapi (0x%X): EmuXMountMUA\n"
"(\n"
DbgFuncArgs(
" dwPort : 0x%.08X\n"
" dwSlot : 0x%.08X\n"
" pchDrive : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), dwPort, dwSlot, pchDrive, pchDrive);
" pchDrive : 0x%.08X (%s)\n",
dwPort, dwSlot, pchDrive, pchDrive);
// TODO: Actually allow memory card emulation? This might make transferring
// game saves a bit easier if the memory card directory was configurable. =]
@ -1366,13 +1294,11 @@ HANDLE WINAPI XTL::EmuCreateWaitableTimerA
{
DbgPrintf("EmuXapi (0x%X): EmuCreateWaitableTimerA\n"
"(\n"
DbgFuncArgs(
" lpTimerAttributes : 0x%.08X\n"
" bManualReset : 0x%.08X\n"
" lpTimerName : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), lpTimerAttributes, bManualReset, lpTimerName, lpTimerName);
" lpTimerName : 0x%.08X (%s)\n",
lpTimerAttributes, bManualReset, lpTimerName, lpTimerName);
// For Xbox titles, this param should always be NULL.
if(lpTimerAttributes)
@ -1401,16 +1327,14 @@ BOOL WINAPI XTL::EmuSetWaitableTimer
DbgPrintf("EmuXapi (0x%X): EmuSetWaitableTimer\n"
"(\n"
DbgFuncArgs(
" hTimer : 0x%.08X\n"
" pDueTime : 0x%.08X\n"
" lPeriod : 0x%.08X\n"
" pfnCompletionRoutine : 0x%.08X\n"
" lpArgToCompletionRoutine : 0x%.08X\n"
" fResume : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hTimer, pDueTime, lPeriod, pfnCompletionRoutine,
" fResume : 0x%.08X\n",
hTimer, pDueTime, lPeriod, pfnCompletionRoutine,
lpArgToCompletionRoutine, fResume);
BOOL Ret = SetWaitableTimer( hTimer, pDueTime, lPeriod, pfnCompletionRoutine,
@ -1435,13 +1359,11 @@ DWORD WINAPI XTL::EmuXMountAlternateTitle
{
DbgPrintf("EmuXapi (0x%X): EmuXMountAlternateTitle\n"
"(\n"
DbgFuncArgs(
" lpRootPath : 0x%.08X (%s)\n"
" dwAltTitleId : 0x%.08X\n"
" pchDrive : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), lpRootPath, lpRootPath, dwAltTitleId, pchDrive, pchDrive);
" pchDrive : 0x%.08X (%s)\n",
lpRootPath, lpRootPath, dwAltTitleId, pchDrive, pchDrive);
// TODO: Anything?
@ -1457,11 +1379,9 @@ DWORD WINAPI XTL::EmuXUnmountAlternateTitle(CHAR chDrive)
{
DbgPrintf("EmuXapi (0x%X): EmuXUnmountAlternativeTitle\n"
"(\n"
" chDrive : 0x%.08X (%c)\n"
");\n",
GetCurrentThreadId(), chDrive, chDrive);
DbgFuncArgs(
" chDrive : 0x%.08X (%c)\n",
chDrive, chDrive);
@ -1475,7 +1395,7 @@ DWORD WINAPI XTL::EmuXGetDeviceEnumerationStatus()
{
DbgPrintf("EmuXapi (0x%X): EmuXGetDeviceEnumerationStatus()\n", GetCurrentThreadId());
DbgFuncArgs();
@ -1493,12 +1413,10 @@ DWORD WINAPI XTL::EmuXInputGetDeviceDescription
{
DbgPrintf("EmuXapi (0x%X): EmuXInputGetDeviceDescription\n"
"(\n"
DbgFuncArgs(
" hDevice : 0x%.08X\n"
" pDescription : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hDevice, pDescription);
" pDescription : 0x%.08X\n",
hDevice, pDescription);
// TODO: Lightgun support?
@ -1514,8 +1432,8 @@ int WINAPI XTL::EmuXAutoPowerDownResetTimer()
{
DbgPrintf("EmuXapi (0x%X): EmuXAutoPowerDownResetTimer()\n",
GetCurrentThreadId());
DbgFuncArgs();
// Meh, that's what the 'X' is for! =]
@ -1537,13 +1455,11 @@ DWORD WINAPI XTL::EmuXMountMURootA
DbgPrintf("EmuXapi (0x%X): EmuXMountMURootA\n"
"(\n"
DbgFuncArgs(
" dwPort : 0x%.08X\n"
" dwSlot : 0x%.08X\n"
" pchDrive : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), dwPort, dwSlot, pchDrive, pchDrive);
" pchDrive : 0x%.08X (%s)\n",
dwPort, dwSlot, pchDrive, pchDrive);
// TODO: The params are probably wrong...