mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-02 02:05:26 +00:00
Creating the layout of a DMA viewer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user