Cleaning up all debuggers

This commit is contained in:
Anonymus Raccoon
2020-03-23 23:07:15 +01:00
parent 75f9ffad8e
commit 09cd825bed
19 changed files with 266 additions and 105 deletions

View File

@@ -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();
}
}