DbgPrintf and EmuWarning updates; Changed one into the other where applicable, prefixed GetCurrentThreadId() centrally, removed or added newlines where required.
This commit is contained in:
parent
0f8ee7d7dc
commit
bf7a74b248
|
@ -147,7 +147,7 @@ extern thread_local std::string _logPrefix;
|
||||||
do { if(g_bPrintfOn) { \
|
do { if(g_bPrintfOn) { \
|
||||||
bool _had_arg = false; \
|
bool _had_arg = false; \
|
||||||
std::stringstream tmp; \
|
std::stringstream tmp; \
|
||||||
tmp << __FILENAME__ << " (" << hex2((uint16_t)GetCurrentThreadId()) << "): "; \
|
tmp << "[" << hex2((uint16_t)GetCurrentThreadId()) << "] " << __FILENAME__ << ": "; \
|
||||||
_logPrefix = tmp.str(); \
|
_logPrefix = tmp.str(); \
|
||||||
std::stringstream msg; \
|
std::stringstream msg; \
|
||||||
msg << _logPrefix << __func__ << "(";
|
msg << _logPrefix << __func__ << "(";
|
||||||
|
|
|
@ -106,7 +106,7 @@ extern volatile bool g_bPrintfOn;
|
||||||
|
|
||||||
/*! DbgPrintf enabled if _DEBUG_TRACE is set */
|
/*! DbgPrintf enabled if _DEBUG_TRACE is set */
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
#define DbgPrintf(fmt, ...) do { if(g_bPrintfOn) printf(fmt, ##__VA_ARGS__); } while (0)
|
#define DbgPrintf(fmt, ...) do { if(g_bPrintfOn) printf("[0x%X] "##fmt, GetCurrentThreadId(), ##__VA_ARGS__); } while (0)
|
||||||
#else
|
#else
|
||||||
inline void null_func(...) { }
|
inline void null_func(...) { }
|
||||||
#define DbgPrintf null_func
|
#define DbgPrintf null_func
|
||||||
|
|
|
@ -397,8 +397,8 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
|
|
||||||
SetConsoleTextAttribute(StdHandle, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
|
SetConsoleTextAttribute(StdHandle, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
|
||||||
|
|
||||||
printf("EmuMain (0x%X): Cxbx-Reloaded Version %s\n", GetCurrentThreadId(), _CXBX_VERSION);
|
printf("[0x%X] EmuMain: Cxbx-Reloaded Version %s\n", GetCurrentThreadId(), _CXBX_VERSION);
|
||||||
printf("EmuMain (0x%X): Debug Console Allocated (DM_CONSOLE).\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Debug Console Allocated (DM_CONSOLE).\n", GetCurrentThreadId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (DbgMode == DM_FILE)
|
else if (DbgMode == DM_FILE)
|
||||||
|
@ -407,8 +407,8 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
|
|
||||||
freopen(szDebugFilename, "wt", stdout);
|
freopen(szDebugFilename, "wt", stdout);
|
||||||
|
|
||||||
printf("EmuMain (0x%X): Cxbx-Reloaded Version %s\n", GetCurrentThreadId(), _CXBX_VERSION);
|
printf("[0x%X] EmuMain: Cxbx-Reloaded Version %s\n", GetCurrentThreadId(), _CXBX_VERSION);
|
||||||
printf("EmuMain (0x%X): Debug Console Allocated (DM_FILE).\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Debug Console Allocated (DM_FILE).\n", GetCurrentThreadId());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -426,9 +426,9 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
|
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
printf("EmuMain (0x%X): Debug Trace Enabled.\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Debug Trace Enabled.\n", GetCurrentThreadId());
|
||||||
|
|
||||||
printf("EmuMain (0x%X): CxbxKrnlInit\n"
|
printf("[0x%X] EmuMain: CxbxKrnlInit\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" hwndParent : 0x%.08X\n"
|
" hwndParent : 0x%.08X\n"
|
||||||
" pTLSData : 0x%.08X\n"
|
" pTLSData : 0x%.08X\n"
|
||||||
|
@ -443,7 +443,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
GetCurrentThreadId(), hwndParent, pTLSData, pTLS, pLibraryVersion, DbgMode, szDebugFilename, pXbeHeader, dwXbeHeaderSize, Entry);
|
GetCurrentThreadId(), hwndParent, pTLSData, pTLS, pLibraryVersion, DbgMode, szDebugFilename, pXbeHeader, dwXbeHeaderSize, Entry);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
printf("EmuMain (0x%X): Debug Trace Disabled.\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Debug Trace Disabled.\n", GetCurrentThreadId());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,17 +599,17 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
//
|
//
|
||||||
// initialize grapchics
|
// initialize grapchics
|
||||||
//
|
//
|
||||||
DbgPrintf("EmuMain (0x%X): Initializing render window.\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: Initializing render window.\n");
|
||||||
XTL::CxbxInitWindow(pXbeHeader, dwXbeHeaderSize);
|
XTL::CxbxInitWindow(pXbeHeader, dwXbeHeaderSize);
|
||||||
|
|
||||||
if (bLLE_GPU)
|
if (bLLE_GPU)
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuMain (0x%X): Initializing OpenGL.\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: Initializing OpenGL.\n");
|
||||||
InitOpenGLContext();
|
InitOpenGLContext();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuMain (0x%X): Initializing Direct3D.\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: Initializing Direct3D.\n");
|
||||||
XTL::EmuD3DInit(pXbeHeader, dwXbeHeaderSize);
|
XTL::EmuD3DInit(pXbeHeader, dwXbeHeaderSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,11 +627,11 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
||||||
|
|
||||||
EmuX86_Init();
|
EmuX86_Init();
|
||||||
|
|
||||||
DbgPrintf("EmuMain (0x%X): Initial thread starting.\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: Initial thread starting.\n");
|
||||||
|
|
||||||
CxbxLaunchXbe(Entry);
|
CxbxLaunchXbe(Entry);
|
||||||
|
|
||||||
DbgPrintf("EmuMain (0x%X): Initial thread ended.\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: Initial thread ended.\n");
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
@ -654,7 +654,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlCleanup(const char *szErrorMessage, ...)
|
||||||
|
|
||||||
va_list argp;
|
va_list argp;
|
||||||
|
|
||||||
sprintf(szBuffer1, "EmuMain (0x%X): Recieved Fatal Message:\n\n* ", GetCurrentThreadId());
|
sprintf(szBuffer1, "[0x%X] EmuMain: Recieved Fatal Message:\n\n* ", GetCurrentThreadId());
|
||||||
|
|
||||||
va_start(argp, szErrorMessage);
|
va_start(argp, szErrorMessage);
|
||||||
|
|
||||||
|
@ -796,12 +796,12 @@ extern "C" CXBXKRNL_API void CxbxKrnlTerminateThread()
|
||||||
|
|
||||||
extern "C" CXBXKRNL_API void CxbxKrnlPanic()
|
extern "C" CXBXKRNL_API void CxbxKrnlPanic()
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuMain (0x%X): CxbxKrnlPanic()\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: CxbxKrnlPanic()\n");
|
||||||
|
|
||||||
CxbxKrnlCleanup("Kernel Panic!");
|
CxbxKrnlCleanup("Kernel Panic!");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CXBXKRNL_API void CxbxKrnlNoFunc()
|
extern "C" CXBXKRNL_API void CxbxKrnlNoFunc()
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuMain (0x%X): CxbxKrnlNoFunc()\n", GetCurrentThreadId());
|
DbgPrintf("EmuMain: CxbxKrnlNoFunc()\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ extern "C" CXBXKRNL_API void NTAPI EmuWarning(const char *szWarningMessage, ...)
|
||||||
|
|
||||||
va_list argp;
|
va_list argp;
|
||||||
|
|
||||||
sprintf(szBuffer1, "EmuWarn (0x%X): ", GetCurrentThreadId());
|
sprintf(szBuffer1, "[0x%X] EmuWarn: ", GetCurrentThreadId());
|
||||||
|
|
||||||
va_start(argp, szWarningMessage);
|
va_start(argp, szWarningMessage);
|
||||||
|
|
||||||
|
@ -150,9 +150,9 @@ void EmuExceptionPrintDebugInformation(LPEXCEPTION_POINTERS e, bool IsBreakpoint
|
||||||
// print debug information
|
// print debug information
|
||||||
{
|
{
|
||||||
if (IsBreakpointException)
|
if (IsBreakpointException)
|
||||||
printf("EmuMain (0x%X): Recieved Breakpoint Exception (int 3)\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Recieved Breakpoint Exception (int 3)\n", GetCurrentThreadId());
|
||||||
else
|
else
|
||||||
printf("EmuMain (0x%X): Recieved Exception (Code := 0x%.08X)\n", GetCurrentThreadId(), e->ExceptionRecord->ExceptionCode);
|
printf("[0x%X] EmuMain: Recieved Exception (Code := 0x%.08X)\n", GetCurrentThreadId(), e->ExceptionRecord->ExceptionCode);
|
||||||
|
|
||||||
printf("\n"
|
printf("\n"
|
||||||
" EIP := 0x%.08X EFL := 0x%.08X\n"
|
" EIP := 0x%.08X EFL := 0x%.08X\n"
|
||||||
|
@ -176,7 +176,7 @@ void EmuExceptionPrintDebugInformation(LPEXCEPTION_POINTERS e, bool IsBreakpoint
|
||||||
|
|
||||||
void EmuExceptionExitProcess()
|
void EmuExceptionExitProcess()
|
||||||
{
|
{
|
||||||
printf("EmuMain (0x%X): Aborting Emulation\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Aborting Emulation\n", GetCurrentThreadId());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
if (CxbxKrnl_hEmuParent != NULL)
|
if (CxbxKrnl_hEmuParent != NULL)
|
||||||
|
@ -205,7 +205,7 @@ bool EmuExceptionBreakpointAsk(LPEXCEPTION_POINTERS e)
|
||||||
}
|
}
|
||||||
else if (ret == IDIGNORE)
|
else if (ret == IDIGNORE)
|
||||||
{
|
{
|
||||||
printf("EmuMain (0x%X): Ignored Breakpoint Exception\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: Ignored Breakpoint Exception\n", GetCurrentThreadId());
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
e->ContextRecord->Eip += 1; // TODO : Skip actual instruction size bytes
|
e->ContextRecord->Eip += 1; // TODO : Skip actual instruction size bytes
|
||||||
|
@ -298,9 +298,9 @@ int ExitException(LPEXCEPTION_POINTERS e)
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
|
|
||||||
// debug information
|
// debug information
|
||||||
printf("EmuMain (0x%X): * * * * * EXCEPTION * * * * *\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: * * * * * EXCEPTION * * * * *\n", GetCurrentThreadId());
|
||||||
printf("EmuMain (0x%X): Recieved Exception [0x%.08X]@0x%.08X\n", GetCurrentThreadId(), e->ExceptionRecord->ExceptionCode, e->ContextRecord->Eip);
|
printf("[0x%X] EmuMain: Recieved Exception [0x%.08X]@0x%.08X\n", GetCurrentThreadId(), e->ExceptionRecord->ExceptionCode, e->ContextRecord->Eip);
|
||||||
printf("EmuMain (0x%X): * * * * * EXCEPTION * * * * *\n", GetCurrentThreadId());
|
printf("[0x%X] EmuMain: * * * * * EXCEPTION * * * * *\n", GetCurrentThreadId());
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -804,7 +804,7 @@ HRESULT XTL::CreatePixelShaderFunction(X_D3DPIXELSHADERDEF *pPSD, LPD3DXBUFFER*
|
||||||
|
|
||||||
if (FAILED(hRet))
|
if (FAILED(hRet))
|
||||||
{
|
{
|
||||||
EmuWarning("Couldn't assemble recompiled pixel shader\n");
|
EmuWarning("Couldn't assemble recompiled pixel shader");
|
||||||
if (pCompilationErrors)
|
if (pCompilationErrors)
|
||||||
{
|
{
|
||||||
EmuWarning((const char*)pCompilationErrors->GetBufferPointer());
|
EmuWarning((const char*)pCompilationErrors->GetBufferPointer());
|
||||||
|
@ -813,7 +813,7 @@ HRESULT XTL::CreatePixelShaderFunction(X_D3DPIXELSHADERDEF *pPSD, LPD3DXBUFFER*
|
||||||
}
|
}
|
||||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
DbgPrintf("Pixel Shader : Exception while creating pixel shader 0x%.8X", pPSD);
|
DbgPrintf("Pixel Shader : Exception while creating pixel shader 0x%.8X\n", pPSD);
|
||||||
}
|
}
|
||||||
if (pCompilationErrors)
|
if (pCompilationErrors)
|
||||||
{
|
{
|
||||||
|
@ -1426,7 +1426,7 @@ inline void HandleInputOutput
|
||||||
|
|
||||||
if (bEFProduct)
|
if (bEFProduct)
|
||||||
{
|
{
|
||||||
EmuWarning("EF Product and V1R0 register used at the same time!\n");
|
EmuWarning("EF Product and V1R0 register used at the same time!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1947,7 +1947,7 @@ inline BOOL OptimizeOperation
|
||||||
{
|
{
|
||||||
if (szMod[0])
|
if (szMod[0])
|
||||||
{
|
{
|
||||||
EmuWarning("Pixel Shader: Destination modifier present!\n");
|
EmuWarning("Pixel Shader: Destination modifier present!");
|
||||||
}
|
}
|
||||||
switch (eOpTypes[2])
|
switch (eOpTypes[2])
|
||||||
{
|
{
|
||||||
|
@ -2072,7 +2072,7 @@ inline BOOL OptimizeOperation
|
||||||
{
|
{
|
||||||
if (szOutputs[2][0] != 'r')
|
if (szOutputs[2][0] != 'r')
|
||||||
{
|
{
|
||||||
EmuWarning("Pixel Shader: Destination not temporary register!\n");
|
EmuWarning("Pixel Shader: Destination not temporary register!");
|
||||||
}
|
}
|
||||||
// ab input
|
// ab input
|
||||||
iOffset += sprintf(szCommand + iOffset, "mul%s r1, %s, %s\n",
|
iOffset += sprintf(szCommand + iOffset, "mul%s r1, %s, %s\n",
|
||||||
|
@ -2404,7 +2404,7 @@ inline BOOL OptimizeOperation
|
||||||
}
|
}
|
||||||
if (!bHandled)
|
if (!bHandled)
|
||||||
{
|
{
|
||||||
EmuWarning("Unhandled pixel shader instruction!\n");
|
EmuWarning("Unhandled pixel shader instruction!");
|
||||||
}
|
}
|
||||||
// if (strcmp(szOps[2], "add") == 0)
|
// if (strcmp(szOps[2], "add") == 0)
|
||||||
// {
|
// {
|
||||||
|
@ -2418,7 +2418,7 @@ inline BOOL OptimizeOperation
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// EmuWarning("Unhandled pixel shader instruction!\n");
|
// EmuWarning("Unhandled pixel shader instruction!");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// else if (strcmp(szOps[2], "cnd") == 0)
|
// else if (strcmp(szOps[2], "cnd") == 0)
|
||||||
|
@ -2433,12 +2433,12 @@ inline BOOL OptimizeOperation
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// EmuWarning("Unhandled pixel shader instruction!\n");
|
// EmuWarning("Unhandled pixel shader instruction!");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// EmuWarning("Unhandled pixel shader instruction!\n");
|
// EmuWarning("Unhandled pixel shader instruction!");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,7 +534,7 @@ static void VshParseInstruction(uint32 *pShaderToken,
|
||||||
pInstruction->A.Address = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST));
|
pInstruction->A.Address = ConvertCRegister(VshGetField(pShaderToken, FLD_CONST));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
EmuWarning("Invalid instruction, parameter A type unknown %d\n", pInstruction->A.ParameterType);
|
EmuWarning("Invalid instruction, parameter A type unknown %d", pInstruction->A.ParameterType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pInstruction->A.Neg = VshGetField(pShaderToken, FLD_A_NEG);
|
pInstruction->A.Neg = VshGetField(pShaderToken, FLD_A_NEG);
|
||||||
|
@ -1300,7 +1300,7 @@ static boolean VshConvertShader(VSH_XBOX_SHADER *pShader,
|
||||||
if(pIntermediate->Output.Type != IMD_OUTPUT_R)
|
if(pIntermediate->Output.Type != IMD_OUTPUT_R)
|
||||||
{
|
{
|
||||||
// TODO: Complete dph support
|
// TODO: Complete dph support
|
||||||
EmuWarning("Can't simulate dph for other than output r registers (yet)\n");
|
EmuWarning("Can't simulate dph for other than output r registers (yet)");
|
||||||
|
|
||||||
// attempt to find unused register...
|
// attempt to find unused register...
|
||||||
int outRegister = -1;
|
int outRegister = -1;
|
||||||
|
@ -1573,7 +1573,7 @@ static void VshConvertToken_NOP(DWORD *pToken)
|
||||||
// D3DVSD_NOP
|
// D3DVSD_NOP
|
||||||
if(*pToken != DEF_VSH_NOP)
|
if(*pToken != DEF_VSH_NOP)
|
||||||
{
|
{
|
||||||
EmuWarning("Token NOP found, but extra parameters are given!\n");
|
EmuWarning("Token NOP found, but extra parameters are given!");
|
||||||
}
|
}
|
||||||
DbgVshPrintf("\tD3DVSD_NOP(),\n");
|
DbgVshPrintf("\tD3DVSD_NOP(),\n");
|
||||||
}
|
}
|
||||||
|
@ -1882,7 +1882,7 @@ static void VshConvertToken_STREAMDATA_REG(DWORD *pToken,
|
||||||
|
|
||||||
if(NewDataType == 0xFF)
|
if(NewDataType == 0xFF)
|
||||||
{
|
{
|
||||||
EmuWarning("/* WARNING: Fatal type mismatch, no fitting type! */\n");
|
EmuWarning("/* WARNING: Fatal type mismatch, no fitting type! */");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2046,7 +2046,7 @@ extern HRESULT XTL::EmuRecompileVshFunction
|
||||||
hRet = E_FAIL;
|
hRet = E_FAIL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
EmuWarning("Unknown vertex shader version 0x%02X\n", pShaderHeader->Version);
|
EmuWarning("Unknown vertex shader version 0x%02X", pShaderHeader->Version);
|
||||||
hRet = E_FAIL;
|
hRet = E_FAIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2104,8 +2104,8 @@ extern HRESULT XTL::EmuRecompileVshFunction
|
||||||
|
|
||||||
if (FAILED(hRet))
|
if (FAILED(hRet))
|
||||||
{
|
{
|
||||||
EmuWarning("Couldn't assemble recompiled vertex shader\n");
|
EmuWarning("Couldn't assemble recompiled vertex shader");
|
||||||
EmuWarning("%s\n", pErrors->GetBufferPointer());
|
EmuWarning("%s", pErrors->GetBufferPointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pErrors )
|
if( pErrors )
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -358,26 +358,27 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
|
||||||
#ifdef _DEBUG_TRACE
|
#ifdef _DEBUG_TRACE
|
||||||
if (pNewTLS == 0)
|
if (pNewTLS == 0)
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuFS (0x%X): TLS Non-Existant (OK)\n", GetCurrentThreadId());
|
DbgPrintf("EmuFS: TLS Non-Existant (OK)\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuFS (0x%X): TLS Data Dump...\n", GetCurrentThreadId());
|
DbgPrintf("EmuFS: TLS Data Dump...\n");
|
||||||
DbgPrintf("EmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), pNewTLS);
|
DbgPrintf("EmuFS: 0x%.08X: ", pNewTLS);
|
||||||
|
|
||||||
uint32 stop = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr + pTLS->dwSizeofZeroFill;
|
uint32 stop = pTLS->dwDataEndAddr - pTLS->dwDataStartAddr + pTLS->dwSizeofZeroFill;
|
||||||
|
|
||||||
|
// Note : Use printf instead of DbgPrintf here, which prefixes with GetCurrentThreadId() :
|
||||||
for (uint32 v = 0;v<stop;v++)
|
for (uint32 v = 0;v<stop;v++)
|
||||||
{
|
{
|
||||||
uint08 *bByte = (uint08*)pNewTLS + v;
|
uint08 *bByte = (uint08*)pNewTLS + v;
|
||||||
|
|
||||||
DbgPrintf("%.01X", (uint32)*bByte);
|
if (g_bPrintfOn) printf("%.01X", (uint32)*bByte);
|
||||||
|
|
||||||
if ((v + 1) % 0x10 == 0 && v + 1<stop)
|
if ((v + 1) % 0x10 == 0 && v + 1<stop)
|
||||||
DbgPrintf("\nEmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), ((uint32)pNewTLS + v));
|
if (g_bPrintfOn) printf("\nEmuFS (0x%X): 0x%.08X: ", GetCurrentThreadId(), ((uint32)pNewTLS + v));
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrintf("\n");
|
if (g_bPrintfOn) printf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -435,5 +436,5 @@ void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
|
||||||
mov fs : [0x14], eax
|
mov fs : [0x14], eax
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrintf("EmuFS (0x%X): OrgFS=%d NewFS=%d pTLS=0x%.08X\n", GetCurrentThreadId(), OrgFS, NewFS, pTLS);
|
DbgPrintf("EmuFS: OrgFS=%d NewFS=%d pTLS=0x%.08X\n", OrgFS, NewFS, pTLS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,11 +280,11 @@ XBSYSAPI EXPORTNUM(66) xboxkrnl::NTSTATUS NTAPI xboxkrnl::IoCreateFile
|
||||||
|
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuKrnl (0x%X): IoCreateFile Failed! (0x%.08X)\n", GetCurrentThreadId(), ret);
|
EmuWarning("EmuKrnl: IoCreateFile Failed! (0x%.08X)\n", ret);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuKrnl (0x%X): IoCreateFile = 0x%.08X\n", GetCurrentThreadId(), *FileHandle);
|
DbgPrintf("EmuKrnl: IoCreateFile = 0x%.08X\n", *FileHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
|
|
|
@ -180,7 +180,7 @@ XBSYSAPI EXPORTNUM(168) xboxkrnl::PVOID NTAPI xboxkrnl::MmClaimGpuInstanceMemory
|
||||||
MI_CONVERT_PFN_TO_PHYSICAL(MM_INSTANCE_PHYSICAL_PAGE + MM_INSTANCE_PAGE_COUNT);
|
MI_CONVERT_PFN_TO_PHYSICAL(MM_INSTANCE_PHYSICAL_PAGE + MM_INSTANCE_PAGE_COUNT);
|
||||||
// Chihiro arcade should use *NumberOfPaddingBytes = 0;
|
// Chihiro arcade should use *NumberOfPaddingBytes = 0;
|
||||||
|
|
||||||
EmuWarning("*NumberOfPaddingBytes = 0x%08X\n", *NumberOfPaddingBytes);
|
EmuWarning("*NumberOfPaddingBytes = 0x%08X", *NumberOfPaddingBytes);
|
||||||
|
|
||||||
if (NumberOfBytes != MAXULONG_PTR)
|
if (NumberOfBytes != MAXULONG_PTR)
|
||||||
{
|
{
|
||||||
|
@ -238,7 +238,7 @@ XBSYSAPI EXPORTNUM(169) xboxkrnl::PVOID NTAPI xboxkrnl::MmCreateKernelStack
|
||||||
/*Protect=*/PAGE_READWRITE);
|
/*Protect=*/PAGE_READWRITE);
|
||||||
|
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("MmCreateKernelStack failed!\n");
|
EmuWarning("MmCreateKernelStack failed!");
|
||||||
else
|
else
|
||||||
BaseAddress = (PVOID)((ULONG)BaseAddress + NumberOfBytes);
|
BaseAddress = (PVOID)((ULONG)BaseAddress + NumberOfBytes);
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ XBSYSAPI EXPORTNUM(170) xboxkrnl::VOID NTAPI xboxkrnl::MmDeleteKernelStack
|
||||||
/*FreeType=*/MEM_RELEASE);
|
/*FreeType=*/MEM_RELEASE);
|
||||||
|
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("MmDeleteKernelStack failed!\n");
|
EmuWarning("MmDeleteKernelStack failed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
@ -545,7 +545,7 @@ XBSYSAPI EXPORTNUM(181) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmQueryStatistics
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EmuWarning("EmuKrnl (0x%X): MmQueryStatistics with unusual size -> 0x%.08X\n", GetCurrentThreadId(), MemoryStatistics->Length);
|
EmuWarning("EmuKrnl: MmQueryStatistics with unusual size -> 0x%.08X", MemoryStatistics->Length);
|
||||||
ret = STATUS_INVALID_PARAMETER;
|
ret = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,7 +573,7 @@ XBSYSAPI EXPORTNUM(182) xboxkrnl::VOID NTAPI xboxkrnl::MmSetAddressProtect
|
||||||
if (!VirtualProtect(BaseAddress, NumberOfBytes, NewProtect & (~PAGE_WRITECOMBINE), &dwOldProtect))
|
if (!VirtualProtect(BaseAddress, NumberOfBytes, NewProtect & (~PAGE_WRITECOMBINE), &dwOldProtect))
|
||||||
EmuWarning("VirtualProtect Failed!");
|
EmuWarning("VirtualProtect Failed!");
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): VirtualProtect was 0x%.08X -> 0x%.08X\n", GetCurrentThreadId(), dwOldProtect, NewProtect & (~PAGE_WRITECOMBINE));
|
DbgPrintf("EmuKrnl: VirtualProtect was 0x%.08X -> 0x%.08X\n", dwOldProtect, NewProtect & (~PAGE_WRITECOMBINE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -209,7 +209,7 @@ XBSYSAPI EXPORTNUM(188) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateDirectoryObje
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtCreateDirectoryObject Failed!");
|
EmuWarning("NtCreateDirectoryObject Failed!");
|
||||||
else
|
else
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateDirectoryObject DirectoryHandle = 0x%.08X\n", GetCurrentThreadId(), *DirectoryHandle);
|
DbgPrintf("EmuKrnl: NtCreateDirectoryObject DirectoryHandle = 0x%.08X\n", *DirectoryHandle);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ XBSYSAPI EXPORTNUM(189) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateEvent
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtCreateEvent Failed!");
|
EmuWarning("NtCreateEvent Failed!");
|
||||||
else
|
else
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateEvent EventHandle = 0x%.08X\n", GetCurrentThreadId(), *EventHandle);
|
DbgPrintf("EmuKrnl: NtCreateEvent EventHandle = 0x%.08X\n", *EventHandle);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -322,7 +322,7 @@ XBSYSAPI EXPORTNUM(192) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateMutant
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtCreateMutant Failed!");
|
EmuWarning("NtCreateMutant Failed!");
|
||||||
else
|
else
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateMutant MutantHandle = 0x%.08X\n", GetCurrentThreadId(), *MutantHandle);
|
DbgPrintf("EmuKrnl: NtCreateMutant MutantHandle = 0x%.08X\n", *MutantHandle);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -362,7 +362,7 @@ XBSYSAPI EXPORTNUM(193) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateSemaphore
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtCreateSemaphore failed!");
|
EmuWarning("NtCreateSemaphore failed!");
|
||||||
else
|
else
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateSemaphore SemaphoreHandle = 0x%.08X\n", GetCurrentThreadId(), *SemaphoreHandle);
|
DbgPrintf("EmuKrnl: NtCreateSemaphore SemaphoreHandle = 0x%.08X\n", *SemaphoreHandle);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,7 @@ XBSYSAPI EXPORTNUM(194) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateTimer
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtCreateTimer failed!");
|
EmuWarning("NtCreateTimer failed!");
|
||||||
else
|
else
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtCreateTimer TimerHandle = 0x%.08X\n", GetCurrentThreadId(), *TimerHandle);
|
DbgPrintf("EmuKrnl: NtCreateTimer TimerHandle = 0x%.08X\n", *TimerHandle);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -919,7 +919,7 @@ XBSYSAPI EXPORTNUM(210) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryFullAttributes
|
||||||
NTToXboxFileInformation(&nativeNetOpenInfo, Attributes, FileNetworkOpenInformation, sizeof(xboxkrnl::FILE_NETWORK_OPEN_INFORMATION));
|
NTToXboxFileInformation(&nativeNetOpenInfo, Attributes, FileNetworkOpenInformation, sizeof(xboxkrnl::FILE_NETWORK_OPEN_INFORMATION));
|
||||||
|
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
EmuWarning("NtQueryFullAttributesFile failed! (0x%.08X)\n", ret);
|
EmuWarning("NtQueryFullAttributesFile failed! (0x%.08X)", ret);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -1196,7 +1196,7 @@ XBSYSAPI EXPORTNUM(217) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVirtualMemory
|
||||||
|
|
||||||
ret = STATUS_SUCCESS;
|
ret = STATUS_SUCCESS;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtQueryVirtualMemory: Applied fix for Forza Motorsport!\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl: NtQueryVirtualMemory: Applied fix for Forza Motorsport!\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1606,7 +1606,7 @@ XBSYSAPI EXPORTNUM(232) xboxkrnl::VOID NTAPI xboxkrnl::NtUserIoApcDispatcher
|
||||||
popad
|
popad
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): NtUserIoApcDispatcher Completed\n", GetCurrentThreadId());
|
DbgPrintf("EmuKrnl: NtUserIoApcDispatcher Completed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
|
@ -133,7 +133,7 @@ static unsigned int WINAPI PCSTProxy
|
||||||
if (pfnNotificationRoutine == NULL)
|
if (pfnNotificationRoutine == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): Calling pfnNotificationRoutine[%d] (0x%.08X)\n", GetCurrentThreadId(), g_iThreadNotificationCount, pfnNotificationRoutine);
|
DbgPrintf("EmuKrnl: Calling pfnNotificationRoutine[%d] (0x%.08X)\n", g_iThreadNotificationCount, pfnNotificationRoutine);
|
||||||
|
|
||||||
pfnNotificationRoutine(TRUE);
|
pfnNotificationRoutine(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ XBSYSAPI EXPORTNUM(255) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsCreateSystemThreadE
|
||||||
|
|
||||||
// *ThreadHandle = CreateThread(NULL, NULL, PCSTProxy, iPCSTProxyParam, NULL, &dwThreadId);
|
// *ThreadHandle = CreateThread(NULL, NULL, PCSTProxy, iPCSTProxyParam, NULL, &dwThreadId);
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): ThreadHandle : 0x%X, ThreadId : 0x%.08X\n", GetCurrentThreadId(), *ThreadHandle, dwThreadId);
|
DbgPrintf("EmuKrnl: ThreadHandle : 0x%X, ThreadId : 0x%.08X\n", *ThreadHandle, dwThreadId);
|
||||||
|
|
||||||
// we must duplicate this handle in order to retain Suspend/Resume thread rights from a remote thread
|
// we must duplicate this handle in order to retain Suspend/Resume thread rights from a remote thread
|
||||||
{
|
{
|
||||||
|
@ -377,7 +377,7 @@ XBSYSAPI EXPORTNUM(258) xboxkrnl::VOID NTAPI xboxkrnl::PsTerminateSystemThread
|
||||||
if (pfnNotificationRoutine == NULL)
|
if (pfnNotificationRoutine == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
DbgPrintf("EmuKrnl (0x%X): Calling pfnNotificationRoutine[%d] (0x%.08X)\n", GetCurrentThreadId(), g_iThreadNotificationCount, pfnNotificationRoutine);
|
DbgPrintf("EmuKrnl: Calling pfnNotificationRoutine[%d] (0x%.08X)\n", g_iThreadNotificationCount, pfnNotificationRoutine);
|
||||||
|
|
||||||
pfnNotificationRoutine(FALSE);
|
pfnNotificationRoutine(FALSE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,16 +510,25 @@ DEBUG_START(USER)
|
||||||
DEBUG_END(USER)
|
DEBUG_END(USER)
|
||||||
|
|
||||||
|
|
||||||
#define READ32_START(DEV) uint32_t EmuNV2A_##DEV##_Read32(uint32_t addr) { uint32_t result = 0; switch (addr) {
|
|
||||||
#define READ32_UNHANDLED(DEV) default: EmuWarning("EmuX86_Read32 NV2A_" #DEV "(0x%08X) = 0x%08X [Unhandled, %s]", addr, result, DebugNV_##DEV##(addr)); return result;
|
|
||||||
#define READ32_END(DEV) } EmuWarning("EmuX86_Read32 NV2A_" #DEV "(0x%08X) = 0x%08X [Handled, %s]", addr, result, DebugNV_##DEV##(addr)); return result; }
|
|
||||||
|
|
||||||
#define WRITE32_START(DEV) void EmuNV2A_##DEV##_Write32(uint32_t addr, uint32_t value) { switch (addr) {
|
|
||||||
#define WRITE32_UNHANDLED(DEV) default: EmuWarning("EmuX86_Write32 NV2A_" #DEV "(0x%08X, 0x%08X) [Unhandled, %s]", addr, value, DebugNV_##DEV##(addr)); return;
|
|
||||||
#define WRITE32_END(DEV) } EmuWarning("EmuX86_Write32 NV2A_" #DEV "(0x%08X, 0x%08X) [Handled, %s]", addr, value, DebugNV_##DEV##(addr)); }
|
|
||||||
|
|
||||||
|
|
||||||
READ32_START(PMC)
|
#define DEBUG_READ32(DEV) DbgPrintf("EmuX86_Read32 NV2A_" #DEV "(0x%08X) = 0x%08X [Handled, %s]\n", addr, result, DebugNV_##DEV##(addr));
|
||||||
|
#define DEBUG_READ32_UNHANDLED(DEV) DbgPrintf("EmuX86_Read32 NV2A_" #DEV "(0x%08X) = 0x%08X [Unhandled, %s]\n", addr, result, DebugNV_##DEV##(addr));
|
||||||
|
|
||||||
|
#define DEBUG_WRITE32(DEV) DbgPrintf("EmuX86_Write32 NV2A_" #DEV "(0x%08X, 0x%08X) [Handled, %s]\n", addr, value, DebugNV_##DEV##(addr));
|
||||||
|
#define DEBUG_WRITE32_UNHANDLED(DEV) DbgPrintf("EmuX86_Write32 NV2A_" #DEV "(0x%08X, 0x%08X) [Unhandled, %s]\n", addr, value, DebugNV_##DEV##(addr));
|
||||||
|
|
||||||
|
#define DEVICE_READ32(DEV) uint32_t EmuNV2A_##DEV##_Read32(uint32_t addr)
|
||||||
|
#define DEVICE_READ32_SWITCH(addr) uint32_t result = 0; switch (addr)
|
||||||
|
#define DEVICE_READ32_END(DEV) DEBUG_READ32(DEV); return result
|
||||||
|
|
||||||
|
#define DEVICE_WRITE32(DEV) void EmuNV2A_##DEV##_Write32(uint32_t addr, uint32_t value)
|
||||||
|
#define DEVICE_WRITE32_SWITCH(DEV, addr) DEBUG_WRITE32(DEV); switch (addr)
|
||||||
|
|
||||||
|
|
||||||
|
DEVICE_READ32(PMC)
|
||||||
|
{
|
||||||
|
DEVICE_READ32_SWITCH(addr) {
|
||||||
case NV_PMC_BOOT_0: // chipset and stepping: NV2A, A02, Rev 0
|
case NV_PMC_BOOT_0: // chipset and stepping: NV2A, A02, Rev 0
|
||||||
result = 0x02A000A2;
|
result = 0x02A000A2;
|
||||||
break;
|
break;
|
||||||
|
@ -529,7 +538,6 @@ READ32_START(PMC)
|
||||||
case NV_PMC_INTR_EN_0:
|
case NV_PMC_INTR_EN_0:
|
||||||
result = pmc.enabled_interrupts;
|
result = pmc.enabled_interrupts;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0000020C: // What's this address? What does the xbe expect to read here? The Kernel base address perhaps?
|
case 0x0000020C: // What's this address? What does the xbe expect to read here? The Kernel base address perhaps?
|
||||||
result = NV20_REG_BASE_KERNEL;
|
result = NV20_REG_BASE_KERNEL;
|
||||||
break;
|
break;
|
||||||
|
@ -543,7 +551,6 @@ READ32_START(PMC)
|
||||||
DEVICE_WRITE32(PMC)
|
DEVICE_WRITE32(PMC)
|
||||||
{
|
{
|
||||||
DEVICE_WRITE32_SWITCH(PMC, addr) {
|
DEVICE_WRITE32_SWITCH(PMC, addr) {
|
||||||
|
|
||||||
case NV_PMC_INTR_0:
|
case NV_PMC_INTR_0:
|
||||||
pmc.pending_interrupts &= ~value;
|
pmc.pending_interrupts &= ~value;
|
||||||
update_irq();
|
update_irq();
|
||||||
|
|
|
@ -96,27 +96,27 @@ uint32_t EmuX86_Read32(uint32_t addr)
|
||||||
|
|
||||||
uint16_t EmuX86_Read16(uint32_t addr)
|
uint16_t EmuX86_Read16(uint32_t addr)
|
||||||
{
|
{
|
||||||
EmuWarning("EmuX86_Read16(0x%08X) Forwarding to EmuX86_Read32...", addr);
|
DbgPrintf("EmuX86_Read16(0x%08X) Forwarding to EmuX86_Read32...", addr);
|
||||||
uint16_t value;
|
uint16_t value;
|
||||||
if (addr & 2)
|
if (addr & 2)
|
||||||
value = (uint16_t)(EmuX86_Read32(addr - 2) >> 16);
|
value = (uint16_t)(EmuX86_Read32(addr - 2) >> 16);
|
||||||
else
|
else
|
||||||
value = (uint16_t)EmuX86_Read32(addr);
|
value = (uint16_t)EmuX86_Read32(addr);
|
||||||
|
|
||||||
EmuWarning("EmuX86_Read16(0x%08X) = 0x%04X", addr, value);
|
DbgPrintf("EmuX86_Read16(0x%08X) = 0x%04X", addr, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t EmuX86_Read8(uint32_t addr)
|
uint8_t EmuX86_Read8(uint32_t addr)
|
||||||
{
|
{
|
||||||
EmuWarning("EmuX86_Read8(0x%08X) Forwarding to EmuX86_Read16...", addr);
|
DbgPrintf("EmuX86_Read8(0x%08X) Forwarding to EmuX86_Read16...", addr);
|
||||||
uint8_t value;
|
uint8_t value;
|
||||||
if (addr & 1)
|
if (addr & 1)
|
||||||
value = (uint8_t)(EmuX86_Read16(addr - 1) >> 8);
|
value = (uint8_t)(EmuX86_Read16(addr - 1) >> 8);
|
||||||
else
|
else
|
||||||
value = (uint8_t)EmuX86_Read16(addr);
|
value = (uint8_t)EmuX86_Read16(addr);
|
||||||
|
|
||||||
EmuWarning("EmuX86_Read8(0x%08X) = 0x%02X", addr, value);
|
DbgPrintf("EmuX86_Read8(0x%08X) = 0x%02X", addr, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ bool EmuX86_DecodeException(LPEXCEPTION_POINTERS e)
|
||||||
// and check if it successfully decoded one instruction :
|
// and check if it successfully decoded one instruction :
|
||||||
if (decodedInstructionsCount != 1)
|
if (decodedInstructionsCount != 1)
|
||||||
{
|
{
|
||||||
EmuWarning("EmuX86: Error decoding opcode at 0x%08X\n", e->ContextRecord->Eip);
|
EmuWarning("EmuX86: Error decoding opcode at 0x%08X", e->ContextRecord->Eip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,7 +187,7 @@ DWORD WINAPI XTL::EmuXGetDevices
|
||||||
if(DeviceType->Reserved[0] == 0 && DeviceType->Reserved[1] == 0 && DeviceType->Reserved[2] == 0)
|
if(DeviceType->Reserved[0] == 0 && DeviceType->Reserved[1] == 0 && DeviceType->Reserved[2] == 0)
|
||||||
ret = (1 << 0); // Return 1 Controller
|
ret = (1 << 0); // Return 1 Controller
|
||||||
else
|
else
|
||||||
EmuWarning("Unknown DeviceType (0x%.08X, 0x%.08X, 0x%.08X)\n", DeviceType->Reserved[0], DeviceType->Reserved[1], DeviceType->Reserved[2]);
|
EmuWarning("Unknown DeviceType (0x%.08X, 0x%.08X, 0x%.08X)", DeviceType->Reserved[0], DeviceType->Reserved[1], DeviceType->Reserved[2]);
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ BOOL WINAPI XTL::EmuXGetDeviceChanges
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: What if it's not a controller?
|
// TODO: What if it's not a controller?
|
||||||
EmuWarning("Unknown DeviceType (0x%.08X, 0x%.08X, 0x%.08X)\n", DeviceType->Reserved[0], DeviceType->Reserved[1], DeviceType->Reserved[2]);
|
EmuWarning("Unknown DeviceType (0x%.08X, 0x%.08X, 0x%.08X)", DeviceType->Reserved[0], DeviceType->Reserved[1], DeviceType->Reserved[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -735,13 +735,13 @@ LPVOID WINAPI XTL::EmuCreateFiber
|
||||||
LPVOID lpParameter
|
LPVOID lpParameter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuCreateFiber\n"
|
DbgPrintf("EmuXapi: EmuCreateFiber\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" dwStackSize : 0x%.08X\n"
|
" dwStackSize : 0x%.08X\n"
|
||||||
" lpStartRoutine : 0x%.08X\n"
|
" lpStartRoutine : 0x%.08X\n"
|
||||||
" lpParameter : 0x%.08X\n"
|
" lpParameter : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), dwStackSize, lpStartRoutine, lpParameter);
|
dwStackSize, lpStartRoutine, lpParameter);
|
||||||
|
|
||||||
LPVOID pFiber = CreateFiber( dwStackSize, lpStartRoutine, lpParameter );
|
LPVOID pFiber = CreateFiber( dwStackSize, lpStartRoutine, lpParameter );
|
||||||
if( !pFiber )
|
if( !pFiber )
|
||||||
|
@ -767,11 +767,11 @@ VOID WINAPI XTL::EmuDeleteFiber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuDeleteFiber\n"
|
DbgPrintf("EmuXapi: EmuDeleteFiber\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" lpFiber : 0x%.08X\n"
|
" lpFiber : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), lpFiber );
|
lpFiber );
|
||||||
|
|
||||||
DeleteFiber( lpFiber );
|
DeleteFiber( lpFiber );
|
||||||
|
|
||||||
|
@ -786,11 +786,11 @@ VOID WINAPI XTL::EmuSwitchToFiber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuSwitchToFiber\n"
|
DbgPrintf("EmuXapi: EmuSwitchToFiber\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" lpFiber : 0x%.08X\n"
|
" lpFiber : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), lpFiber );
|
lpFiber );
|
||||||
|
|
||||||
// SwitchToFiber( lpFiber ); // <- Hangs/crashes...
|
// SwitchToFiber( lpFiber ); // <- Hangs/crashes...
|
||||||
|
|
||||||
|
@ -816,11 +816,11 @@ LPVOID WINAPI XTL::EmuConvertThreadToFiber
|
||||||
LPVOID lpParameter
|
LPVOID lpParameter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuConvertThreadToFiber\n"
|
DbgPrintf("EmuXapi: EmuConvertThreadToFiber\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" lpParameter : 0x%.08X\n"
|
" lpParameter : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), lpParameter );
|
lpParameter );
|
||||||
|
|
||||||
LPVOID pRet = ConvertThreadToFiber( lpParameter );
|
LPVOID pRet = ConvertThreadToFiber( lpParameter );
|
||||||
|
|
||||||
|
@ -836,11 +836,11 @@ LPVOID WINAPI XTL::EmuConvertThreadToFiber
|
||||||
VOID WINAPI XTL::EmuXapiFiberStartup(DWORD dwDummy)
|
VOID WINAPI XTL::EmuXapiFiberStartup(DWORD dwDummy)
|
||||||
{
|
{
|
||||||
|
|
||||||
DbgPrintf("EmuXapi (0x%X): EmuXapiFiberStarup()\n"
|
DbgPrintf("EmuXapi: EmuXapiFiberStarup()\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" dwDummy : 0x%.08X\n"
|
" dwDummy : 0x%.08X\n"
|
||||||
");\n",
|
");\n",
|
||||||
GetCurrentThreadId(), dwDummy);
|
dwDummy);
|
||||||
|
|
||||||
|
|
||||||
typedef void (__stdcall *pfDummyFunc)(DWORD dwDummy);
|
typedef void (__stdcall *pfDummyFunc)(DWORD dwDummy);
|
||||||
|
|
|
@ -168,6 +168,8 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
|
||||||
uint32 LastUnResolvedXRefs = UnResolvedXRefs+1;
|
uint32 LastUnResolvedXRefs = UnResolvedXRefs+1;
|
||||||
uint32 OrigUnResolvedXRefs = UnResolvedXRefs;
|
uint32 OrigUnResolvedXRefs = UnResolvedXRefs;
|
||||||
|
|
||||||
|
bool bFoundD3D = false;
|
||||||
|
|
||||||
for(int p=0;UnResolvedXRefs < LastUnResolvedXRefs;p++)
|
for(int p=0;UnResolvedXRefs < LastUnResolvedXRefs;p++)
|
||||||
{
|
{
|
||||||
DbgPrintf("HLE: Starting pass #%d...\n", p+1);
|
DbgPrintf("HLE: Starting pass #%d...\n", p+1);
|
||||||
|
@ -287,6 +289,7 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
|
||||||
BuildVersion = 3911;
|
BuildVersion = 3911;
|
||||||
if(OrigBuildVersion == 4531)
|
if(OrigBuildVersion == 4531)
|
||||||
BuildVersion = 4627;
|
BuildVersion = 4627;
|
||||||
|
}
|
||||||
else if (strcmp(szLibraryName, Lib_XGRAPHC) == 0)
|
else if (strcmp(szLibraryName, Lib_XGRAPHC) == 0)
|
||||||
{
|
{
|
||||||
// Skip scanning for XGRAPHC (XG) symbols when LLE GPU is selected
|
// Skip scanning for XGRAPHC (XG) symbols when LLE GPU is selected
|
||||||
|
|
Loading…
Reference in New Issue