[Debugger] Make auto-refresh optional in memory viewer

This commit is contained in:
shygoo 2018-12-08 06:45:52 -06:00
parent 92887d757b
commit a2808d94ce
6 changed files with 24 additions and 4 deletions

View File

@ -330,6 +330,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Debugger_WriteBPExists, new CSettingTypeTempBool(false));
AddHandler(Debugger_ReadBPExists, new CSettingTypeTempBool(false));
AddHandler(Debugger_WaitingForStep, new CSettingTypeTempBool(false));
AddHandler(Debugger_AutoRefreshMemoryView, new CSettingTypeApplication("Debugger", "Auto Referesh Memory View", true));
AddHandler(Debugger_DebugLanguage, new CSettingTypeApplication("Debugger", "Debug Language", false));
AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false));
AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false));

View File

@ -246,6 +246,7 @@ enum SettingID
Debugger_WriteBPExists,
Debugger_ReadBPExists,
Debugger_WaitingForStep,
Debugger_AutoRefreshMemoryView,
//Trace
Debugger_TraceMD5,

View File

@ -119,6 +119,9 @@ LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
m_SymInfo.Attach(GetDlgItem(IDC_SYM_INFO));
m_DMAInfo.Attach(GetDlgItem(IDC_DMA_INFO));
m_bAutoRefreshEnabled = g_Settings->LoadBool(Debugger_AutoRefreshMemoryView);
SendDlgItemMessage(IDC_CHK_AUTOREFRESH, BM_SETCHECK, m_bAutoRefreshEnabled ? BST_CHECKED : BST_UNCHECKED, 0);
_this = this;
DWORD dwThreadID = ::GetCurrentThreadId();
@ -136,7 +139,10 @@ DWORD WINAPI CDebugMemoryView::AutoRefreshProc(void* _self)
CDebugMemoryView* self = (CDebugMemoryView*)_self;
while (true)
{
self->RefreshMemory(true);
if (self->m_bAutoRefreshEnabled)
{
self->RefreshMemory(true);
}
Sleep(100);
}
}
@ -203,6 +209,10 @@ LRESULT CDebugMemoryView::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL&
case IDC_SYMBOLS_BTN:
m_Debugger->OpenSymbolsWindow();
break;
case IDC_CHK_AUTOREFRESH:
m_bAutoRefreshEnabled = (SendMessage(GetDlgItem(IDC_CHK_AUTOREFRESH), BM_GETSTATE, 0, 0) & BST_CHECKED) != 0;
g_Settings->SaveBool(Debugger_AutoRefreshMemoryView, m_bAutoRefreshEnabled);
break;
case IDCANCEL:
EndDialog(0);
break;

View File

@ -72,6 +72,8 @@ private:
CStatic m_SymInfo;
CStatic m_DMAInfo;
bool m_bAutoRefreshEnabled;
CBreakpoints* m_Breakpoints;
int m_SymbolColorStride;

View File

@ -25,7 +25,6 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@ -529,6 +528,7 @@ BEGIN
LTEXT "",IDC_SYM_INFO,8,198,418,8
LTEXT "",IDC_DMA_INFO,8,208,415,8
GROUPBOX "",IDC_STATIC,4,190,428,30
CONTROL "Auto",IDC_CHK_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,218,7,31,8
END
IDD_Debugger_Search DIALOGEX 0, 0, 229, 233
@ -1881,6 +1881,11 @@ BEGIN
0
END
IDD_Debugger_Memory AFX_DIALOG_LAYOUT
BEGIN
0
END
/////////////////////////////////////////////////////////////////////////////
//

View File

@ -603,6 +603,7 @@
#define IDC_DD44_EDIT 1443
#define IDC_DD48_EDIT 1444
#define IDC_ROM_FIXEDAUDIO 1445
#define IDC_CHK_AUTOREFRESH 1446
#define ID_POPUP_SHOWINMEMORYVIEWER 40005
#define ID_POPUPMENU_PLAYGAMEWITHDISK 40008
#define ID_POPUPMENU_ADDSYMBOL 40013
@ -638,9 +639,9 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 195
#define _APS_NEXT_RESOURCE_VALUE 196
#define _APS_NEXT_COMMAND_VALUE 40043
#define _APS_NEXT_CONTROL_VALUE 1446
#define _APS_NEXT_CONTROL_VALUE 1447
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif