EmuWarning

This commit is contained in:
Aaron Robinson 2003-07-23 00:12:42 +00:00
parent 3ba7d36068
commit 708b60c1fe
5 changed files with 52 additions and 7 deletions

View File

@ -62,6 +62,7 @@ typedef signed long sint32;
// * Define this to trace intercepted function calls
// ******************************************************************
#define _DEBUG_TRACE
#define _DEBUG_WARNINGS
// ******************************************************************
// * Version information

View File

@ -54,6 +54,15 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit(void *pTLSData, Xbe::TLS *pTLS, Xbe::
// ******************************************************************
extern "C" CXBXKRNL_API void NTAPI EmuCleanThread();
// ******************************************************************
// * func: EmuWarning
// ******************************************************************
#ifdef _DEBUG_WARNINGS
extern "C" CXBXKRNL_API void NTAPI EmuWarning(const char *szWarningMessage, ...);
#else
inline void NTAPI EmuWarning(const char *szWarningMessage, ...) { }
#endif
// ******************************************************************
// * func: EmuCleanup
// ******************************************************************

View File

@ -448,7 +448,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
else
{
XTL::EmuD3DDeferredRenderState = 0;
printf("Emu (0x%X): *Warning* EmuD3DDeferredRenderState not found!\n", GetCurrentThreadId());
EmuWarning("EmuD3DDeferredRenderState was not found!");
}
// ******************************************************************
@ -477,7 +477,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
else
{
XTL::EmuD3DDeferredTextureState = 0;
printf("Emu (0x%X): *Warning* EmuD3DDeferredTextureState not found!\n", GetCurrentThreadId());
EmuWarning("EmuD3DDeferredTextureState was not found!");
}
}
}
@ -536,6 +536,38 @@ extern "C" CXBXKRNL_API void NTAPI EmuInit
return;
}
// ******************************************************************
// * func: EmuWarning
// ******************************************************************
#ifdef _DEBUG_WARNINGS
extern "C" CXBXKRNL_API void NTAPI EmuWarning(const char *szWarningMessage, ...)
{
if(szWarningMessage == NULL)
return;
char szBuffer1[255];
char szBuffer2[255];
va_list argp;
sprintf(szBuffer1, "Emu (0x%X): *WARNING* -> ", GetCurrentThreadId());
va_start(argp, szWarningMessage);
vsprintf(szBuffer2, szWarningMessage, argp);
va_end(argp);
strcat(szBuffer1, szBuffer2);
printf("%s\n", szBuffer1);
fflush(stdout);
return;
}
#endif
// ******************************************************************
// * func: EmuCleanup
// ******************************************************************

View File

@ -485,7 +485,7 @@ HRESULT WINAPI XTL::EmuIDirect3D8_CreateDevice
// * verify no ugly circumstances
// ******************************************************************
if(pPresentationParameters->BufferSurfaces[0] != NULL || pPresentationParameters->DepthStencilSurface != NULL)
printf("*Warning* DepthStencilSurface != NULL and/or BufferSurfaces[0] != NULL\n");
EmuWarning("DepthStencilSurface != NULL and/or BufferSurfaces[0] != NULL");
// ******************************************************************
// * make adjustments to parameters to make sense with windows d3d
@ -517,7 +517,7 @@ HRESULT WINAPI XTL::EmuIDirect3D8_CreateDevice
// TODO: Support Xbox extensions if possible
if(pPresentationParameters->MultiSampleType != 0)
{
printf("*Warning* MultiSampleType (0x%.08X) Not Supported!\n", pPresentationParameters->MultiSampleType);
EmuWarning("MultiSampleType 0x%.08X is not supported!", pPresentationParameters->MultiSampleType);
pPresentationParameters->MultiSampleType = D3DMULTISAMPLE_NONE;
@ -1056,7 +1056,7 @@ XTL::X_D3DSurface* WINAPI XTL::EmuIDirect3DDevice8_GetBackBuffer2
if(FAILED(hRet))
{
printf("*Warning* Could not retrieve primary surface, using backbuffer\n");
EmuWarning("Could not retrieve primary surface, using backbuffer");
pBackBuffer->EmuSurface8->Release();
pBackBuffer->EmuSurface8 = 0;
BackBuffer = 0;
@ -1415,7 +1415,7 @@ HRESULT WINAPI XTL::EmuIDirect3DDevice8_CreateVertexShader
if(FAILED(hRet))
{
printf("*Warning* we're lying about the creation of a vertex shader!\n");
EmuWarning("VertexShader was not really created!\n");
hRet = D3D_OK;
}

View File

@ -284,7 +284,7 @@ XBSYSAPI EXPORTNUM(37) xboxkrnl::LONG NTAPI xboxkrnl::FscSetCacheSize(ULONG uCac
}
#endif
printf("*Warning* FscSetCacheSize is being ignored\n");
EmuWarning("FscSetCacheSize is being ignored");
EmuSwapFS(); // Xbox FS
@ -1149,6 +1149,9 @@ XBSYSAPI EXPORTNUM(190) NTSTATUS NTAPI xboxkrnl::NtCreateFile
(NtDll::LARGE_INTEGER*)AllocationSize, FileAttributes, ShareAccess, CreateDisposition, CreateOptions, NULL, NULL
);
if(FAILED(ret))
EmuWarning("NtCreateFile Failed (0x%.08X)", ret);
// ******************************************************************
// * Restore original buffer
// ******************************************************************