mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
27d295ec7e
Changes: - MemoryWindow was cleaned up and gives more feedback on searches. Some bugs were fixed as well: - A complex bug that allowed tearing off tabs and opening multiple copies of a debug panel which lead to segfaults - Another segfault related to right-click menus on code/memory views when those tools were floating in their own window.
83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <wx/control.h>
|
|
#include "Common/CommonTypes.h"
|
|
|
|
class DebugInterface;
|
|
|
|
enum class MemoryDataType
|
|
{
|
|
U8,
|
|
U16,
|
|
U32,
|
|
ASCII,
|
|
FloatingPoint
|
|
};
|
|
|
|
wxDECLARE_EVENT(DOLPHIN_EVT_MEMORY_VIEW_DATA_TYPE_CHANGED, wxCommandEvent);
|
|
|
|
class CMemoryView : public wxControl
|
|
{
|
|
public:
|
|
CMemoryView(DebugInterface* debuginterface, wxWindow* parent);
|
|
|
|
u32 GetSelection() const { return selection; }
|
|
int GetMemoryType() const { return memory; }
|
|
void Center(u32 addr)
|
|
{
|
|
curAddress = addr;
|
|
Refresh();
|
|
}
|
|
|
|
void SetDataType(MemoryDataType data_type);
|
|
MemoryDataType GetDataType() const { return m_data_type; }
|
|
void SetMemCheckOptions(bool read, bool write, bool log)
|
|
{
|
|
memCheckRead = read;
|
|
memCheckWrite = write;
|
|
memCheckLog = log;
|
|
}
|
|
|
|
private:
|
|
int YToAddress(int y);
|
|
bool IsHexMode() const
|
|
{
|
|
return m_data_type != MemoryDataType::ASCII && m_data_type != MemoryDataType::FloatingPoint;
|
|
}
|
|
|
|
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);
|
|
|
|
static constexpr int LEFT_COL_WIDTH = 16;
|
|
|
|
DebugInterface* debugger;
|
|
|
|
unsigned int align;
|
|
int rowHeight;
|
|
int m_left_col_width;
|
|
|
|
u32 selection;
|
|
u32 oldSelection;
|
|
bool selecting;
|
|
|
|
int memory;
|
|
int curAddress;
|
|
|
|
bool memCheckRead;
|
|
bool memCheckWrite;
|
|
bool memCheckLog;
|
|
|
|
MemoryDataType m_data_type;
|
|
MemoryDataType m_last_hex_type = MemoryDataType::U8;
|
|
};
|