2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/control.h>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class DebugInterface;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2015-07-09 11:47:51 +00:00
|
|
|
enum class MemoryDataType
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
U8,
|
|
|
|
U16,
|
2016-10-03 07:29:50 +00:00
|
|
|
U32,
|
|
|
|
ASCII,
|
|
|
|
FloatingPoint
|
2015-07-09 11:47:51 +00:00
|
|
|
};
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
wxDECLARE_EVENT(DOLPHIN_EVT_MEMORY_VIEW_DATA_TYPE_CHANGED, wxCommandEvent);
|
|
|
|
|
2009-06-17 19:50:59 +00:00
|
|
|
class CMemoryView : public wxControl
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2009-06-17 19:50:59 +00:00
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
CMemoryView(DebugInterface* debuginterface, wxWindow* parent);
|
|
|
|
|
|
|
|
u32 GetSelection() const { return selection; }
|
|
|
|
int GetMemoryType() const { return memory; }
|
|
|
|
void Center(u32 addr)
|
|
|
|
{
|
|
|
|
curAddress = addr;
|
|
|
|
Refresh();
|
|
|
|
}
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
void SetDataType(MemoryDataType data_type);
|
|
|
|
MemoryDataType GetDataType() const { return m_data_type; }
|
2016-08-18 20:08:26 +00:00
|
|
|
void SetMemCheckOptions(bool read, bool write, bool log)
|
|
|
|
{
|
|
|
|
memCheckRead = read;
|
|
|
|
memCheckWrite = write;
|
|
|
|
memCheckLog = log;
|
|
|
|
}
|
|
|
|
|
2009-06-17 19:50:59 +00:00
|
|
|
private:
|
2016-10-03 07:29:50 +00:00
|
|
|
int YToAddress(int y);
|
|
|
|
bool IsHexMode() const
|
|
|
|
{
|
|
|
|
return m_data_type != MemoryDataType::ASCII && m_data_type != MemoryDataType::FloatingPoint;
|
|
|
|
}
|
|
|
|
|
2017-01-15 17:12:10 +00:00
|
|
|
wxString ReadMemoryAsString(u32 address) const;
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnMouseDownL(wxMouseEvent& event);
|
|
|
|
void OnMouseMove(wxMouseEvent& event);
|
|
|
|
void OnMouseUpL(wxMouseEvent& event);
|
|
|
|
void OnMouseDownR(wxMouseEvent& event);
|
|
|
|
void OnScrollWheel(wxMouseEvent& event);
|
|
|
|
void OnPopupMenu(wxCommandEvent& event);
|
|
|
|
void OnResize(wxSizeEvent& event);
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
static constexpr int LEFT_COL_WIDTH = 16;
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
DebugInterface* debugger;
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
unsigned int align;
|
2016-06-24 08:43:46 +00:00
|
|
|
int rowHeight;
|
2016-10-03 07:29:50 +00:00
|
|
|
int m_left_col_width;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
|
|
|
u32 selection;
|
|
|
|
u32 oldSelection;
|
|
|
|
bool selecting;
|
|
|
|
|
|
|
|
int memory;
|
|
|
|
int curAddress;
|
|
|
|
|
2016-08-18 20:08:26 +00:00
|
|
|
bool memCheckRead;
|
|
|
|
bool memCheckWrite;
|
|
|
|
bool memCheckLog;
|
|
|
|
|
2016-10-03 07:29:50 +00:00
|
|
|
MemoryDataType m_data_type;
|
|
|
|
MemoryDataType m_last_hex_type = MemoryDataType::U8;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|