From 798e19b2a6c3b39cd22db557deb6e2de9a5ff669 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Thu, 10 Jan 2019 21:05:21 -0700 Subject: [PATCH 1/4] [Debugger] ShowWindow(): Restore window if minimized --- Source/Project64/UserInterface/Debugger/DebugDialog.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Project64/UserInterface/Debugger/DebugDialog.h b/Source/Project64/UserInterface/Debugger/DebugDialog.h index 8db11d30a..7301cf31b 100644 --- a/Source/Project64/UserInterface/Debugger/DebugDialog.h +++ b/Source/Project64/UserInterface/Debugger/DebugDialog.h @@ -72,6 +72,9 @@ public: } if (m_hWnd) { + if (::IsIconic((HWND)m_hWnd)) { + SendMessage(m_hWnd, WM_SYSCOMMAND, SC_RESTORE, NULL); + } SetForegroundWindow((HWND)m_hWnd); } } From 7206c28348c35ffcd33a283338a50e1879282ce8 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Sun, 13 Jan 2019 01:09:37 -0700 Subject: [PATCH 2/4] [Project64] UISettings: Add Debugger UI window position and size entries --- Source/Project64/Settings/UISettings.cpp | 32 ++++++++++++++++++++++++ Source/Project64/Settings/UISettings.h | 32 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/Source/Project64/Settings/UISettings.cpp b/Source/Project64/Settings/UISettings.cpp index 5b664d000..a0431688f 100644 --- a/Source/Project64/Settings/UISettings.cpp +++ b/Source/Project64/Settings/UISettings.cpp @@ -64,6 +64,38 @@ void RegisterUISettings (void) g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileIndex), new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None)); g_Settings->AddHandler((SettingID)(FirstUISettings + SupportWindows_RunCount), new CSettingTypeApplication("Support Project64", "Run Count", (uint32_t)0)); + + //Debugger UI + g_Settings->AddHandler((SettingID)(FirstUISettings + MemorySearch_Top), new CSettingTypeApplication("Debugger", "Memory Search Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + MemorySearch_Left), new CSettingTypeApplication("Debugger", "Memory Search Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + ViewMemory_Top), new CSettingTypeApplication("Debugger", "View Memory Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + ViewMemory_Left), new CSettingTypeApplication("Debugger", "View Memory Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + TLB_Top), new CSettingTypeApplication("Debugger", "TLB Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + TLB_Left), new CSettingTypeApplication("Debugger", "TLB Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Top), new CSettingTypeApplication("Debugger", "Commands Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Left), new CSettingTypeApplication("Debugger", "Commands Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Width), new CSettingTypeApplication("Debugger", "Commands Width", (uint32_t)489)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Commands_Height), new CSettingTypeApplication("Debugger", "Commands Height", (uint32_t)327)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Top), new CSettingTypeApplication("Debugger", "Scripts Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Left), new CSettingTypeApplication("Debugger", "Scripts Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Width), new CSettingTypeApplication("Debugger", "Scripts Width", (uint32_t)337)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Scripts_Height), new CSettingTypeApplication("Debugger", "Scripts Height", (uint32_t)170)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Top), new CSettingTypeApplication("Debugger", "Symbols Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Left), new CSettingTypeApplication("Debugger", "Symbols Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Width), new CSettingTypeApplication("Debugger", "Symbols Width", (uint32_t)313)); + g_Settings->AddHandler((SettingID)(FirstUISettings + Symbols_Height), new CSettingTypeApplication("Debugger", "Symbols Height", (uint32_t)141)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Top), new CSettingTypeApplication("Debugger", "DMA Log View Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Left), new CSettingTypeApplication("Debugger", "DMA Log View Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Width), new CSettingTypeApplication("Debugger", "DMA Log View Width", (uint32_t)309)); + g_Settings->AddHandler((SettingID)(FirstUISettings + DMALogView_Height), new CSettingTypeApplication("Debugger", "DMA Log View Height", (uint32_t)215)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Top), new CSettingTypeApplication("Debugger", "Stack View Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Left), new CSettingTypeApplication("Debugger", "Stack View Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Width), new CSettingTypeApplication("Debugger", "Stack View Width", (uint32_t)197)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackView_Height), new CSettingTypeApplication("Debugger", "Stack View Height", (uint32_t)212)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Top), new CSettingTypeApplication("Debugger", "Stack Trace Top", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Left), new CSettingTypeApplication("Debugger", "Stack Trace Left", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Width), new CSettingTypeApplication("Debugger", "Stack Trace Width", (uint32_t)223)); + g_Settings->AddHandler((SettingID)(FirstUISettings + StackTrace_Height), new CSettingTypeApplication("Debugger", "Stack Trace Height", (uint32_t)221)); } void UISettingsSaveBool(UISettingID Type, bool Value) diff --git a/Source/Project64/Settings/UISettings.h b/Source/Project64/Settings/UISettings.h index ac1f8e6c3..fbc091e03 100644 --- a/Source/Project64/Settings/UISettings.h +++ b/Source/Project64/Settings/UISettings.h @@ -61,6 +61,38 @@ enum UISettingID //Support Window SupportWindows_RunCount, + + //Debugger UI positions and sizes + MemorySearch_Top, + MemorySearch_Left, + ViewMemory_Top, + ViewMemory_Left, + TLB_Top, + TLB_Left, + Commands_Top, + Commands_Left, + Commands_Width, + Commands_Height, + Scripts_Top, + Scripts_Left, + Scripts_Width, + Scripts_Height, + Symbols_Top, + Symbols_Left, + Symbols_Width, + Symbols_Height, + DMALogView_Top, + DMALogView_Left, + DMALogView_Width, + DMALogView_Height, + StackView_Top, + StackView_Left, + StackView_Width, + StackView_Height, + StackTrace_Top, + StackTrace_Left, + StackTrace_Width, + StackTrace_Height, }; void RegisterUISettings (void); From f1927648acffd028c01439ee1807b913c377c939 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Sun, 13 Jan 2019 01:12:00 -0700 Subject: [PATCH 3/4] [Debugger] DebugDialog.h: Implement functions to manipulate window position and size --- .../UserInterface/Debugger/DebugDialog.h | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/Source/Project64/UserInterface/Debugger/DebugDialog.h b/Source/Project64/UserInterface/Debugger/DebugDialog.h index 7301cf31b..11734c2a0 100644 --- a/Source/Project64/UserInterface/Debugger/DebugDialog.h +++ b/Source/Project64/UserInterface/Debugger/DebugDialog.h @@ -1,5 +1,6 @@ #pragma once +#include template class CDebugDialog : public CDialogImpl < T > @@ -39,6 +40,100 @@ public: } } + enum { Timer_SetWindowPos = 1 }; + + //Get Information about the window + int GetHeight(void) { + if (!m_hWnd) { return 0; } + + RECT rect; + GetWindowRect(m_hWnd, &rect); + return rect.bottom - rect.top; + } + + int GetWidth(void) { + if (!m_hWnd) { return 0; } + + RECT rect; + GetWindowRect(m_hWnd, &rect); + return rect.right - rect.left; + } + + int GetX(CRect WinRect) { + return (GetSystemMetrics(SM_CXSCREEN) - (WinRect.right - WinRect.left)) / 2; + } + + int GetY(CRect WinRect) { + return (GetSystemMetrics(SM_CYSCREEN) - (WinRect.bottom - WinRect.top)) / 2; + } + + //Manipulate the state of the window + void SetPos(int X, int Y) { //Move the window to this screen location + ::SetWindowPos(m_hWnd, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + } + + void SaveWindowLoc(UISettingID SettingID_Top, UISettingID SettingID_Left) { + RECT WinRect; + ::GetWindowRect(m_hWnd, &WinRect); + + //save the location of the window + if (m_hWnd) + { + m_SaveWnd = true; + m_SaveWndTop = WinRect.top; + m_SaveWndLeft = WinRect.left; + } + + ::KillTimer(m_hWnd, Timer_SetWindowPos); + ::SetTimer(m_hWnd, Timer_SetWindowPos, 1000, NULL); + + bool flush = false; + if (m_SaveWnd) + { + m_SaveWnd = false; + UISettingsSaveDword(SettingID_Top, m_SaveWndTop); + UISettingsSaveDword(SettingID_Left, m_SaveWndLeft); + flush = true; + } + + if (flush) + { + CSettingTypeApplication::Flush(); + } + } + + void SetSize(int Width, int Height) { //Set window Height and Width + RECT rcClient; + rcClient.top = 0; + rcClient.bottom = Height; + rcClient.left = 0; + rcClient.right = Width; + ::AdjustWindowRect(&rcClient, ::GetWindowLong(m_hWnd, GWL_STYLE), true); + + int32_t WindowHeight = rcClient.bottom - rcClient.top; + int32_t WindowWidth = rcClient.right - rcClient.left; + + ::SetWindowPos(m_hWnd, NULL, 0, 0, WindowWidth, WindowHeight, SWP_NOMOVE | SWP_NOZORDER); + } + + void SaveSize(UISettingID SettingID_X, UISettingID SettingID_Y) { + //Get the current window size + RECT rect; + GetWindowRect(m_hWnd, &rect); + + int32_t WindowHeight = rect.bottom - rect.top; + int32_t WindowWidth = rect.right - rect.left; + + if (UISettingsLoadDword(SettingID_X) != WindowWidth) + { + UISettingsSaveDword(SettingID_X, WindowWidth); + } + if (UISettingsLoadDword(SettingID_Y) != WindowHeight) + { + UISettingsSaveDword(SettingID_Y, WindowHeight); + } + } + void HideWindow(void) { if (m_hWnd && ::IsWindow(m_hWnd)) @@ -78,4 +173,8 @@ public: SetForegroundWindow((HWND)m_hWnd); } } +private: + bool m_SaveWnd; + LONG m_SaveWndTop; + LONG m_SaveWndLeft; }; From 12351337d1c292bd65424f823f50df3b20f990e0 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Sun, 13 Jan 2019 01:13:59 -0700 Subject: [PATCH 4/4] [Debugger] UI: Get window position and size from cfg --- .../Debugger/Debugger-Commands.cpp | 40 +++++++++++++++++++ .../Debugger/Debugger-DMALogView.cpp | 18 +++++++++ .../Debugger/Debugger-MemorySearch.cpp | 13 ++++++ .../Debugger/Debugger-Scripts.cpp | 18 +++++++++ .../Debugger/Debugger-StackTrace.cpp | 18 +++++++++ .../Debugger/Debugger-StackView.cpp | 18 +++++++++ .../Debugger/Debugger-Symbols.cpp | 18 +++++++++ .../UserInterface/Debugger/Debugger-TLB.cpp | 13 ++++++ .../Debugger/Debugger-ViewMemory.cpp | 13 ++++++ 9 files changed, 169 insertions(+) diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp index 32e807d55..2b2647574 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Commands.cpp @@ -89,6 +89,46 @@ LRESULT CDebugCommandsView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA GetWindowRect(&m_DefaultWindowRect); + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(Commands_Top, (uint32_t &)Y); + UISettingsLoadDword(Commands_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(Commands_Width); + int32_t Height = UISettingsLoadDword(Commands_Height); + + SetSize(Width, Height); + + + //Fix sizing (duplicate code of CDebugCommandsView:OnSizing) -- FIXME + CRect listRect; + m_CommandList.GetWindowRect(listRect); + + CRect headRect; + CHeaderCtrl listHead = m_CommandList.GetHeader(); + listHead.GetWindowRect(&headRect); + + int rowsHeight = listRect.Height() - headRect.Height(); + + int nRows = (rowsHeight / m_RowHeight); + + if (m_CommandListRows != nRows) + { + m_CommandListRows = nRows; + ShowAddress(m_StartAddress, TRUE); + } + + m_RegisterTabs.RedrawCurrentTab(); + + // Fix cmd list header + listHead.ResizeClient(listRect.Width(), headRect.Height()); + + // Setup address input m_AddressEdit.SetDisplayType(CEditNumber32::DisplayHex); m_AddressEdit.SetLimitText(8); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp index 1c379d1e0..3c51984de 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-DMALogView.cpp @@ -146,6 +146,24 @@ LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM { DlgResize_Init(false, true); + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(DMALogView_Top, (uint32_t &)Y); + UISettingsLoadDword(DMALogView_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(DMALogView_Width); + int32_t Height = UISettingsLoadDword(DMALogView_Height); + + SetSize(Width, Height); + m_bConvertingAddress = false; m_nLastStartIndex = 0; diff --git a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp index 4699895ad..335a46e2e 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-MemorySearch.cpp @@ -40,6 +40,19 @@ void CDebugMemorySearch::AddAlignmentOptions(CComboBox & ctrl) LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(MemorySearch_Top, (uint32_t &)Y); + UISettingsLoadDword(MemorySearch_Left, (uint32_t &)X); + + SetPos(X, Y); + m_PAddrStart.Attach(GetDlgItem(IDC_PADDR_START)); m_PAddrStart.SetDisplayType(CEditNumber32::DisplayHex); m_SearchLen.Attach(GetDlgItem(IDC_ADDR_END)); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp index 9958c84c7..4fd6c74b1 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Scripts.cpp @@ -31,6 +31,24 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l { DlgResize_Init(false, true); + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(Scripts_Top, (uint32_t &)Y); + UISettingsLoadDword(Scripts_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(Scripts_Width); + int32_t Height = UISettingsLoadDword(Scripts_Height); + + SetSize(Width, Height); + HFONT monoFont = CreateFont(-11, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp index 530f3fafe..72f1a4f47 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.cpp @@ -49,6 +49,24 @@ void CDebugStackTrace::ClearEntries() LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { DlgResize_Init(); + + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(StackTrace_Top, (uint32_t &)Y); + UISettingsLoadDword(StackTrace_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(StackTrace_Width); + int32_t Height = UISettingsLoadDword(StackTrace_Height); + + SetSize(Width, Height); m_List.Attach(GetDlgItem(IDC_STACKTRACE_LIST)); m_List.AddColumn("Caller", 0); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp index ed2a4072d..5d1cbc0cc 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-StackView.cpp @@ -26,6 +26,24 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM / { DlgResize_Init(false, true); + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(StackView_Top, (uint32_t &)Y); + UISettingsLoadDword(StackView_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(StackView_Width); + int32_t Height = UISettingsLoadDword(StackView_Height); + + SetSize(Width, Height); + m_StackList.Attach(GetDlgItem(IDC_STACK_LIST)); m_StackList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); m_StackList.AddColumn("#", 0); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp index 5392b6984..3582e83c6 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-Symbols.cpp @@ -26,6 +26,24 @@ LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l { DlgResize_Init(false, true); + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(Symbols_Top, (uint32_t &)Y); + UISettingsLoadDword(Symbols_Left, (uint32_t &)X); + + SetPos(X, Y); + + int32_t Width = UISettingsLoadDword(Symbols_Width); + int32_t Height = UISettingsLoadDword(Symbols_Height); + + SetSize(Width, Height); + m_SymbolsListView.Attach(GetDlgItem(IDC_SYMBOLS_LIST)); m_SymbolsListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER); diff --git a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp index 4f12cc801..1f838d209 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-TLB.cpp @@ -23,6 +23,19 @@ CDebugTlb::~CDebugTlb() LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(TLB_Top, (uint32_t &)Y); + UISettingsLoadDword(TLB_Left, (uint32_t &)X); + + SetPos(X, Y); + LV_COLUMN col; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; diff --git a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp index b4aabb612..8fc67f013 100644 --- a/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp +++ b/Source/Project64/UserInterface/Debugger/Debugger-ViewMemory.cpp @@ -38,6 +38,19 @@ CDebugMemoryView::~CDebugMemoryView() LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { + CRect m_DefaultWindowRect; + GetWindowRect(&m_DefaultWindowRect); + + //We find the middle position of the screen, we use this if theres no setting + int32_t X = GetX(m_DefaultWindowRect); + int32_t Y = GetY(m_DefaultWindowRect); + + //Load the value from settings, if none is available, default to above + UISettingsLoadDword(ViewMemory_Top, (uint32_t &)Y); + UISettingsLoadDword(ViewMemory_Left, (uint32_t &)X); + + SetPos(X, Y); + m_SymbolColorStride = 0; m_SymbolColorPhase = 0; m_DataStartLoc = (DWORD)-1;