diff --git a/Core/Config.cpp b/Core/Config.cpp index f9caf7d65..04349fa1f 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -170,6 +170,8 @@ void Config::Load(const char *iniFileName) debugConfig->Get("DisasmWindowH", &iDisasmWindowH, -1); debugConfig->Get("ConsoleWindowX", &iConsoleWindowX, -1); debugConfig->Get("ConsoleWindowY", &iConsoleWindowY, -1); + debugConfig->Get("FontWidth", &iFontWidth, 8); + debugConfig->Get("FontHeight", &iFontHeight, 12); KeyMap::LoadFromIni(iniFile); @@ -284,6 +286,8 @@ void Config::Save() debugConfig->Set("DisasmWindowH", iDisasmWindowH); debugConfig->Set("ConsoleWindowX", iConsoleWindowX); debugConfig->Set("ConsoleWindowY", iConsoleWindowY); + debugConfig->Set("FontWidth", iFontWidth); + debugConfig->Set("FontHeight", iFontHeight); KeyMap::SaveToIni(iniFile); diff --git a/Core/Config.h b/Core/Config.h index 2ca949920..5e97bd64e 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -141,6 +141,8 @@ public: int iDisasmWindowH; int iConsoleWindowX; int iConsoleWindowY; + int iFontWidth; + int iFontHeight; std::string currentDirectory; std::string externalDirectory; diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 5a0e336c9..db971a072 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -7,6 +7,7 @@ #include "../WndMainWindow.h" #include "../InputBox.h" +#include "Core/Config.h" #include "CtrlDisAsmView.h" #include "Debugger_MemoryDlg.h" #include "DebuggerShared.h" @@ -146,12 +147,15 @@ CtrlDisAsmView::CtrlDisAsmView(HWND _wnd) SetWindowLongPtr(wnd, GWLP_USERDATA, (LONG)this); SetWindowLong(wnd, GWL_STYLE, GetWindowLong(wnd,GWL_STYLE) | WS_VSCROLL); SetScrollRange(wnd, SB_VERT, -1,1,TRUE); - font = CreateFont(12,8,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH, + + charWidth = g_Config.iFontWidth; + rowHeight = g_Config.iFontHeight+2; + + font = CreateFont(rowHeight-2,charWidth,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH, "Lucida Console"); - boldfont = CreateFont(12,8,0,0,FW_DEMIBOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH, + boldfont = CreateFont(rowHeight-2,charWidth,0,0,FW_DEMIBOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH, "Lucida Console"); curAddress=0; - rowHeight=14; instructionSize=4; showHex=false; hasFocus = false; @@ -353,7 +357,8 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam) if (debugger->isBreakpoint(address)) { textColor = 0x0000FF; - DrawIconEx(hdc,2,rowY1+1,breakPoint,32,32,0,0,DI_NORMAL); + int yOffset = max(-1,(rowHeight-14+1)/2); + DrawIconEx(hdc,2,rowY1+1+yOffset,breakPoint,32,32,0,0,DI_NORMAL); } SetTextColor(hdc,textColor); @@ -732,9 +737,9 @@ int CtrlDisAsmView::yToAddress(int y) void CtrlDisAsmView::calculatePixelPositions() { pixelPositions.addressStart = 16; - pixelPositions.opcodeStart = pixelPositions.addressStart + 18*8; - pixelPositions.argumentsStart = pixelPositions.opcodeStart + 9*8; - pixelPositions.arrowsStart = pixelPositions.argumentsStart + 30*8; + pixelPositions.opcodeStart = pixelPositions.addressStart + 18*charWidth; + pixelPositions.argumentsStart = pixelPositions.opcodeStart + 9*charWidth; + pixelPositions.arrowsStart = pixelPositions.argumentsStart + 30*charWidth; } void CtrlDisAsmView::search(bool continueSearch) diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index 3790f7da1..52b78bb38 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -32,6 +32,7 @@ class CtrlDisAsmView u32 curAddress; int rowHeight; + int charWidth; bool hasFocus; bool showHex;