Creating the layout of a DMA viewer

This commit is contained in:
Anonymus Raccoon
2020-05-28 14:13:12 +02:00
parent 29540ce9db
commit 5e0f6104fe
11 changed files with 264 additions and 12 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
#include "../../CPU/CPU.hpp"
#include "../../Renderer/SFRenderer.hpp"
#include "../../SNES.hpp"
#include "../../../ui/ui_cpu.h"
#include "../../../ui/ui_cpuView.h"
#include "../ClosableWindow.hpp"
namespace ComSquare::Debugger
+32
View File
@@ -0,0 +1,32 @@
//
// Created by anonymus-raccoon on 5/28/20.
//
#include "DMADebug.hpp"
#include "../../../SNES.hpp"
namespace ComSquare::Debugger
{
DMADebug::DMADebug(SNES &snes)
: _window(new ClosableWindow<DMADebug>(*this, &DMADebug::disableDebugger)),
_ui(),
_snes(snes)
{
this->_window->setContextMenuPolicy(Qt::NoContextMenu);
this->_window->setAttribute(Qt::WA_QuitOnClose, false);
this->_window->setAttribute(Qt::WA_DeleteOnClose);
this->_ui.setupUi(this->_window);
this->_window->show();
}
void DMADebug::focus()
{
this->_window->activateWindow();
}
void DMADebug::disableDebugger()
{
this->_snes.disableDMADebugging();
}
}
+43
View File
@@ -0,0 +1,43 @@
//
// Created by anonymus-raccoon on 5/28/20.
//
#ifndef COMSQUARE_DMADEBUG_HPP
#define COMSQUARE_DMADEBUG_HPP
#include <QtCore/QObject>
#include "../../ClosableWindow.hpp"
#include "../../../../ui/ui_dmaView.h"
namespace ComSquare
{
class SNES;
namespace Debugger
{
class DMADebug : public QObject {
private:
//! @brief The QT window for this debugger.
ClosableWindow <DMADebug> *_window;
//! @brief A widget that contain the whole UI.
Ui::DMAView _ui;
//! @brief The snes instance to read/write to DMA channels.
SNES &_snes;
public:
//! @brief Called when the window is closed. Turn off the debugger.
void disableDebugger();
explicit DMADebug(SNES &snes);
DMADebug(
const DMADebug &) = delete;
DMADebug &operator=(const DMADebug &) = delete;
~DMADebug() =default;
//! @brief Focus the debugger's window.
void focus();
};
};
}
#endif //COMSQUARE_DMADEBUG_HPP