diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 28234e44a0..7202d4ec63 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -485,7 +485,7 @@ void CtrlDisAsmView::assembleOpcode(u32 address, std::string defaultText) void CtrlDisAsmView::drawBranchLine(HDC hdc, BranchLine& line) { HPEN pen; - u32 windowEnd = windowStart+(visibleRows+2)*instructionSize; + u32 windowEnd = windowStart+visibleRows*instructionSize; int topY; int bottomY; @@ -600,7 +600,7 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam) HICON breakPoint = (HICON)LoadIcon(GetModuleHandle(0),(LPCWSTR)IDI_STOP); HICON breakPointDisable = (HICON)LoadIcon(GetModuleHandle(0),(LPCWSTR)IDI_STOPDISABLE); - for (int i = 0; i < visibleRows+2; i++) + for (int i = 0; i < visibleRows; i++) { unsigned int address=windowStart + i*instructionSize; MIPSAnalyst::MipsOpcodeInfo info = MIPSAnalyst::GetOpcodeInfo(debugger,address); diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index 5e16186930..b2a35da413 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -127,6 +127,7 @@ public: }; void getOpcodeText(u32 address, char* dest); + int getRowHeight() { return rowHeight; }; u32 yToAddress(int y); void setDontRedraw(bool b) { dontRedraw = b; }; diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index f686d004cc..7bf20cbcde 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -679,6 +679,9 @@ void CDisasm::UpdateSize(WORD width, WORD height) GetWindowRect(statusBarWnd,&windowRect); topHeightOffset = (windowRect.bottom-windowRect.top); } + + CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW)); + int disassemblyRowHeight = ptr->getRowHeight(); // disassembly GetWindowRect(disasm,&windowRect); @@ -686,6 +689,12 @@ void CDisasm::UpdateSize(WORD width, WORD height) positions[0].x = windowRect.left; positions[0].y = windowRect.top; + // compute border height of the disassembly + int totalHeight = windowRect.bottom-windowRect.top; + GetClientRect(disasm,&windowRect); + int clientHeight = windowRect.bottom-windowRect.top; + int borderHeight = totalHeight-clientHeight; + // left tabs GetWindowRect(leftTabs,&windowRect); MapWindowPoints(HWND_DESKTOP,m_hDlg,(LPPOINT)&windowRect,2); @@ -700,13 +709,14 @@ void CDisasm::UpdateSize(WORD width, WORD height) int bottomHeightOffset = positions[0].y; positions[0].w = width-borderMargin-positions[0].x; positions[0].h = (height-bottomHeightOffset-topHeightOffset) * weight; + positions[0].h = ((positions[0].h-borderHeight)/disassemblyRowHeight)*disassemblyRowHeight+borderHeight; positions[1].h = positions[0].h-(positions[1].y-positions[0].y); // bottom tabs positions[2].x = borderMargin; positions[2].y = positions[0].y+positions[0].h+borderMargin; positions[2].w = width-2*borderMargin; - positions[2].h = height-bottomHeightOffset-positions[2].y; + positions[2].h = hideBottomTabs ? 0 : height-bottomHeightOffset-positions[2].y; // now actually move all the windows MoveWindow(disasm,positions[0].x,positions[0].y,positions[0].w,positions[0].h,TRUE);