2018-03-16 12:39:53 +01:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-03-16 12:39:53 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2021-09-01 14:53:20 +04:00
|
|
|
#include <QByteArray>
|
2018-03-16 12:39:53 +01:00
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class MemoryViewWidget;
|
|
|
|
class QCheckBox;
|
2022-04-06 16:20:55 -07:00
|
|
|
class QComboBox;
|
2018-03-16 12:39:53 +01:00
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
|
|
|
class QPushButton;
|
|
|
|
class QRadioButton;
|
2019-07-06 10:50:11 +02:00
|
|
|
class QShowEvent;
|
2018-03-16 12:39:53 +01:00
|
|
|
class QSplitter;
|
|
|
|
|
2023-02-12 11:07:11 +01:00
|
|
|
namespace Core
|
|
|
|
{
|
2024-03-01 06:52:03 -08:00
|
|
|
class System;
|
2023-02-12 11:07:11 +01:00
|
|
|
class CPUThreadGuard;
|
2024-03-01 06:52:03 -08:00
|
|
|
} // namespace Core
|
2023-02-12 11:07:11 +01:00
|
|
|
|
2018-03-16 12:39:53 +01:00
|
|
|
class MemoryWidget : public QDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-03-01 06:52:03 -08:00
|
|
|
explicit MemoryWidget(Core::System& system, QWidget* parent = nullptr);
|
2018-03-16 12:39:53 +01:00
|
|
|
~MemoryWidget();
|
|
|
|
|
2018-12-28 19:12:30 +01:00
|
|
|
void SetAddress(u32 address);
|
2018-03-16 12:39:53 +01:00
|
|
|
void Update();
|
|
|
|
signals:
|
|
|
|
void BreakpointsChanged();
|
2018-12-28 19:12:30 +01:00
|
|
|
void ShowCode(u32 address);
|
2021-02-17 21:12:27 +04:00
|
|
|
void RequestWatch(QString name, u32 address);
|
2018-03-16 12:39:53 +01:00
|
|
|
|
|
|
|
private:
|
2021-09-01 11:58:56 +04:00
|
|
|
struct TargetAddress
|
|
|
|
{
|
|
|
|
u32 address = 0;
|
|
|
|
bool is_good_address = false;
|
|
|
|
bool is_good_offset = false;
|
|
|
|
};
|
|
|
|
|
2018-03-16 12:39:53 +01:00
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
|
|
|
|
void LoadSettings();
|
|
|
|
void SaveSettings();
|
|
|
|
|
2019-04-11 01:50:52 -04:00
|
|
|
void OnAddressSpaceChanged();
|
2022-04-06 02:36:09 -07:00
|
|
|
void OnDisplayChanged();
|
2018-03-16 12:39:53 +01:00
|
|
|
void OnBPLogChanged();
|
|
|
|
void OnBPTypeChanged();
|
|
|
|
|
|
|
|
void OnSearchAddress();
|
|
|
|
void OnFindNextValue();
|
|
|
|
void OnFindPreviousValue();
|
|
|
|
|
|
|
|
void OnSetValue();
|
2022-04-10 21:02:33 -05:00
|
|
|
void OnSetValueFromFile();
|
2018-03-16 12:39:53 +01:00
|
|
|
|
|
|
|
void OnDumpMRAM();
|
|
|
|
void OnDumpExRAM();
|
2019-04-11 01:50:52 -04:00
|
|
|
void OnDumpARAM();
|
2018-03-16 12:39:53 +01:00
|
|
|
void OnDumpFakeVMEM();
|
|
|
|
|
2022-04-06 16:20:55 -07:00
|
|
|
void ValidateAndPreviewInputValue();
|
|
|
|
QByteArray GetInputData() const;
|
2021-09-01 11:58:56 +04:00
|
|
|
TargetAddress GetTargetAddress() const;
|
2018-03-16 12:39:53 +01:00
|
|
|
void FindValue(bool next);
|
|
|
|
|
|
|
|
void closeEvent(QCloseEvent*) override;
|
2019-07-06 10:50:11 +02:00
|
|
|
void showEvent(QShowEvent* event) override;
|
2018-03-16 12:39:53 +01:00
|
|
|
|
2024-03-01 06:52:03 -08:00
|
|
|
Core::System& m_system;
|
|
|
|
|
2018-03-16 12:39:53 +01:00
|
|
|
MemoryViewWidget* m_memory_view;
|
|
|
|
QSplitter* m_splitter;
|
2022-10-20 00:56:06 -07:00
|
|
|
QComboBox* m_search_address;
|
2020-09-13 17:03:17 +01:00
|
|
|
QLineEdit* m_search_offset;
|
2018-03-16 12:39:53 +01:00
|
|
|
QLineEdit* m_data_edit;
|
2022-04-06 16:20:55 -07:00
|
|
|
QCheckBox* m_base_check;
|
|
|
|
QLabel* m_data_preview;
|
2022-04-06 02:36:09 -07:00
|
|
|
QComboBox* m_display_combo;
|
|
|
|
QComboBox* m_align_combo;
|
|
|
|
QComboBox* m_row_length_combo;
|
2022-04-06 22:50:05 -07:00
|
|
|
QCheckBox* m_dual_check;
|
2018-03-16 12:39:53 +01:00
|
|
|
QPushButton* m_set_value;
|
|
|
|
|
|
|
|
// Search
|
|
|
|
QPushButton* m_find_next;
|
|
|
|
QPushButton* m_find_previous;
|
2022-04-06 16:20:55 -07:00
|
|
|
QComboBox* m_input_combo;
|
2018-03-16 12:39:53 +01:00
|
|
|
QLabel* m_result_label;
|
|
|
|
|
2019-04-11 01:50:52 -04:00
|
|
|
// Address Spaces
|
|
|
|
QRadioButton* m_address_space_physical;
|
|
|
|
QRadioButton* m_address_space_effective;
|
|
|
|
QRadioButton* m_address_space_auxiliary;
|
|
|
|
|
2018-03-16 12:39:53 +01:00
|
|
|
// Breakpoint options
|
|
|
|
QRadioButton* m_bp_read_write;
|
|
|
|
QRadioButton* m_bp_read_only;
|
|
|
|
QRadioButton* m_bp_write_only;
|
|
|
|
QCheckBox* m_bp_log_check;
|
|
|
|
};
|