dolphin/Source/Core/DolphinQt/Debugger/MemoryViewWidget.h
booto 2ff0486335 Debugger/Memory: Add support for address spaces
Different address spaces can be chosen in the memory view panel.
 * Effective (or virtual): Probably the view people mostly want. Address
   translation goes through MMU.
 * Auxiliary: ARAM address space. Does not display anything in Wii mode.
 * Physical: Physical address space. Only supports mem1 and mem2 (wii
   mode) so far.
2019-05-02 21:14:30 -04:00

69 lines
1.4 KiB
C++

// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QTableWidget>
#include "Common/CommonTypes.h"
#include "Core/HW/AddressSpace.h"
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();
void ToggleRowBreakpoint(bool row);
void SetAddressSpace(AddressSpace::Type address_space);
AddressSpace::Type GetAddressSpace() const;
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();
void ShowCode(u32 address);
private:
void OnContextMenu();
void OnCopyAddress();
void OnCopyHex();
AddressSpace::Type m_address_space = AddressSpace::Type::Effective;
Type m_type = Type::U8;
BPType m_bp_type = BPType::ReadWrite;
bool m_do_log = true;
u32 m_context_address;
u32 m_address = 0;
};