2018-03-16 11:39:53 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2019-07-16 03:20:26 +00:00
|
|
|
|
|
|
|
namespace AddressSpace
|
|
|
|
{
|
|
|
|
enum class Type;
|
|
|
|
}
|
2018-03-16 11:39:53 +00:00
|
|
|
|
|
|
|
class MemoryViewWidget : public QTableWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum class Type
|
|
|
|
{
|
|
|
|
U8,
|
|
|
|
U16,
|
|
|
|
U32,
|
|
|
|
ASCII,
|
|
|
|
Float32
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class BPType
|
|
|
|
{
|
|
|
|
ReadWrite,
|
|
|
|
ReadOnly,
|
|
|
|
WriteOnly
|
|
|
|
};
|
|
|
|
|
|
|
|
explicit MemoryViewWidget(QWidget* parent = nullptr);
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
void ToggleBreakpoint();
|
2018-05-31 20:07:05 +00:00
|
|
|
void ToggleRowBreakpoint(bool row);
|
2018-03-16 11:39:53 +00:00
|
|
|
|
2019-04-11 05:50:52 +00:00
|
|
|
void SetAddressSpace(AddressSpace::Type address_space);
|
|
|
|
AddressSpace::Type GetAddressSpace() const;
|
2018-03-16 11:39:53 +00:00
|
|
|
void SetType(Type type);
|
|
|
|
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 18:12:30 +00:00
|
|
|
void ShowCode(u32 address);
|
2021-02-17 17:12:27 +00:00
|
|
|
void RequestWatch(QString name, u32 address);
|
2018-03-16 11:39:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void OnContextMenu();
|
|
|
|
void OnCopyAddress();
|
|
|
|
void OnCopyHex();
|
|
|
|
|
2019-07-16 03:20:26 +00:00
|
|
|
AddressSpace::Type m_address_space{};
|
2018-03-16 11:39:53 +00:00
|
|
|
Type m_type = Type::U8;
|
|
|
|
BPType m_bp_type = BPType::ReadWrite;
|
|
|
|
bool m_do_log = true;
|
|
|
|
u32 m_context_address;
|
|
|
|
u32 m_address = 0;
|
|
|
|
};
|