mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-01 01:38:05 +00:00
Cleaning up all debuggers
This commit is contained in:
@@ -12,15 +12,16 @@ namespace ComSquare::Debugger
|
||||
{
|
||||
APUDebug::APUDebug(APU &apu, SNES &snes) :
|
||||
APU(apu),
|
||||
QMainWindow(),
|
||||
_window(new ClosableWindow(*this, &APUDebug::disableDebugger)),
|
||||
_ui(),
|
||||
_snes(snes)
|
||||
{
|
||||
this->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
this->_ui.setupUi(this);
|
||||
this->show();
|
||||
this->_ui.setupUi(this->_window);
|
||||
this->_window->show();
|
||||
this->_updatePanel();
|
||||
}
|
||||
|
||||
@@ -479,10 +480,21 @@ namespace ComSquare::Debugger
|
||||
|
||||
void APUDebug::update(unsigned cycles)
|
||||
{
|
||||
if (!this->isVisible()) {
|
||||
this->_snes.disableAPUDebugging();
|
||||
return;
|
||||
}
|
||||
return APU::update(cycles);
|
||||
}
|
||||
|
||||
void APUDebug::disableDebugger()
|
||||
{
|
||||
this->_snes.disableAPUDebugging();
|
||||
}
|
||||
|
||||
bool APUDebug::isDebugger()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void APUDebug::focus()
|
||||
{
|
||||
this->_window->activateWindow();
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,11 @@
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
class APUDebug : public APU::APU, public QMainWindow {
|
||||
class APUDebug : public APU::APU {
|
||||
private:
|
||||
//! @brief The QT window for this debugger.
|
||||
ClosableWindow<APUDebug> *_window;
|
||||
|
||||
//! @brief A widget that contain the whole UI.
|
||||
Ui::APUView _ui;
|
||||
|
||||
@@ -30,6 +33,10 @@ namespace ComSquare::Debugger
|
||||
|
||||
//! @brief return the mnemonic of the current instruction done.
|
||||
std::string _getInstructionString();
|
||||
|
||||
public slots:
|
||||
//! @brief Called when the window is closed. Turn off the debugger and revert to a basic APU.
|
||||
void disableDebugger();
|
||||
public:
|
||||
//! @brief Convert a basic APU to a debugging APU.
|
||||
explicit APUDebug(ComSquare::APU::APU &apu, SNES &snes);
|
||||
@@ -39,6 +46,12 @@ namespace ComSquare::Debugger
|
||||
|
||||
//! @brief Override the apu's update to disable debugging.
|
||||
void update(unsigned cycles) override;
|
||||
|
||||
//! @brief Return true if the CPU is overloaded with debugging features.
|
||||
bool isDebugger() override;
|
||||
|
||||
//! @brief Focus the debugger's window.
|
||||
void focus();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,10 @@ using namespace ComSquare::CPU;
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
CPUDebug::CPUDebug(CPU &basicCPU, SNES &snes)
|
||||
: CPU(basicCPU), _window(new ClosableWindow(this, &CPUDebug::disableDebugger)), _ui(), _snes(snes)
|
||||
: CPU(basicCPU),
|
||||
_window(new ClosableWindow(*this, &CPUDebug::disableDebugger)),
|
||||
_ui(),
|
||||
_snes(snes)
|
||||
{
|
||||
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
@@ -27,16 +30,16 @@ namespace ComSquare::Debugger
|
||||
this->_updateRegistersPanel();
|
||||
}
|
||||
|
||||
bool CPUDebug::isDebugger()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPUDebug::disableDebugger()
|
||||
{
|
||||
this->_snes.disableCPUDebugging();
|
||||
}
|
||||
|
||||
CPUDebug::~CPUDebug()
|
||||
{
|
||||
std::cout << "Destructor" << std::endl;
|
||||
}
|
||||
|
||||
unsigned CPUDebug::update()
|
||||
{
|
||||
try {
|
||||
@@ -390,4 +393,9 @@ namespace ComSquare::Debugger
|
||||
CPU::RESB();
|
||||
this->_updateRegistersPanel();
|
||||
}
|
||||
|
||||
void CPUDebug::focus()
|
||||
{
|
||||
this->_window->activateWindow();
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ namespace ComSquare::Debugger
|
||||
//! @brief A custom CPU with a window that show it's registers and the disassembly.
|
||||
class CPUDebug : public CPU::CPU, public QObject {
|
||||
private:
|
||||
//! @brief The QT window for this debugger.
|
||||
ClosableWindow<CPUDebug> *_window;
|
||||
//! @brief A widget that contain the whole UI.
|
||||
Ui::CPUView _ui;
|
||||
@@ -67,7 +68,13 @@ namespace ComSquare::Debugger
|
||||
explicit CPUDebug(ComSquare::CPU::CPU &cpu, SNES &snes);
|
||||
CPUDebug(const CPUDebug &) = delete;
|
||||
CPUDebug &operator=(const CPUDebug &) = delete;
|
||||
~CPUDebug() override;
|
||||
~CPUDebug() override = default;
|
||||
|
||||
//! @brief Return true if the CPU is overloaded with debugging features.
|
||||
bool isDebugger() override;
|
||||
|
||||
//! @brief Focus the debugger's window.
|
||||
void focus();
|
||||
|
||||
//! @brief Override the basic cpu's update to allow pausing of the CPU only.
|
||||
unsigned update() override;
|
||||
|
||||
@@ -14,15 +14,15 @@ namespace ComSquare::Debugger
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *) override
|
||||
{
|
||||
(this->_obj->*this->_onClose)();
|
||||
(this->_obj.*this->_onClose)();
|
||||
}
|
||||
|
||||
private:
|
||||
T *_obj;
|
||||
T &_obj;
|
||||
void (T::*_onClose)();
|
||||
|
||||
public:
|
||||
explicit ClosableWindow(T *obj, void (T::*onClose)())
|
||||
explicit ClosableWindow(T &obj, void (T::*onClose)())
|
||||
: _obj(obj), _onClose(onClose)
|
||||
{ }
|
||||
ClosableWindow(const ClosableWindow &) = delete;
|
||||
|
||||
@@ -4,50 +4,64 @@
|
||||
|
||||
#include "HeaderViewer.hpp"
|
||||
#include "../Utility/Utility.hpp"
|
||||
#include "../SNES.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
HeaderViewer::HeaderViewer(ComSquare::Cartridge::Cartridge &cartridge) :
|
||||
_cartridge(cartridge),
|
||||
HeaderViewer::HeaderViewer(ComSquare::SNES &snes)
|
||||
: _window(new ClosableWindow(*this, &HeaderViewer::disableDebugger)),
|
||||
_snes(snes),
|
||||
_cartridge(*snes.cartridge),
|
||||
_ui()
|
||||
{
|
||||
this->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
this->_ui.setupUi(this);
|
||||
this->_ui.nameLineEdit->setText(cartridge.header.gameName.c_str());
|
||||
this->_ui.setupUi(this->_window);
|
||||
this->_ui.nameLineEdit->setText(this->_cartridge.header.gameName.c_str());
|
||||
std::string memType;
|
||||
if (cartridge.header.mappingMode & Cartridge::LoRom)
|
||||
if (this->_cartridge.header.mappingMode & Cartridge::LoRom)
|
||||
memType += "LoRom ";
|
||||
if (cartridge.header.mappingMode & Cartridge::HiRom)
|
||||
if (this->_cartridge.header.mappingMode & Cartridge::HiRom)
|
||||
memType += "HiRom ";
|
||||
if (cartridge.header.mappingMode & Cartridge::SlowRom)
|
||||
if (this->_cartridge.header.mappingMode & Cartridge::SlowRom)
|
||||
memType += "SlowRom ";
|
||||
if (cartridge.header.mappingMode & Cartridge::FastRom)
|
||||
if (this->_cartridge.header.mappingMode & Cartridge::FastRom)
|
||||
memType += "FastRom ";
|
||||
if (cartridge.header.mappingMode & Cartridge::ExRom)
|
||||
if (this->_cartridge.header.mappingMode & Cartridge::ExRom)
|
||||
memType += "ExRom ";
|
||||
this->_ui.mappingLineEdit->setText(memType.c_str());
|
||||
this->_ui.romSizeLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.romSize).c_str());
|
||||
this->_ui.sRamSizeLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.sramSize).c_str());
|
||||
this->_ui.versionLineEdit->setText(std::to_string(cartridge.header.version).c_str());
|
||||
this->_ui.creatorIDLineEdit->setText(std::to_string(cartridge.header.creatorID).c_str());
|
||||
this->_ui.checksumLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.checksum).c_str());
|
||||
this->_ui.checksumComplementLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.checksumComplement).c_str());
|
||||
this->_ui.romSizeLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.romSize).c_str());
|
||||
this->_ui.sRamSizeLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.sramSize).c_str());
|
||||
this->_ui.versionLineEdit->setText(std::to_string(this->_cartridge.header.version).c_str());
|
||||
this->_ui.creatorIDLineEdit->setText(std::to_string(this->_cartridge.header.creatorID).c_str());
|
||||
this->_ui.checksumLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.checksum).c_str());
|
||||
this->_ui.checksumComplementLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.checksumComplement).c_str());
|
||||
|
||||
this->_ui.coProcessorLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.cop).c_str());
|
||||
this->_ui.breakLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.brk).c_str());
|
||||
this->_ui.abortLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.abort).c_str());
|
||||
this->_ui.nMInteruptLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.nmi).c_str());
|
||||
this->_ui.resetLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.reset).c_str());
|
||||
this->_ui.interruptRequestLineEdit->setText(ComSquare::Utility::to_hex(cartridge.header.emulationInterrupts.irq).c_str());
|
||||
this->_ui.coProcessorLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.cop).c_str());
|
||||
this->_ui.breakLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.brk).c_str());
|
||||
this->_ui.abortLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.abort).c_str());
|
||||
this->_ui.nMInteruptLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.nmi).c_str());
|
||||
this->_ui.resetLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.reset).c_str());
|
||||
this->_ui.interruptRequestLineEdit->setText(ComSquare::Utility::to_hex(this->_cartridge.header.emulationInterrupts.irq).c_str());
|
||||
|
||||
this->_ui.coProcessorLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.cop).c_str());
|
||||
this->_ui.breakLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.brk).c_str());
|
||||
this->_ui.abortLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.abort).c_str());
|
||||
this->_ui.nMInteruptLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.nmi).c_str());
|
||||
this->_ui.resetLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.reset).c_str());
|
||||
this->_ui.interruptRequestLineEditNat->setText(ComSquare::Utility::to_hex(cartridge.header.nativeInterrupts.irq).c_str());
|
||||
this->show();
|
||||
this->_ui.coProcessorLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.cop).c_str());
|
||||
this->_ui.breakLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.brk).c_str());
|
||||
this->_ui.abortLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.abort).c_str());
|
||||
this->_ui.nMInteruptLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.nmi).c_str());
|
||||
this->_ui.resetLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.reset).c_str());
|
||||
this->_ui.interruptRequestLineEditNat->setText(ComSquare::Utility::to_hex(this->_cartridge.header.nativeInterrupts.irq).c_str());
|
||||
this->_window->show();
|
||||
}
|
||||
|
||||
void HeaderViewer::disableDebugger()
|
||||
{
|
||||
this->_snes.disableHeaderViewer();
|
||||
}
|
||||
|
||||
void HeaderViewer::focus()
|
||||
{
|
||||
this->_window->activateWindow();
|
||||
}
|
||||
}
|
||||
@@ -8,22 +8,37 @@
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include "../Cartridge/Cartridge.hpp"
|
||||
#include "../../ui/ui_cartridgeView.h"
|
||||
#include "ClosableWindow.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
namespace ComSquare
|
||||
{
|
||||
//! @brief Window that show the header of the currently running game.
|
||||
class HeaderViewer : public QMainWindow {
|
||||
private:
|
||||
//! @brief The cartrdige containing the header.
|
||||
Cartridge::Cartridge &_cartridge;
|
||||
//! @brief The layout of the viewer.
|
||||
Ui::CatridgeView _ui;
|
||||
public:
|
||||
explicit HeaderViewer(Cartridge::Cartridge &cartridge);
|
||||
HeaderViewer(const HeaderViewer &) = delete;
|
||||
HeaderViewer &operator=(const HeaderViewer &) = delete;
|
||||
~HeaderViewer() override = default;
|
||||
};
|
||||
class SNES;
|
||||
namespace Debugger
|
||||
{
|
||||
//! @brief Window that show the header of the currently running game.
|
||||
class HeaderViewer {
|
||||
private:
|
||||
//! @brief The QT window for this debugger.
|
||||
ClosableWindow<HeaderViewer> *_window{};
|
||||
//! @brief A reference to the snes (to disable the debugger).
|
||||
SNES &_snes;
|
||||
//! @brief The cartridge containing the header.
|
||||
Cartridge::Cartridge &_cartridge;
|
||||
//! @brief The layout of the viewer.
|
||||
Ui::CatridgeView _ui;
|
||||
public slots:
|
||||
//! @brief Called when the window is closed. Turn off the debugger and revert to a basic CPU.
|
||||
void disableDebugger();
|
||||
public:
|
||||
//! @brief Focus the debugger's window.
|
||||
void focus();
|
||||
|
||||
explicit HeaderViewer(SNES &snes);
|
||||
HeaderViewer(const HeaderViewer &) = delete;
|
||||
HeaderViewer &operator=(const HeaderViewer &) = delete;
|
||||
~HeaderViewer() = default;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //COMSQUARE_HEADERVIEWER_HPP
|
||||
|
||||
@@ -3,17 +3,35 @@
|
||||
//
|
||||
|
||||
#include "MemoryBusDebug.hpp"
|
||||
#include "../SNES.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
MemoryBusDebug::MemoryBusDebug(const ComSquare::Memory::MemoryBus &bus)
|
||||
: MemoryBus(bus), QMainWindow(), _ui()
|
||||
MemoryBusDebug::MemoryBusDebug(SNES &snes, const Memory::MemoryBus &bus)
|
||||
: MemoryBus(bus),
|
||||
_window(new ClosableWindow(*this, &MemoryBusDebug::disableViewer)),
|
||||
_snes(snes),
|
||||
_ui()
|
||||
{
|
||||
this->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
|
||||
this->_ui.setupUi(this);
|
||||
// QMainWindow::connect(this->_ui.actionPause, &QAction::triggered, this, &CPUDebug::pause);
|
||||
this->show();
|
||||
this->_ui.setupUi(this->_window);
|
||||
this->_window->show();
|
||||
}
|
||||
|
||||
void MemoryBusDebug::disableViewer()
|
||||
{
|
||||
this->_snes.disableMemoryBusDebugging();
|
||||
}
|
||||
|
||||
void MemoryBusDebug::focus()
|
||||
{
|
||||
this->_window->activateWindow();
|
||||
}
|
||||
|
||||
bool MemoryBusDebug::isDebugger()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,19 +8,33 @@
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include "../Memory/MemoryBus.hpp"
|
||||
#include "../../ui/ui_busView.h"
|
||||
#include "ClosableWindow.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
//! @brief window that allow the user to view all data going through the memory bus.
|
||||
class MemoryBusDebug : public Memory::MemoryBus, public QMainWindow {
|
||||
class MemoryBusDebug : public Memory::MemoryBus {
|
||||
private:
|
||||
//! @brief The QT window for this debugger.
|
||||
ClosableWindow<MemoryBusDebug> *_window;
|
||||
//! @brief A reference to the snes (to disable the debugger).
|
||||
SNES &_snes;
|
||||
//! @brief A widget that contain the whole UI.
|
||||
Ui::BusView _ui;
|
||||
public slots:
|
||||
//! @brief Called when the window is closed. Turn off the debugger and revert to a basic CPU.
|
||||
void disableViewer();
|
||||
public:
|
||||
explicit MemoryBusDebug(const Memory::MemoryBus &bus);
|
||||
explicit MemoryBusDebug(SNES &snes, const Memory::MemoryBus &bus);
|
||||
MemoryBusDebug(const MemoryBusDebug &) = delete;
|
||||
MemoryBusDebug &operator=(const MemoryBusDebug &) = delete;
|
||||
~MemoryBusDebug() override = default;
|
||||
~MemoryBusDebug() = default;
|
||||
|
||||
//! @brief Focus the debugger's window.
|
||||
void focus();
|
||||
|
||||
//! @brief Return true if the Bus is overloaded with debugging features.
|
||||
bool isDebugger() override;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -65,16 +65,17 @@ void MemoryViewerModel::setMemory(std::shared_ptr<Ram> memory)
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
MemoryViewer::MemoryViewer(ComSquare::SNES &snes, Memory::MemoryBus &bus) :
|
||||
QMainWindow(),
|
||||
_window(new ClosableWindow(*this, &MemoryViewer::disableViewer)),
|
||||
_snes(snes),
|
||||
_bus(bus),
|
||||
_ui(),
|
||||
_model(snes.wram)
|
||||
{
|
||||
this->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
|
||||
this->_window->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
this->_ui.setupUi(this);
|
||||
this->_ui.setupUi(this->_window);
|
||||
this->_ui.tableView->setModel(&this->_model);
|
||||
this->_ui.tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
this->_ui.tabs->addTab("&WRam");
|
||||
@@ -84,7 +85,12 @@ namespace ComSquare::Debugger
|
||||
QMainWindow::connect(this->_ui.actionGoto, &QAction::triggered, this, &MemoryViewer::gotoAddr);
|
||||
QMainWindow::connect(this->_ui.actionGoto_Absolute, &QAction::triggered, this, &MemoryViewer::gotoAbsoluteAddr);
|
||||
QObject::connect(this->_ui.tabs, &QTabBar::currentChanged, this, &MemoryViewer::changeRam);
|
||||
this->show();
|
||||
this->_window->show();
|
||||
}
|
||||
|
||||
void MemoryViewer::disableViewer()
|
||||
{
|
||||
this->_snes.disableRamViewer();
|
||||
}
|
||||
|
||||
void MemoryViewer::changeRam(int id)
|
||||
@@ -118,7 +124,7 @@ namespace ComSquare::Debugger
|
||||
|
||||
void MemoryViewer::_internalGoto(bool isAbsolute)
|
||||
{
|
||||
QDialog dialog(this);
|
||||
QDialog dialog(this->_window);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
Ui::GotoDialog dialogUI;
|
||||
dialogUI.setupUi(&dialog);
|
||||
@@ -162,4 +168,9 @@ namespace ComSquare::Debugger
|
||||
throw InvalidAddress("Memory viewer switch to address", addr);
|
||||
return addr - accessor->getStart();
|
||||
}
|
||||
|
||||
void MemoryViewer::focus()
|
||||
{
|
||||
this->_window->activateWindow();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "../../ui/ui_gotoDialog.h"
|
||||
#include "../Ram/Ram.hpp"
|
||||
#include "../Memory/MemoryBus.hpp"
|
||||
#include "ClosableWindow.hpp"
|
||||
#include <memory>
|
||||
|
||||
using ComSquare::Ram::Ram;
|
||||
@@ -49,8 +50,11 @@ namespace ComSquare
|
||||
namespace Debugger
|
||||
{
|
||||
//! @brief Class responsible of the Memory Viewer.
|
||||
class MemoryViewer : public QMainWindow {
|
||||
class MemoryViewer : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
//! @brief The QT window for this debugger.
|
||||
ClosableWindow<MemoryViewer> *_window;
|
||||
//! @brief SNES containing all rams to view.
|
||||
SNES &_snes;
|
||||
//! @brief The memory bus used to get the view for a given address.
|
||||
@@ -61,6 +65,9 @@ namespace ComSquare
|
||||
MemoryViewerModel _model;
|
||||
//! @brief Helper function to create the goto dialog.
|
||||
void _internalGoto(bool isAbsolute);
|
||||
public slots:
|
||||
//! @brief Called when the window is closed. Turn off the debugger.
|
||||
void disableViewer();
|
||||
public:
|
||||
//! @brief Select the memory tab corresponding to a 24 bit address (map the address via the bus).
|
||||
//! @return The address converted to the new tab's locale space.
|
||||
@@ -73,6 +80,9 @@ namespace ComSquare
|
||||
//! @brief Create a popup asking you where you want to jump to with the absolute mode selected.
|
||||
void gotoAbsoluteAddr();
|
||||
|
||||
//! @brief Focus the memory viewer's window.
|
||||
void focus();
|
||||
|
||||
explicit MemoryViewer(SNES &snes, Memory::MemoryBus &bus);
|
||||
MemoryViewer(const MemoryViewer &) = delete;
|
||||
MemoryViewer &operator=(const MemoryViewer &) = delete;
|
||||
|
||||
Reference in New Issue
Block a user