Fixing more debug output stuff.

This commit is contained in:
Aaron Robinson 2003-01-30 00:47:43 +00:00
parent 3b8830a2bd
commit 78162a75e4
3 changed files with 61 additions and 45 deletions

View File

@ -69,6 +69,7 @@ PostBuild_Cmds=cd PostBuild upxCxbx.bat
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Bin\Debug"
# PROP Intermediate_Dir "Bin\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "Include" /I "Include/Win32/" /I "Include/Win32/Cxbxkrnl" /I "Include/Win32/Cxbx" /I "Resource" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FR /YX /FD /GZ /c
@ -82,6 +83,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF

View File

@ -728,43 +728,51 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
MessageBox(m_hwnd, "This will not take effect until emulation is (re)started.\n", "Cxbx", MB_OK);
m_exe_changed = true;
UpdateDebugConsoles();
}
break;
case ID_VIEW_DEBUGOUTPUTKERNEL_FILE:
{
if(m_KrnlDebug == DM_NONE || m_KrnlDebug == DM_CONSOLE)
m_KrnlDebug = DM_FILE;
else
if(m_KrnlDebug == DM_FILE)
{
m_KrnlDebug = DM_NONE;
UpdateDebugConsoles();
break;
}
else
{
OPENFILENAME ofn = {0};
OPENFILENAME ofn = {0};
char filename[260] = "KrnlDebug.txt";
char filename[260] = "KrnlDebug.txt";
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = 260;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.lpstrDefExt = "txt";
ofn.Flags = OFN_PATHMUSTEXIST;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = 260;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.lpstrDefExt = "txt";
ofn.Flags = OFN_PATHMUSTEXIST;
if(GetSaveFileName(&ofn) != FALSE)
{
MessageBox(m_hwnd, "This will not take effect until emulation is (re)started.\n", "Cxbx", MB_OK);
if(GetSaveFileName(&ofn) == FALSE)
return false;
strncpy(m_KrnlDebugFilename, ofn.lpstrFile, 259);
strncpy(m_KrnlDebugFilename, ofn.lpstrFile, 259);
m_exe_changed = true;
UpdateDebugConsoles();
m_KrnlDebug = DM_FILE;
UpdateDebugConsoles();
}
}
}
break;
@ -781,37 +789,40 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
case ID_VIEW_DEBUGOUTPUTGUI_FILE:
{
if(m_CxbxDebug == DM_NONE || m_CxbxDebug == DM_CONSOLE)
m_CxbxDebug = DM_FILE;
else
if(m_CxbxDebug == DM_FILE)
{
m_CxbxDebug = DM_NONE;
UpdateDebugConsoles();
break;
}
else
{
OPENFILENAME ofn = {0};
OPENFILENAME ofn = {0};
char filename[260] = "CxbxDebug.txt";
char filename[260] = "CxbxDebug.txt";
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = 260;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.lpstrDefExt = "txt";
ofn.Flags = OFN_PATHMUSTEXIST;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = m_hwnd;
ofn.lpstrFilter = "Text Documents (*.txt)\0*.txt\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = 260;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.lpstrDefExt = "txt";
ofn.Flags = OFN_PATHMUSTEXIST;
if(GetSaveFileName(&ofn) != FALSE)
{
strncpy(m_CxbxDebugFilename, ofn.lpstrFile, 259);
if(GetSaveFileName(&ofn) == FALSE)
return false;
m_CxbxDebug = DM_FILE;
strncpy(m_CxbxDebugFilename, ofn.lpstrFile, 259);
UpdateDebugConsoles();
}
UpdateDebugConsoles();
}
}
break;

View File

@ -123,6 +123,11 @@ void EmuXGenerateFS()
mov ax, OrgFS
mov fs:[0x14], ax // FS.ArbitraryUserPointer
}
// ******************************************************************
// * Swap back into the "OrgFS"
// ******************************************************************
EmuXSwapFS();
}
// ******************************************************************
@ -158,7 +163,7 @@ CXBXKRNL_API void NTAPI EmuXInit(DebugMode DebugConsole, char *DebugFilename, ui
printf("CxbxKrnl [0x%.08X]: EmuXInit\n"
" (\n"
" DebugConsole : 0x%.08X\n"
" DebugFilename : %s"
" DebugFilename : \"%s\"\n"
" XBEHeader : 0x%.08X\n"
" XBEHeaderSize : 0x%.08X\n"
" Entry : 0x%.08X\n"
@ -196,8 +201,6 @@ CXBXKRNL_API void NTAPI EmuXInit(DebugMode DebugConsole, char *DebugFilename, ui
{
EmuXGenerateFS();
EmuXSwapFS();
// TODO: Initialize "new" FS structure
}