Only display full disassembly lines

This commit is contained in:
Kingcom 2013-10-19 00:58:42 +02:00
parent 8de3d882a1
commit ef1e34bffd
3 changed files with 14 additions and 3 deletions

View file

@ -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);

View file

@ -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; };

View file

@ -680,12 +680,21 @@ void CDisasm::UpdateSize(WORD width, WORD height)
topHeightOffset = (windowRect.bottom-windowRect.top);
}
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
int disassemblyRowHeight = ptr->getRowHeight();
// disassembly
GetWindowRect(disasm,&windowRect);
MapWindowPoints(HWND_DESKTOP,m_hDlg,(LPPOINT)&windowRect,2);
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);