2018-03-16 05:39:53 -06:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-03-16 05:39:53 -06:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2019-07-15 21:20:26 -06:00
|
|
|
|
|
|
|
namespace AddressSpace
|
|
|
|
{
|
|
|
|
enum class Type;
|
|
|
|
}
|
2018-03-16 05:39:53 -06:00
|
|
|
|
|
|
|
class MemoryViewWidget : public QTableWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-04-06 03:36:09 -06:00
|
|
|
enum class Type : int
|
2018-03-16 05:39:53 -06:00
|
|
|
{
|
2022-04-06 03:36:09 -06:00
|
|
|
Hex8 = 1,
|
|
|
|
Hex16,
|
|
|
|
Hex32,
|
|
|
|
Unsigned8,
|
|
|
|
Unsigned16,
|
|
|
|
Unsigned32,
|
|
|
|
Signed8,
|
|
|
|
Signed16,
|
|
|
|
Signed32,
|
2018-03-16 05:39:53 -06:00
|
|
|
ASCII,
|
2022-04-06 03:36:09 -06:00
|
|
|
Float32,
|
|
|
|
Double
|
2018-03-16 05:39:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class BPType
|
|
|
|
{
|
|
|
|
ReadWrite,
|
|
|
|
ReadOnly,
|
|
|
|
WriteOnly
|
|
|
|
};
|
|
|
|
|
|
|
|
explicit MemoryViewWidget(QWidget* parent = nullptr);
|
|
|
|
|
|
|
|
void Update();
|
2022-03-28 17:08:31 -06:00
|
|
|
void UpdateFont();
|
2018-03-16 05:39:53 -06:00
|
|
|
void ToggleBreakpoint();
|
2018-05-31 14:07:05 -06:00
|
|
|
void ToggleRowBreakpoint(bool row);
|
2018-03-16 05:39:53 -06:00
|
|
|
|
2019-04-10 23:50:52 -06:00
|
|
|
void SetAddressSpace(AddressSpace::Type address_space);
|
|
|
|
AddressSpace::Type GetAddressSpace() const;
|
2022-04-06 23:50:05 -06:00
|
|
|
void SetDisplay(Type type, int bytes_per_row, int alignment, bool dual_view);
|
2018-03-16 05:39:53 -06:00
|
|
|
void SetBPType(BPType type);
|
|
|
|
void SetAddress(u32 address);
|
|
|
|
|
|
|
|
void SetBPLoggingEnabled(bool enabled);
|
|
|
|
|
|
|
|
u32 GetContextAddress() const;
|
|
|
|
|
|
|
|
void resizeEvent(QResizeEvent*) override;
|
|
|
|
void keyPressEvent(QKeyEvent* event) override;
|
|
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
|
|
void wheelEvent(QWheelEvent* event) override;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void BreakpointsChanged();
|
2018-12-28 11:12:30 -07:00
|
|
|
void ShowCode(u32 address);
|
2021-02-17 10:12:27 -07:00
|
|
|
void RequestWatch(QString name, u32 address);
|
2018-03-16 05:39:53 -06:00
|
|
|
|
|
|
|
private:
|
|
|
|
void OnContextMenu();
|
|
|
|
void OnCopyAddress();
|
|
|
|
void OnCopyHex();
|
2022-04-06 23:50:05 -06:00
|
|
|
void UpdateBreakpointTags();
|
|
|
|
void UpdateColumns(Type type, int first_column);
|
2018-03-16 05:39:53 -06:00
|
|
|
|
2019-07-15 21:20:26 -06:00
|
|
|
AddressSpace::Type m_address_space{};
|
2022-04-06 03:36:09 -06:00
|
|
|
Type m_type = Type::Hex8;
|
2018-03-16 05:39:53 -06:00
|
|
|
BPType m_bp_type = BPType::ReadWrite;
|
|
|
|
bool m_do_log = true;
|
|
|
|
u32 m_context_address;
|
2022-04-06 03:36:09 -06:00
|
|
|
u32 m_base_address;
|
2018-03-16 05:39:53 -06:00
|
|
|
u32 m_address = 0;
|
2022-03-28 17:08:31 -06:00
|
|
|
int m_font_width = 0;
|
|
|
|
int m_font_vspace = 0;
|
2022-04-06 03:36:09 -06:00
|
|
|
int m_bytes_per_row = 16;
|
|
|
|
int m_alignment = 16;
|
2022-04-06 23:50:05 -06:00
|
|
|
bool m_dual_view = false;
|
2018-03-16 05:39:53 -06:00
|
|
|
};
|