| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <QByteArray> |
| 7 |
#include <QDockWidget> |
| 8 |
|
| 9 |
#include "Common/CommonTypes.h" |
| 10 |
#include "VideoCommon/VideoEvents.h" |
| 11 |
|
| 12 |
class MemoryViewWidget; |
| 13 |
class QCheckBox; |
| 14 |
class QComboBox; |
| 15 |
class QGroupBox; |
| 16 |
class QHideEvent; |
| 17 |
class QLabel; |
| 18 |
class QLineEdit; |
| 19 |
class QListWidget; |
| 20 |
class QPushButton; |
| 21 |
class QRadioButton; |
| 22 |
class QShowEvent; |
| 23 |
class QSplitter; |
| 24 |
|
| 25 |
namespace Core |
| 26 |
{ |
| 27 |
class System; |
| 28 |
class CPUThreadGuard; |
| 29 |
} |
| 30 |
|
| 31 |
class PPCSymbolDB; |
| 32 |
|
| 33 |
class MemoryWidget : public QDockWidget |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
public: |
| 37 |
explicit MemoryWidget(Core::System& system, QWidget* parent = nullptr); |
| 38 |
~MemoryWidget() override; |
| 39 |
|
| 40 |
void SetAddress(u32 address); |
| 41 |
void Update(); |
| 42 |
signals: |
| 43 |
void ShowCode(u32 address); |
| 44 |
void RequestWatch(QString name, u32 address); |
| 45 |
|
| 46 |
private: |
| 47 |
struct TargetAddress |
| 48 |
{ |
| 49 |
u32 address = 0; |
| 50 |
bool is_good_address = false; |
| 51 |
bool is_good_offset = false; |
| 52 |
}; |
| 53 |
|
| 54 |
void CreateWidgets(); |
| 55 |
void ConnectWidgets(); |
| 56 |
|
| 57 |
void LoadSettings(); |
| 58 |
void SaveSettings(); |
| 59 |
|
| 60 |
void OnAddressSpaceChanged(); |
| 61 |
void OnDisplayChanged(); |
| 62 |
void OnBPLogChanged(); |
| 63 |
void OnBPTypeChanged(); |
| 64 |
|
| 65 |
void OnSearchAddress(); |
| 66 |
void OnFindNextValue(); |
| 67 |
void OnFindPreviousValue(); |
| 68 |
|
| 69 |
void OnSetValue(); |
| 70 |
void OnSetValueFromFile(); |
| 71 |
|
| 72 |
void OnSelectLabel(); |
| 73 |
void RefreshLabelBox(); |
| 74 |
void UpdateSymbols(); |
| 75 |
void UpdateNotes(); |
| 76 |
|
| 77 |
void OnDumpMRAM(); |
| 78 |
void OnDumpExRAM(); |
| 79 |
void OnDumpARAM(); |
| 80 |
void OnDumpFakeVMEM(); |
| 81 |
|
| 82 |
void ValidateAndPreviewInputValue(); |
| 83 |
QByteArray GetInputData() const; |
| 84 |
TargetAddress GetTargetAddress() const; |
| 85 |
void FindValue(bool next); |
| 86 |
|
| 87 |
void closeEvent(QCloseEvent*) override; |
| 88 |
void hideEvent(QHideEvent* event) override; |
| 89 |
void showEvent(QShowEvent* event) override; |
| 90 |
void RegisterAfterFrameEventCallback(); |
| 91 |
void RemoveAfterFrameEventCallback(); |
| 92 |
void AutoUpdateTable(); |
| 93 |
void ActivateSearchAddress(); |
| 94 |
|
| 95 |
Core::System& m_system; |
| 96 |
PPCSymbolDB& m_ppc_symbol_db; |
| 97 |
|
| 98 |
MemoryViewWidget* m_memory_view; |
| 99 |
QSplitter* m_splitter; |
| 100 |
QComboBox* m_search_address; |
| 101 |
QLineEdit* m_search_offset; |
| 102 |
QLineEdit* m_data_edit; |
| 103 |
QCheckBox* m_base_check; |
| 104 |
QLabel* m_data_preview; |
| 105 |
QComboBox* m_display_combo; |
| 106 |
QComboBox* m_align_combo; |
| 107 |
QComboBox* m_row_length_combo; |
| 108 |
QCheckBox* m_dual_check; |
| 109 |
QPushButton* m_set_value; |
| 110 |
|
| 111 |
|
| 112 |
QPushButton* m_find_next; |
| 113 |
QPushButton* m_find_previous; |
| 114 |
QComboBox* m_input_combo; |
| 115 |
QLabel* m_result_label; |
| 116 |
|
| 117 |
|
| 118 |
QRadioButton* m_address_space_physical; |
| 119 |
QRadioButton* m_address_space_effective; |
| 120 |
QRadioButton* m_address_space_auxiliary; |
| 121 |
|
| 122 |
|
| 123 |
QRadioButton* m_bp_read_write; |
| 124 |
QRadioButton* m_bp_read_only; |
| 125 |
QRadioButton* m_bp_write_only; |
| 126 |
QCheckBox* m_bp_log_check; |
| 127 |
|
| 128 |
QGroupBox* m_labels_group; |
| 129 |
QLineEdit* m_search_labels; |
| 130 |
QListWidget* m_symbols_list; |
| 131 |
QListWidget* m_data_list; |
| 132 |
QListWidget* m_note_list; |
| 133 |
QString m_note_filter; |
| 134 |
bool m_labels_visible = true; |
| 135 |
|
| 136 |
Common::EventHook m_vi_end_field_event; |
| 137 |
|
| 138 |
bool m_auto_update_enabled = true; |
| 139 |
}; |