Files
ComSquare/sources/Debugger/APUDebug.hpp
Melefo d958bd5131 Adding APU Debugger window
Separating APU ram from its component
2020-02-20 13:24:10 +01:00

46 lines
1.2 KiB
C++

//
// Created by Melefo on 19/02/2020.
//
#ifndef COMSQUARE_APUDEBUG_HPP
#define COMSQUARE_APUDEBUG_HPP
#include "../APU/APU.hpp"
#include "../SNES.hpp"
#include "../../ui/ui_apuView.h"
namespace ComSquare::Debugger
{
class APUDebug : public APU::APU, public QMainWindow {
private:
//! @brief A widget that contain the whole UI.
Ui::APUView _ui;
//! @brief A reference to the snes (to disable the debugger).
SNES &_snes;
//! @brief Update the debugger panel values
void _updatePanel();
//! @brief Convert CPU APU flags to a string.
std::string _getPSWString();
//! @brief Replace original _executeInstruction to write to the logger.
int _executeInstruction() override;
//! @brief return the mnemonic of the current instruction done.
std::string _getInstructionString();
public:
//! @brief Convert a basic APU to a debugging APU.
explicit APUDebug(ComSquare::APU::APU &apu, SNES &snes);
APUDebug(const APUDebug &) = delete;
APUDebug &operator=(const APUDebug &) = delete;
~APUDebug() override = default;
//! @brief Override the apu's update to disable debugging.
void update(unsigned cycles) override;
};
}
#endif //COMSQUARE_APUDEBUG_HPP