| 
									
										
										
										
											2015-05-24 06:55:12 +02:00
										 |  |  | // Copyright 2014 Dolphin Emulator Project
 | 
					
						
							| 
									
										
										
										
											2015-05-18 01:08:10 +02:00
										 |  |  | // Licensed under GPLv2+
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | // Refer to the license.txt file included.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <wx/colour.h>
 | 
					
						
							|  |  |  | #include <wx/grid.h>
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | #include <wx/menu.h>
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "Common/GekkoDisassembler.h"
 | 
					
						
							|  |  |  | #include "Core/HW/Memmap.h"
 | 
					
						
							|  |  |  | #include "Core/PowerPC/PowerPC.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | #include "DolphinWX/Frame.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | #include "DolphinWX/WxUtils.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | #include "DolphinWX/Debugger/BreakpointWindow.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | #include "DolphinWX/Debugger/CodeWindow.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | #include "DolphinWX/Debugger/DebuggerUIUtil.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | #include "DolphinWX/Debugger/MemoryWindow.h"
 | 
					
						
							|  |  |  | #include "DolphinWX/Debugger/RegisterView.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | #include "DolphinWX/Debugger/WatchView.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | #include "DolphinWX/Debugger/WatchWindow.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | enum | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-04-22 23:17:09 -04:00
										 |  |  | 	IDM_DELETEWATCH = 1, | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	IDM_ADDMEMCHECK, | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 	IDM_VIEWMEMORY, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | static std::string GetWatchName(int count) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return PowerPC::watches.GetWatches().at(count - 1).name; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static u32 GetWatchAddr(int count) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return PowerPC::watches.GetWatches().at(count - 1).iAddress; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static u32 GetWatchValue(int count) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-01-17 13:17:36 -08:00
										 |  |  | 	return PowerPC::HostRead_U32(GetWatchAddr(count)); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void AddWatchAddr(int count, u32 value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PowerPC::watches.Add(value); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void UpdateWatchAddr(int count, u32 value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	PowerPC::watches.Update(count - 1, value); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-15 14:06:12 -05:00
										 |  |  | static void SetWatchName(int count, const std::string& value) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2014-10-28 21:03:58 -05:00
										 |  |  | 	if ((count - 1) < (int)PowerPC::watches.GetWatches().size()) | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		PowerPC::watches.UpdateName(count - 1, value); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		PowerPC::watches.Add(0); | 
					
						
							|  |  |  | 		PowerPC::watches.UpdateName(PowerPC::watches.GetWatches().size() - 1, value); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void SetWatchValue(int count, u32 value) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-01-17 13:17:36 -08:00
										 |  |  | 	PowerPC::HostWrite_U32(value, GetWatchAddr(count)); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | static wxString GetValueByRowCol(int row, int col) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (row == 0) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		// Column Labels
 | 
					
						
							|  |  |  | 		switch (col) | 
					
						
							|  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2015-02-23 11:02:42 -05:00
										 |  |  | 		case 0: return _("Label"); | 
					
						
							|  |  |  | 		case 1: return _("Address"); | 
					
						
							|  |  |  | 		case 2: return _("Hexadecimal"); | 
					
						
							|  |  |  | 		case 3: return _("Decimal"); | 
					
						
							|  |  |  | 		case 4: return _("String"); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 		default: return wxEmptyString; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-10-28 21:03:58 -05:00
										 |  |  | 	else if (row <= (int)PowerPC::watches.GetWatches().size()) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			switch (col) | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 			case 0: return wxString::Format("%s", GetWatchName(row)); | 
					
						
							|  |  |  | 			case 1: return wxString::Format("%08x", GetWatchAddr(row)); | 
					
						
							|  |  |  | 			case 2: return wxString::Format("%08x", GetWatchValue(row)); | 
					
						
							| 
									
										
										
										
											2015-04-22 23:17:09 -04:00
										 |  |  | 			case 3: return wxString::Format("%u", GetWatchValue(row)); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 			case 4: | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				u32 addr = GetWatchAddr(row); | 
					
						
							| 
									
										
										
										
											2015-01-17 13:17:36 -08:00
										 |  |  | 				if (PowerPC::HostIsRAMAddress(addr)) | 
					
						
							|  |  |  | 					return PowerPC::HostGetString(addr, 32).c_str(); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 				else | 
					
						
							|  |  |  | 					return wxEmptyString; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			default: return wxEmptyString; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return wxEmptyString; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | wxString CWatchTable::GetValue(int row, int col) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return GetValueByRowCol(row, col); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | void CWatchTable::SetValue(int row, int col, const wxString& strNewVal) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	u32 newVal = 0; | 
					
						
							|  |  |  | 	if (col == 0 || TryParse("0x" + WxStrToStr(strNewVal), &newVal)) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		if (row > 0) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			switch (col) | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 			case 0: | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				SetWatchName(row, std::string(WxStrToStr(strNewVal))); | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			case 1: | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				if (row > (int)PowerPC::watches.GetWatches().size()) | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					AddWatchAddr(row, newVal); | 
					
						
							|  |  |  | 					row = (int)PowerPC::watches.GetWatches().size(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				else | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					UpdateWatchAddr(row, newVal); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			case 2: | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				SetWatchValue(row, newVal); | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			default: | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void CWatchTable::UpdateWatch() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	for (int i = 0; i < (int)PowerPC::watches.GetWatches().size(); ++i) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		m_CachedWatchHasChanged[i] = (m_CachedWatch[i] != GetWatchValue(i + 1)); | 
					
						
							|  |  |  | 		m_CachedWatch[i] = GetWatchValue(i + 1); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | wxGridCellAttr* CWatchTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | 	wxGridCellAttr* attr = new wxGridCellAttr(); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	attr->SetBackgroundColour(*wxWHITE); | 
					
						
							|  |  |  | 	attr->SetFont(DebuggerFont); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	switch (col) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 	case 1: | 
					
						
							|  |  |  | 		attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case 3: | 
					
						
							|  |  |  | 	case 4: | 
					
						
							|  |  |  | 		attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	default: | 
					
						
							|  |  |  | 		attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTER); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (row == 0) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		attr->SetReadOnly(true); | 
					
						
							|  |  |  | 		attr->SetBackgroundColour(*wxBLACK); | 
					
						
							|  |  |  | 		attr->SetTextColour(*wxWHITE); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		bool red = false; | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | 		if (col == 1) | 
					
						
							|  |  |  | 			red = m_CachedWatchHasChanged[row]; | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		attr->SetTextColour(red ? *wxRED : *wxBLACK); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 		if (row > (int)(PowerPC::watches.GetWatches().size() + 1) || (PowerPC::GetState() == PowerPC::CPU_POWERDOWN)) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 		{ | 
					
						
							|  |  |  | 			attr->SetReadOnly(true); | 
					
						
							|  |  |  | 			attr->SetBackgroundColour(*wxLIGHT_GREY); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-04-07 23:16:26 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 	return attr; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | CWatchView::CWatchView(wxWindow* parent, wxWindowID id) | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 	: wxGrid(parent, id) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-03-24 09:37:20 -04:00
										 |  |  | 	m_watch_table = new CWatchTable(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetTable(m_watch_table, true); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 	SetRowLabelSize(0); | 
					
						
							|  |  |  | 	SetColLabelSize(0); | 
					
						
							|  |  |  | 	DisableDragRowSize(); | 
					
						
							| 
									
										
										
										
											2014-11-05 22:19:52 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CWatchView::OnMouseDownR, this); | 
					
						
							|  |  |  | 	Bind(wxEVT_MENU, &CWatchView::OnPopupMenu, this); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void CWatchView::Update() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (PowerPC::GetState() != PowerPC::CPU_POWERDOWN) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2015-03-24 09:37:20 -04:00
										 |  |  | 		m_watch_table->UpdateWatch(); | 
					
						
							| 
									
										
										
										
											2015-04-15 00:11:57 -04:00
										 |  |  | 		ForceRefresh(); | 
					
						
							| 
									
										
										
										
											2014-10-19 21:45:40 +11:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | void CWatchView::OnMouseDownR(wxGridEvent& event) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	// popup menu
 | 
					
						
							|  |  |  | 	int row = event.GetRow(); | 
					
						
							|  |  |  | 	int col = event.GetCol(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	m_selectedRow = row; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 	if (col == 1 || col == 2) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		wxString strNewVal = GetValueByRowCol(row, col); | 
					
						
							|  |  |  | 		TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress); | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 09:50:11 -05:00
										 |  |  | 	wxMenu menu; | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1)) | 
					
						
							| 
									
										
										
										
											2014-11-11 09:50:11 -05:00
										 |  |  | 		menu.Append(IDM_DELETEWATCH, _("&Delete watch")); | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (row != 0 && row != (int)(PowerPC::watches.GetWatches().size() + 1) && (col == 1 || col == 2)) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | #ifdef ENABLE_MEM_CHECK
 | 
					
						
							| 
									
										
										
										
											2014-11-11 09:50:11 -05:00
										 |  |  | 		menu.Append(IDM_ADDMEMCHECK, _("Add memory &breakpoint")); | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2014-11-11 09:50:11 -05:00
										 |  |  | 		menu.Append(IDM_VIEWMEMORY, _("View &memory")); | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-11-11 09:50:11 -05:00
										 |  |  | 	PopupMenu(&menu); | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void CWatchView::OnPopupMenu(wxCommandEvent& event) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-11-28 22:38:53 +01:00
										 |  |  | 	CFrame* main_frame = static_cast<CFrame*>(GetGrandParent()->GetParent()); | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 	CCodeWindow* code_window = main_frame->g_pCodeWindow; | 
					
						
							|  |  |  | 	CWatchWindow* watch_window = code_window->m_WatchWindow; | 
					
						
							|  |  |  | 	CMemoryWindow* memory_window = code_window->m_MemoryWindow; | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	CBreakPointWindow* breakpoint_window = code_window->m_BreakpointWindow; | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	wxString strNewVal; | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	TMemCheck MemCheck; | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	switch (event.GetId()) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 	case IDM_DELETEWATCH: | 
					
						
							|  |  |  | 		strNewVal = GetValueByRowCol(m_selectedRow, 1); | 
					
						
							| 
									
										
										
										
											2014-10-26 23:23:45 +11:00
										 |  |  | 		if (TryParse("0x" + WxStrToStr(strNewVal), &m_selectedAddress)) | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			PowerPC::watches.Remove(m_selectedAddress); | 
					
						
							|  |  |  | 			if (watch_window) | 
					
						
							|  |  |  | 				watch_window->NotifyUpdate(); | 
					
						
							|  |  |  | 			Refresh(); | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 	case IDM_ADDMEMCHECK: | 
					
						
							|  |  |  | 		MemCheck.StartAddress = m_selectedAddress; | 
					
						
							|  |  |  | 		MemCheck.EndAddress = m_selectedAddress; | 
					
						
							| 
									
										
										
										
											2014-10-31 11:26:17 +11:00
										 |  |  | 		MemCheck.bRange = false; | 
					
						
							| 
									
										
										
										
											2014-10-26 16:14:17 +11:00
										 |  |  | 		MemCheck.OnRead = true; | 
					
						
							|  |  |  | 		MemCheck.OnWrite = true; | 
					
						
							|  |  |  | 		MemCheck.Log = true; | 
					
						
							|  |  |  | 		MemCheck.Break = true; | 
					
						
							|  |  |  | 		PowerPC::memchecks.Add(MemCheck); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (breakpoint_window) | 
					
						
							|  |  |  | 			breakpoint_window->NotifyUpdate(); | 
					
						
							|  |  |  | 		Refresh(); | 
					
						
							|  |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2014-10-24 17:16:54 +11:00
										 |  |  | 	case IDM_VIEWMEMORY: | 
					
						
							|  |  |  | 		if (memory_window) | 
					
						
							|  |  |  | 			memory_window->JumpToAddress(m_selectedAddress); | 
					
						
							|  |  |  | 		Refresh(); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	event.Skip(); | 
					
						
							|  |  |  | } |