Fixed LoggedModules bug + refactored log gui + allow to print debug messages also on release builds
This commit is contained in:
parent
524fb1f06d
commit
82f429f3c9
|
@ -43,6 +43,22 @@ BEGIN
|
||||||
BOTTOMMARGIN, 207
|
BOTTOMMARGIN, 207
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDD_CONTROLLER_CFG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_VIDEO_CFG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_AUDIO_CFG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_EEPROM_CFG, DIALOG
|
||||||
|
BEGIN
|
||||||
|
END
|
||||||
|
|
||||||
IDD_LOGGING_CFG, DIALOG
|
IDD_LOGGING_CFG, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
BOTTOMMARGIN, 322
|
BOTTOMMARGIN, 322
|
||||||
|
@ -331,7 +347,7 @@ BEGIN
|
||||||
PUSHBUTTON "Reset",IDC_EE_RESET,13,251,40,14,BS_FLAT
|
PUSHBUTTON "Reset",IDC_EE_RESET,13,251,40,14,BS_FLAT
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LOGGING_CFG DIALOGEX 0, 0, 259, 333
|
IDD_LOGGING_CFG DIALOGEX 0, 0, 259, 350
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Cxbx-Reloaded : Logging Configuration"
|
CAPTION "Cxbx-Reloaded : Logging Configuration"
|
||||||
FONT 8, "Verdana", 0, 0, 0x1
|
FONT 8, "Verdana", 0, 0, 0x1
|
||||||
|
@ -403,6 +419,8 @@ BEGIN
|
||||||
CONTROL "RTL",IDC_LOG_RTL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,93,302,28,10
|
CONTROL "RTL",IDC_LOG_RTL,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,93,302,28,10
|
||||||
CONTROL "XC",IDC_LOG_XC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,149,302,26,10
|
CONTROL "XC",IDC_LOG_XC,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,149,302,26,10
|
||||||
CONTROL "XE",IDC_LOG_XE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,209,302,25,10
|
CONTROL "XE",IDC_LOG_XE,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,209,302,25,10
|
||||||
|
PUSHBUTTON "Cancel",IDC_LOG_CANCEL,161,327,40,14,BS_FLAT
|
||||||
|
PUSHBUTTON "Accept",IDC_LOG_ACCEPT,208,327,40,14,BS_FLAT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -266,8 +266,6 @@ extern thread_local std::string _logThreadPrefix;
|
||||||
_logFuncPrefix = tmp.str(); \
|
_logFuncPrefix = tmp.str(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
|
||||||
|
|
||||||
#define LOG_INIT \
|
#define LOG_INIT \
|
||||||
LOG_THREAD_INIT \
|
LOG_THREAD_INIT \
|
||||||
LOG_FUNC_INIT(__func__)
|
LOG_FUNC_INIT(__func__)
|
||||||
|
@ -326,23 +324,6 @@ extern thread_local std::string _logThreadPrefix;
|
||||||
} } while (0); \
|
} } while (0); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#else // _DEBUG_TRACE
|
|
||||||
|
|
||||||
#define LOG_FINIT
|
|
||||||
#define LOG_INIT
|
|
||||||
#define LOG_FUNC_BEGIN_NO_INIT
|
|
||||||
#define LOG_FUNC_BEGIN
|
|
||||||
#define LOG_FUNC_ARG(arg)
|
|
||||||
#define LOG_FUNC_ARG_TYPE(type, arg)
|
|
||||||
#define LOG_FUNC_ARG_OUT(arg)
|
|
||||||
#define LOG_FUNC_END
|
|
||||||
#define LOG_FUNC_RESULT(r)
|
|
||||||
#define LOG_FUNC_RESULT_TYPE(type, r)
|
|
||||||
#define LOG_FORWARD(cxbxr_module, arg)
|
|
||||||
|
|
||||||
#endif // _DEBUG_TRACE
|
|
||||||
|
|
||||||
// LOG_IGNORED indicates that Cxbx consiously ignores an api
|
// LOG_IGNORED indicates that Cxbx consiously ignores an api
|
||||||
#define LOG_IGNORED(cxbxr_module) \
|
#define LOG_IGNORED(cxbxr_module) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -404,18 +385,12 @@ extern thread_local std::string _logThreadPrefix;
|
||||||
#pragma warning(disable : 4477)
|
#pragma warning(disable : 4477)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*! DbgPrintf enabled if _DEBUG_TRACE is set */
|
|
||||||
#ifdef _DEBUG_TRACE
|
|
||||||
#define DbgPrintf(cxbxr_module, fmt, ...) { \
|
#define DbgPrintf(cxbxr_module, fmt, ...) { \
|
||||||
LOG_CHECK_ENABLED(cxbxr_module, LOG_LEVEL::DEBUG) { \
|
LOG_CHECK_ENABLED(cxbxr_module, LOG_LEVEL::DEBUG) { \
|
||||||
CXBX_CHECK_INTEGRITY(); \
|
CXBX_CHECK_INTEGRITY(); \
|
||||||
if(g_bPrintfOn) printf("[0x%.4X] %s"##fmt, GetCurrentThreadId(), g_EnumModules2String[to_underlying(cxbxr_module)], ##__VA_ARGS__); \
|
if(g_bPrintfOn) printf("[0x%.4X] %s"##fmt, GetCurrentThreadId(), g_EnumModules2String[to_underlying(cxbxr_module)], ##__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
inline void null_func(...) { }
|
|
||||||
#define DbgPrintf null_func
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
|
|
@ -337,7 +337,7 @@ bool Settings::LoadConfig()
|
||||||
if (std::strncmp(si_list_iterator->pItem, "0x", 2) == 0) {
|
if (std::strncmp(si_list_iterator->pItem, "0x", 2) == 0) {
|
||||||
si_list_iterator->pItem += 2;
|
si_list_iterator->pItem += 2;
|
||||||
}
|
}
|
||||||
m_core.LoggedModules[index] = std::strtol(si_list_iterator->pItem, nullptr, 16);
|
m_core.LoggedModules[index] = std::strtoul(si_list_iterator->pItem, nullptr, 16);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ public:
|
||||||
char szKrnlDebug[MAX_PATH] = "";
|
char szKrnlDebug[MAX_PATH] = "";
|
||||||
char szStorageLocation[MAX_PATH] = "";
|
char szStorageLocation[MAX_PATH] = "";
|
||||||
bool allowAdminPrivilege;
|
bool allowAdminPrivilege;
|
||||||
int LoggedModules[NUM_INTEGERS_LOG];
|
uint LoggedModules[NUM_INTEGERS_LOG];
|
||||||
int LogLevel = 1;
|
int LogLevel = 1;
|
||||||
bool Reserved2 = 0;
|
bool Reserved2 = 0;
|
||||||
bool Reserved3 = 0;
|
bool Reserved3 = 0;
|
||||||
|
|
|
@ -73,12 +73,6 @@ typedef u32 xbaddr;
|
||||||
#define xbnull 0
|
#define xbnull 0
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
/*! define this to track vertex buffers */
|
|
||||||
#define _DEBUG_TRACK_VB
|
|
||||||
/*! define this to track vertex shaders */
|
|
||||||
#define _DEBUG_TRACK_VS
|
|
||||||
/*! define this to track pixel shaders */
|
|
||||||
#define _DEBUG_TRACK_PS
|
|
||||||
/*! define this to track memory allocations */
|
/*! define this to track memory allocations */
|
||||||
//#define _DEBUG_ALLOC
|
//#define _DEBUG_ALLOC
|
||||||
#endif
|
#endif
|
||||||
|
@ -86,8 +80,6 @@ typedef u32 xbaddr;
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define _DEBUG_TRACE 1
|
#define _DEBUG_TRACE 1
|
||||||
#endif
|
#endif
|
||||||
/*! define this to trace warnings */
|
|
||||||
#define _DEBUG_WARNINGS
|
|
||||||
/*! define this to trace vertex shader constants */
|
/*! define this to trace vertex shader constants */
|
||||||
#define _DEBUG_TRACK_VS_CONST
|
#define _DEBUG_TRACK_VS_CONST
|
||||||
/*! define this to print current configuration at kernel startup */
|
/*! define this to print current configuration at kernel startup */
|
||||||
|
|
|
@ -121,7 +121,7 @@ INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
int counter;
|
int counter;
|
||||||
int index;
|
int index;
|
||||||
int TempLevel;
|
int TempLevel;
|
||||||
int LoggedModules[NUM_INTEGERS_LOG];
|
uint LoggedModules[NUM_INTEGERS_LOG];
|
||||||
int LogLevel;
|
int LogLevel;
|
||||||
|
|
||||||
// Set window icon
|
// Set window icon
|
||||||
|
@ -184,7 +184,7 @@ INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (counter == to_underlying(CXBXR_MODULE::MAX)) {
|
if (counter == (to_underlying(CXBXR_MODULE::MAX) - to_underlying(CXBXR_MODULE::KRNL))) {
|
||||||
for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
for (index = to_underlying(CXBXR_MODULE::KRNL); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
||||||
EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE);
|
EnableWindow(GetDlgItem(hWndDlg, g_DlgIndexes[index]), FALSE);
|
||||||
}
|
}
|
||||||
|
@ -207,49 +207,7 @@ INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
{
|
{
|
||||||
if (g_bHasChanges) {
|
PostMessage(hWndDlg, WM_COMMAND, IDC_LOG_CANCEL, 0);
|
||||||
int LoggedModules[NUM_INTEGERS_LOG] = { 0 };
|
|
||||||
HWND hControl = GetDlgItem(hWndDlg, IDC_EVENT_LV);
|
|
||||||
int LogLevel = SendMessage(hControl, CB_GETITEMDATA, SendMessage(hControl, CB_GETCURSEL, 0, 0), 0);
|
|
||||||
|
|
||||||
for (int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
|
||||||
if (SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_GETCHECK, 0, 0) == BST_CHECKED) {
|
|
||||||
LoggedModules[index / 32] |= (1 << (index % 32));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_Settings->m_core.LoggedModules[0] = LoggedModules[0];
|
|
||||||
g_Settings->m_core.LoggedModules[1] = LoggedModules[1];
|
|
||||||
g_Settings->m_core.LogLevel = LogLevel;
|
|
||||||
|
|
||||||
// Update the logging variables for the GUI process
|
|
||||||
g_CurrentLogLevel = LogLevel;
|
|
||||||
for (int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
|
||||||
if (LoggedModules[index / 32] & (1 << (index % 32))) {
|
|
||||||
g_EnabledModules[index] = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
g_EnabledModules[index] = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Also inform the kernel process if it exists
|
|
||||||
if (g_ChildWnd) {
|
|
||||||
COPYDATASTRUCT CopyData;
|
|
||||||
LogData Data;
|
|
||||||
Data.Level = LogLevel;
|
|
||||||
for (int i = 0; i < NUM_INTEGERS_LOG; i++) {
|
|
||||||
Data.LoggedModules[i] = LoggedModules[i];
|
|
||||||
}
|
|
||||||
CopyData.dwData = LOG_ID;
|
|
||||||
CopyData.cbData = sizeof(LogData);
|
|
||||||
CopyData.lpData = &Data;
|
|
||||||
SendMessage(g_ChildWnd, WM_COPYDATA, reinterpret_cast<WPARAM>(hWndDlg), reinterpret_cast<LPARAM>(&CopyData));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_ChildWnd = NULL;
|
|
||||||
EndDialog(hWndDlg, wParam);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -257,6 +215,59 @@ INT_PTR CALLBACK DlgLogConfigProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
{
|
{
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
|
case IDC_LOG_CANCEL:
|
||||||
|
{
|
||||||
|
g_ChildWnd = NULL;
|
||||||
|
EndDialog(hWndDlg, wParam);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IDC_LOG_ACCEPT:
|
||||||
|
{
|
||||||
|
if (g_bHasChanges) {
|
||||||
|
uint LoggedModules[NUM_INTEGERS_LOG] = { 0 };
|
||||||
|
HWND hControl = GetDlgItem(hWndDlg, IDC_EVENT_LV);
|
||||||
|
int LogLevel = SendMessage(hControl, CB_GETITEMDATA, SendMessage(hControl, CB_GETCURSEL, 0, 0), 0);
|
||||||
|
|
||||||
|
for (int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
||||||
|
if (SendMessage(GetDlgItem(hWndDlg, g_DlgIndexes[index]), BM_GETCHECK, 0, 0) == BST_CHECKED) {
|
||||||
|
LoggedModules[index / 32] |= (1 << (index % 32));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_Settings->m_core.LoggedModules[0] = LoggedModules[0];
|
||||||
|
g_Settings->m_core.LoggedModules[1] = LoggedModules[1];
|
||||||
|
g_Settings->m_core.LogLevel = LogLevel;
|
||||||
|
|
||||||
|
// Update the logging variables for the GUI process
|
||||||
|
g_CurrentLogLevel = LogLevel;
|
||||||
|
for (int index = to_underlying(CXBXR_MODULE::CXBXR); index < to_underlying(CXBXR_MODULE::MAX); index++) {
|
||||||
|
if (LoggedModules[index / 32] & (1 << (index % 32))) {
|
||||||
|
g_EnabledModules[index] = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
g_EnabledModules[index] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also inform the kernel process if it exists
|
||||||
|
if (g_ChildWnd) {
|
||||||
|
COPYDATASTRUCT CopyData;
|
||||||
|
LogData Data;
|
||||||
|
Data.Level = LogLevel;
|
||||||
|
for (int i = 0; i < NUM_INTEGERS_LOG; i++) {
|
||||||
|
Data.LoggedModules[i] = LoggedModules[i];
|
||||||
|
}
|
||||||
|
CopyData.dwData = LOG_ID;
|
||||||
|
CopyData.cbData = sizeof(LogData);
|
||||||
|
CopyData.lpData = &Data;
|
||||||
|
SendMessage(g_ChildWnd, WM_COPYDATA, reinterpret_cast<WPARAM>(hWndDlg), reinterpret_cast<LPARAM>(&CopyData));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PostMessage(hWndDlg, WM_COMMAND, IDC_LOG_CANCEL, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case IDC_EVENT_LV:
|
case IDC_EVENT_LV:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||||
g_bHasChanges = true;
|
g_bHasChanges = true;
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#define IDS_UEM 123
|
#define IDS_UEM 123
|
||||||
#define IDD_CONTROLLER_HOST_MAPPING 131
|
#define IDD_CONTROLLER_HOST_MAPPING 131
|
||||||
#define IDD_VIRTUAL_SBC_FEEDBACK 133
|
#define IDD_VIRTUAL_SBC_FEEDBACK 133
|
||||||
|
#define IDC_LOG_CANCEL 892
|
||||||
|
#define IDC_LOG_ACCEPT 893
|
||||||
#define IDC_LOG_ENABLE_GENERAL 894
|
#define IDC_LOG_ENABLE_GENERAL 894
|
||||||
#define IDC_LOG_DISABLE_GENERAL 895
|
#define IDC_LOG_DISABLE_GENERAL 895
|
||||||
#define IDC_LOG_ENABLE_KERNEL 896
|
#define IDC_LOG_ENABLE_KERNEL 896
|
||||||
|
|
|
@ -110,7 +110,6 @@ void DbgConsole::Reset()
|
||||||
m_szInput[0] = '\0';
|
m_szInput[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_DEBUG_TRACK_VB)
|
|
||||||
typedef enum _ETAction
|
typedef enum _ETAction
|
||||||
{
|
{
|
||||||
ETA_ENABLE = 0,
|
ETA_ENABLE = 0,
|
||||||
|
@ -170,7 +169,6 @@ static void EnableTracker(ResourceTracker &trackTotal, ResourceTracker &tracker,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void DbgConsole::ParseCommand()
|
void DbgConsole::ParseCommand()
|
||||||
{
|
{
|
||||||
|
@ -193,12 +191,12 @@ void DbgConsole::ParseCommand()
|
||||||
printf("CxbxDbg: Quit/Exit [Q] : Stop Emulation\n");
|
printf("CxbxDbg: Quit/Exit [Q] : Stop Emulation\n");
|
||||||
printf("CxbxDbg: Trace [T] : Toggle Debug Trace\n");
|
printf("CxbxDbg: Trace [T] : Toggle Debug Trace\n");
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACK_VB
|
LOG_CHECK_ENABLED(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) {
|
||||||
printf("CxbxDbg: ListVB [LVB] : List Active Vertex Buffers\n");
|
printf("CxbxDbg: ListVB [LVB] : List Active Vertex Buffers\n");
|
||||||
printf("CxbxDbg: DisableVB [DVB #] : Disable Active Vertex Buffer(s)\n");
|
printf("CxbxDbg: DisableVB [DVB #] : Disable Active Vertex Buffer(s)\n");
|
||||||
printf("CxbxDbg: EnableVB [EVB #] : Enable Active Vertex Buffer(s)\n");
|
printf("CxbxDbg: EnableVB [EVB #] : Enable Active Vertex Buffer(s)\n");
|
||||||
printf("CxbxDbg: DumpStreamCache [DSC] : Dumps the patched streams cache\n");
|
printf("CxbxDbg: DumpStreamCache [DSC] : Dumps the patched streams cache\n");
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG_ALLOC
|
#ifdef _DEBUG_ALLOC
|
||||||
printf("CxbxDbg: DumpMem [DMEM] : Dump the heap allocation tracking table\n");
|
printf("CxbxDbg: DumpMem [DMEM] : Dump the heap allocation tracking table\n");
|
||||||
|
@ -219,65 +217,69 @@ void DbgConsole::ParseCommand()
|
||||||
g_bPrintfOn = !g_bPrintfOn;
|
g_bPrintfOn = !g_bPrintfOn;
|
||||||
printf("CxbxDbg: Trace is now %s\n", g_bPrintfOn ? "ON" : "OFF");
|
printf("CxbxDbg: Trace is now %s\n", g_bPrintfOn ? "ON" : "OFF");
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG_TRACK_VB
|
|
||||||
else if(_stricmp(szCmd, "lvb") == 0 || _stricmp(szCmd, "ListVB") == 0)
|
else if(_stricmp(szCmd, "lvb") == 0 || _stricmp(szCmd, "ListVB") == 0)
|
||||||
{
|
{
|
||||||
int v=0;
|
LOG_CHECK_ENABLED(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) {
|
||||||
|
int v = 0;
|
||||||
|
|
||||||
g_VBTrackTotal.Lock();
|
g_VBTrackTotal.Lock();
|
||||||
|
|
||||||
RTNode *cur = g_VBTrackTotal.getHead();
|
RTNode *cur = g_VBTrackTotal.getHead();
|
||||||
|
|
||||||
while(cur != NULL && cur->pNext != NULL)
|
while (cur != NULL && cur->pNext != NULL)
|
||||||
{
|
{
|
||||||
bool enabled = g_VBTrackDisable.exists(cur->pResource);
|
bool enabled = g_VBTrackDisable.exists(cur->pResource);
|
||||||
|
|
||||||
printf("CxbxDbg: %.2d : 0x%p (%s)\n", v++, cur->pResource, enabled ? "enabled" : "disabled");
|
printf("CxbxDbg: %.2d : 0x%p (%s)\n", v++, cur->pResource, enabled ? "enabled" : "disabled");
|
||||||
|
|
||||||
cur = cur->pNext;
|
cur = cur->pNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_VBTrackTotal.Unlock();
|
g_VBTrackTotal.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(_stricmp(szCmd, "dvb") == 0 || _stricmp(szCmd, "DisableVB") == 0)
|
else if(_stricmp(szCmd, "dvb") == 0 || _stricmp(szCmd, "DisableVB") == 0)
|
||||||
{
|
{
|
||||||
int n=0, m=0;
|
LOG_CHECK_ENABLED(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) {
|
||||||
|
int n = 0, m = 0;
|
||||||
|
|
||||||
int c = sscanf(m_szInput, "%*s %d-%d", &n, &m);
|
int c = sscanf(m_szInput, "%*s %d-%d", &n, &m);
|
||||||
|
|
||||||
if(c == 1)
|
if (c == 1)
|
||||||
{
|
{
|
||||||
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_DISABLE);
|
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_DISABLE);
|
||||||
}
|
}
|
||||||
else if(c == 2)
|
else if (c == 2)
|
||||||
{
|
{
|
||||||
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_DISABLE);
|
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_DISABLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("CxbxDbg: Syntax Incorrect (dvb #)\n");
|
printf("CxbxDbg: Syntax Incorrect (dvb #)\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(_stricmp(szCmd, "evb") == 0 || _stricmp(szCmd, "EnableVB") == 0)
|
else if(_stricmp(szCmd, "evb") == 0 || _stricmp(szCmd, "EnableVB") == 0)
|
||||||
{
|
{
|
||||||
int n=0, m=0;
|
LOG_CHECK_ENABLED(CXBXR_MODULE::VTXB, LOG_LEVEL::DEBUG) {
|
||||||
|
int n = 0, m = 0;
|
||||||
|
|
||||||
int c = sscanf(m_szInput, "%*s %d-%d", &n, &m);
|
int c = sscanf(m_szInput, "%*s %d-%d", &n, &m);
|
||||||
|
|
||||||
if(c == 1)
|
if (c == 1)
|
||||||
{
|
{
|
||||||
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_ENABLE);
|
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, n, ETA_ENABLE);
|
||||||
}
|
}
|
||||||
else if(c == 2)
|
else if (c == 2)
|
||||||
{
|
{
|
||||||
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_ENABLE);
|
EnableTracker(g_VBTrackTotal, g_VBTrackDisable, n, m, ETA_ENABLE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("CxbxDbg: Syntax Incorrect (dvb #)\n");
|
printf("CxbxDbg: Syntax Incorrect (dvb #)\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef _DEBUG_ALLOC
|
#ifdef _DEBUG_ALLOC
|
||||||
else if(_stricmp(szCmd, "dmem") == 0 || _stricmp(szCmd, "DumpMem") == 0)
|
else if(_stricmp(szCmd, "dmem") == 0 || _stricmp(szCmd, "DumpMem") == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,7 +102,6 @@ std::string FormatTitleId(uint32_t title_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// print out a warning message to the kernel debug log file
|
// print out a warning message to the kernel debug log file
|
||||||
#ifdef _DEBUG_WARNINGS
|
|
||||||
void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...)
|
void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...)
|
||||||
{
|
{
|
||||||
if (szWarningMessage == NULL) {
|
if (szWarningMessage == NULL) {
|
||||||
|
@ -132,7 +131,6 @@ void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string EIPToString(xbaddr EIP)
|
std::string EIPToString(xbaddr EIP)
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,11 +42,7 @@
|
||||||
#include <multimon.h>
|
#include <multimon.h>
|
||||||
|
|
||||||
// print out a log message to the kernel debug log file if level is high enough
|
// print out a log message to the kernel debug log file if level is high enough
|
||||||
#ifdef _DEBUG_WARNINGS
|
|
||||||
void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...);
|
void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...);
|
||||||
#else
|
|
||||||
inline void NTAPI EmuLog(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string FormatTitleId(uint32_t title_id);
|
std::string FormatTitleId(uint32_t title_id);
|
||||||
|
|
||||||
|
|
|
@ -211,25 +211,15 @@ struct EmuD3D8CreateDeviceProxyData
|
||||||
}
|
}
|
||||||
g_EmuCDPD = {0};
|
g_EmuCDPD = {0};
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACE
|
|
||||||
|
|
||||||
#define DEBUG_D3DRESULT(hRet, message) \
|
#define DEBUG_D3DRESULT(hRet, message) \
|
||||||
do { \
|
do { \
|
||||||
if (FAILED(hRet)) \
|
LOG_CHECK_ENABLED(CXBXR_MODULE::D3D8, LOG_LEVEL::DEBUG) { \
|
||||||
if(g_bPrintfOn) \
|
if (FAILED(hRet)) \
|
||||||
printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \
|
if(g_bPrintfOn) \
|
||||||
|
printf("%s%s : %s D3D error (0x%.08X: %s)\n", _logThreadPrefix.c_str(), _logFuncPrefix.c_str(), message, hRet, D3DErrorString(hRet)); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define DEBUG_D3DRESULT(hRet, message) \
|
|
||||||
do { \
|
|
||||||
if (FAILED(hRet)) \
|
|
||||||
if(g_bPrintfOn) \
|
|
||||||
DbgPrintf(LOG_PREFIX, "%s : %s D3D error (0x%.08X: %s)\n", __func__, message, hRet, D3DErrorString(hRet)); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: This should be a D3DDevice structure
|
// TODO: This should be a D3DDevice structure
|
||||||
DWORD* g_XboxD3DDevice;
|
DWORD* g_XboxD3DDevice;
|
||||||
|
|
|
@ -88,6 +88,12 @@ typedef uint8_t uint8; // TODO : Remove
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define DbgPshPrintf \
|
||||||
|
LOG_CHECK_ENABLED(LOG_PREFIX, LOG_LEVEL::DEBUG) \
|
||||||
|
if(g_bPrintfOn) printf
|
||||||
|
|
||||||
|
|
||||||
//#include "EmuD3DPixelShader.h"
|
//#include "EmuD3DPixelShader.h"
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -49,11 +49,4 @@ VOID DxbxUpdateActivePixelShader(); // NOPATCH
|
||||||
// TODO: Remove this once the Render State code has been fully ported from Dxbx/Wip_LessVertexPatching
|
// TODO: Remove this once the Render State code has been fully ported from Dxbx/Wip_LessVertexPatching
|
||||||
extern DWORD TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES + 1];
|
extern DWORD TemporaryPixelShaderRenderStates[X_D3DRS_PSTEXTUREMODES + 1];
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACK_PS
|
|
||||||
#define DbgPshPrintf if(g_bPrintfOn) printf
|
|
||||||
#else
|
|
||||||
inline void null_func_psh(...) { }
|
|
||||||
#define DbgPshPrintf XTL::null_func_psh
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // PIXELSHADER_H
|
#endif // PIXELSHADER_H
|
||||||
|
|
|
@ -52,6 +52,10 @@
|
||||||
//#define CXBX_USE_VS30 // Separate the port to Vertex Shader model 3.0 from the port to Direct3D9
|
//#define CXBX_USE_VS30 // Separate the port to Vertex Shader model 3.0 from the port to Direct3D9
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DbgVshPrintf \
|
||||||
|
LOG_CHECK_ENABLED(LOG_PREFIX, LOG_LEVEL::DEBUG) \
|
||||||
|
if(g_bPrintfOn) printf
|
||||||
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
// * Vertex shader function recompiler
|
// * Vertex shader function recompiler
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
|
|
|
@ -96,11 +96,4 @@ inline CxbxVertexShader *MapXboxVertexShaderHandleToCxbxVertexShader(DWORD Handl
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG_TRACK_VS
|
|
||||||
#define DbgVshPrintf if(g_bPrintfOn) printf
|
|
||||||
#else
|
|
||||||
inline void null_func_vsh(...) { }
|
|
||||||
#define DbgVshPrintf XTL::null_func_vsh
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
#define LOG_PREFIX CXBXR_MODULE::LOG
|
#define LOG_PREFIX CXBXR_MODULE::LOG
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
// prevent name collisions
|
// prevent name collisions
|
||||||
namespace xboxkrnl
|
namespace xboxkrnl
|
||||||
{
|
{
|
||||||
|
@ -454,4 +453,3 @@ LOGRENDER(UNICODE_STRING)
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end of namespace xboxkrnl;
|
}; // end of namespace xboxkrnl;
|
||||||
#endif
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ enum {
|
||||||
#define LOG_ID 1
|
#define LOG_ID 1
|
||||||
struct LogData {
|
struct LogData {
|
||||||
int Level;
|
int Level;
|
||||||
int LoggedModules[NUM_INTEGERS_LOG];
|
uint LoggedModules[NUM_INTEGERS_LOG];
|
||||||
};
|
};
|
||||||
|
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
Loading…
Reference in New Issue