2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
class CDebugMemorySearch :
|
|
|
|
public CDebugDialog<CDebugMemorySearch>
|
|
|
|
{
|
2012-12-18 08:47:53 +00:00
|
|
|
public:
|
|
|
|
enum { IDD = IDD_Debugger_Search };
|
|
|
|
|
|
|
|
CDebugMemorySearch(CDebugger * debugger);
|
|
|
|
virtual ~CDebugMemorySearch(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CDebugMemorySearch(void); // Disable default constructor
|
|
|
|
CDebugMemorySearch(const CDebugMemorySearch&); // Disable copy constructor
|
|
|
|
CDebugMemorySearch& operator=(const CDebugMemorySearch&); // Disable assignment
|
|
|
|
|
2015-01-22 05:50:20 +00:00
|
|
|
enum MemorySize
|
|
|
|
{
|
|
|
|
_8Bit,
|
|
|
|
_16Bit,
|
|
|
|
_32Bit,
|
|
|
|
};
|
|
|
|
|
|
|
|
//Searching for value
|
|
|
|
enum SearchMemChangeState
|
|
|
|
{
|
|
|
|
SearchChangeState_Reset,
|
|
|
|
SearchChangeState_Changed,
|
|
|
|
SearchChangeState_Unchanged,
|
|
|
|
SearchChangeState_Greater,
|
|
|
|
SearchChangeState_Lessthan,
|
|
|
|
};
|
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
typedef struct {
|
|
|
|
DWORD PAddr;
|
|
|
|
DWORD Value;
|
|
|
|
} SearchResultItem;
|
2012-12-18 08:47:53 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
typedef std::vector<SearchResultItem> SearchResult;
|
2012-12-18 08:47:53 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
BEGIN_MSG_MAP_EX(CDebugMemorySearch)
|
|
|
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
|
|
|
COMMAND_CODE_HANDLER(BN_CLICKED,OnClicked)
|
|
|
|
NOTIFY_HANDLER_EX(IDC_LST_RESULTS,NM_RCLICK,OnResultRClick)
|
2015-01-22 05:50:20 +00:00
|
|
|
END_MSG_MAP()
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-01-22 05:50:20 +00:00
|
|
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
2008-09-18 03:15:49 +00:00
|
|
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
|
|
|
LRESULT OnResultRClick ( LPNMHDR lpnmh );
|
|
|
|
|
|
|
|
void EnableUnknownOptions ( bool Enable );
|
|
|
|
void EnableValueOptions ( bool Enable );
|
|
|
|
void EnableTextOptions ( bool Enable );
|
|
|
|
void EnableJalOptions ( bool Enable );
|
|
|
|
void AddAlignmentOptions ( CComboBox & ctrl );
|
2012-12-18 08:47:53 +00:00
|
|
|
|
2008-09-18 03:15:49 +00:00
|
|
|
CEditNumber m_PAddrStart, m_SearchLen, m_SearchValue, m_MaxSearch;
|
|
|
|
CComboBox m_UnknownOptions, m_ValueSize, m_UnknownSize;
|
|
|
|
CListViewCtrl m_SearchResults;
|
|
|
|
SearchResult m_SearchResult;
|
|
|
|
bool m_HaveResults;
|
2012-12-18 08:47:53 +00:00
|
|
|
|
2015-01-22 05:50:20 +00:00
|
|
|
//Searching memory
|
|
|
|
BYTE * m_MemoryState;
|
|
|
|
DWORD m_MemoryStateSize;
|
|
|
|
|
|
|
|
void FixUnknownOptions ( bool Reset );
|
|
|
|
void SearchForUnknown ( void );
|
|
|
|
void SearchForValue ( void );
|
|
|
|
void SearchForText ( void );
|
|
|
|
void Reset ( void );
|
|
|
|
bool SearchSetBaseForChanges ( void );
|
|
|
|
bool SearchForChanges ( SearchMemChangeState SearchType, MemorySize Size, DWORD &StartAddress, DWORD &Len, DWORD &OldValue, DWORD &NewValue );
|
|
|
|
bool SearchForValue ( DWORD Value, MemorySize Size, DWORD &StartAddress, DWORD &Len );
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|