Merge pull request #1514 from shygoo2/memview-autorefresh-option

[Debugger] Make auto-refresh optional in memory viewer
This commit is contained in:
zilmar 2018-12-09 05:00:04 +10:30 committed by GitHub
commit 0c09c060c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 4 deletions

View File

@ -331,6 +331,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Debugger_WriteBPExists, new CSettingTypeTempBool(false)); AddHandler(Debugger_WriteBPExists, new CSettingTypeTempBool(false));
AddHandler(Debugger_ReadBPExists, new CSettingTypeTempBool(false)); AddHandler(Debugger_ReadBPExists, new CSettingTypeTempBool(false));
AddHandler(Debugger_WaitingForStep, 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_DebugLanguage, new CSettingTypeApplication("Debugger", "Debug Language", false));
AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false)); AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false));
AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false)); AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false));

View File

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

View File

@ -119,6 +119,9 @@ LRESULT CDebugMemoryView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
m_SymInfo.Attach(GetDlgItem(IDC_SYM_INFO)); m_SymInfo.Attach(GetDlgItem(IDC_SYM_INFO));
m_DMAInfo.Attach(GetDlgItem(IDC_DMA_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; _this = this;
DWORD dwThreadID = ::GetCurrentThreadId(); DWORD dwThreadID = ::GetCurrentThreadId();
@ -136,7 +139,10 @@ DWORD WINAPI CDebugMemoryView::AutoRefreshProc(void* _self)
CDebugMemoryView* self = (CDebugMemoryView*)_self; CDebugMemoryView* self = (CDebugMemoryView*)_self;
while (true) while (true)
{ {
self->RefreshMemory(true); if (self->m_bAutoRefreshEnabled)
{
self->RefreshMemory(true);
}
Sleep(100); Sleep(100);
} }
} }
@ -203,6 +209,10 @@ LRESULT CDebugMemoryView::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL&
case IDC_SYMBOLS_BTN: case IDC_SYMBOLS_BTN:
m_Debugger->OpenSymbolsWindow(); m_Debugger->OpenSymbolsWindow();
break; 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: case IDCANCEL:
EndDialog(0); EndDialog(0);
break; break;

View File

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

View File

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

View File

@ -603,6 +603,7 @@
#define IDC_DD44_EDIT 1443 #define IDC_DD44_EDIT 1443
#define IDC_DD48_EDIT 1444 #define IDC_DD48_EDIT 1444
#define IDC_ROM_FIXEDAUDIO 1445 #define IDC_ROM_FIXEDAUDIO 1445
#define IDC_CHK_AUTOREFRESH 1446
#define ID_POPUP_SHOWINMEMORYVIEWER 40005 #define ID_POPUP_SHOWINMEMORYVIEWER 40005
#define ID_POPUPMENU_PLAYGAMEWITHDISK 40008 #define ID_POPUPMENU_PLAYGAMEWITHDISK 40008
#define ID_POPUPMENU_ADDSYMBOL 40013 #define ID_POPUPMENU_ADDSYMBOL 40013
@ -638,9 +639,9 @@
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #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_COMMAND_VALUE 40043
#define _APS_NEXT_CONTROL_VALUE 1446 #define _APS_NEXT_CONTROL_VALUE 1447
#define _APS_NEXT_SYMED_VALUE 102 #define _APS_NEXT_SYMED_VALUE 102
#endif #endif
#endif #endif