diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index a2802ad4..c564d2a9 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -120,9 +120,11 @@ void UpdateOtherDebuggingDialogs() void RestoreSize(HWND hwndDlg) { + HDC hdc = GetDC(hwndDlg); //If the dialog dimensions are changed those changes need to be reflected here. - adelikat - const int DEFAULT_WIDTH = 820 + (debuggerIDAFont ? 64 : 0); //Original width - const int DEFAULT_HEIGHT = 576 + (debuggerIDAFont ? 2 : 0); //Original height + const int DEFAULT_WIDTH = MulDiv(820 + (debuggerIDAFont ? 64 : 0), GetDeviceCaps(hdc, LOGPIXELSX), 96); //Original width + const int DEFAULT_HEIGHT = MulDiv(576 + (debuggerIDAFont ? 2 : 0), GetDeviceCaps(hdc, LOGPIXELSY), 96); //Original height + ReleaseDC(hwndDlg, hdc); SetWindowPos(hwndDlg,HWND_TOP,DbgPosX,DbgPosY,DEFAULT_WIDTH,DEFAULT_HEIGHT,SWP_SHOWWINDOW); } diff --git a/src/drivers/win/debuggersp.cpp b/src/drivers/win/debuggersp.cpp index 908e9aad..73e85d44 100644 --- a/src/drivers/win/debuggersp.cpp +++ b/src/drivers/win/debuggersp.cpp @@ -103,17 +103,6 @@ MemoryMappedRegister RegNames[] = { int RegNameCount = sizeof(RegNames)/sizeof(MemoryMappedRegister); -/** -* Tests whether a char is a valid hexadecimal character. -* -* @param c The char to test -* @return True or false. -**/ -int isHex(char c) -{ - return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); -} - /** * Parses a line from a NL file. * @param line The line to parse @@ -165,10 +154,10 @@ int parseLine(char* line, Name* n) if (llen == 5) // Offset size of normal lines of the form $XXXX { if (line[0] != '$' - || !isHex(line[1]) - || !isHex(line[2]) - || !isHex(line[3]) - || !isHex(line[4]) + || !IsLetterLegalHex(line[1]) + || !IsLetterLegalHex(line[2]) + || !IsLetterLegalHex(line[3]) + || !IsLetterLegalHex(line[4]) ) { return 4; @@ -178,10 +167,10 @@ int parseLine(char* line, Name* n) { int i; if (line[0] != '$' - || !isHex(line[1]) - || !isHex(line[2]) - || !isHex(line[3]) - || !isHex(line[4]) + || !IsLetterLegalHex(line[1]) + || !IsLetterLegalHex(line[2]) + || !IsLetterLegalHex(line[3]) + || !IsLetterLegalHex(line[4]) || line[5] != '/' ) { @@ -190,7 +179,7 @@ int parseLine(char* line, Name* n) for (i=6;line[i];i++) { - if (!isHex(line[i])) + if (!IsLetterLegalHex(line[i])) { return 6; } @@ -381,7 +370,7 @@ Name* parse(char* lines, const char* filename) int i; // Create a node for each element of the array - for (i=0;i<=arrlen;i++) + for (i = 0; i < arrlen; i++) { char numbuff[10] = {0}; diff --git a/src/drivers/win/debuggersp.h b/src/drivers/win/debuggersp.h index 258cca7d..b322dbd6 100644 --- a/src/drivers/win/debuggersp.h +++ b/src/drivers/win/debuggersp.h @@ -61,7 +61,7 @@ void DeleteAllDebuggerBookmarks(); void FillDebuggerBookmarkListbox(HWND hwnd); void GoToDebuggerBookmark(HWND hwnd); -int isHex(char c); +extern bool IsLetterLegalHex(char c); bool DoSymbolicDebugNaming(int offset, HWND parentHWND); void AddNewSymbolicName(uint16 newAddress, char* newOffset, char* newName, char* newComment, int size, int init, bool nameOverwrite, bool commentHeadOnly, bool commentOverwrite); diff --git a/src/drivers/win/monitor.cpp b/src/drivers/win/monitor.cpp index 770511dd..376e96e5 100644 --- a/src/drivers/win/monitor.cpp +++ b/src/drivers/win/monitor.cpp @@ -120,7 +120,7 @@ BOOL updateResults(HWND hwndDlg, int rule) for (unsigned int j=0;j