Skip to content

Commit

Permalink
Debugger turn off switch on the debug toolbar; minor UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nzeemin committed Jan 3, 2024
1 parent 2ef482e commit 7a73c84
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
5 changes: 0 additions & 5 deletions !astyle.bat

This file was deleted.

15 changes: 7 additions & 8 deletions emulator/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ MainWindow::MainWindow(QWidget *parent) :
QObject::connect(ui->actionDrivesCartridge2, SIGNAL(triggered()), this, SLOT(emulatorCartridge2()));
QObject::connect(ui->actionDrivesHard2, SIGNAL(triggered()), this, SLOT(emulatorHardDrive2()));
QObject::connect(ui->actionDebugConsoleView, SIGNAL(triggered()), this, SLOT(debugConsoleView()));
QObject::connect(ui->actionDebugDebugView, SIGNAL(triggered()), this, SLOT(debugDebugView()));
QObject::connect(ui->actionDebugDisasmView, SIGNAL(triggered()), this, SLOT(debugDisasmView()));
QObject::connect(ui->actionDebugMemoryView, SIGNAL(triggered()), this, SLOT(debugMemoryView()));
QObject::connect(ui->actionDebugCpuPpu, SIGNAL(triggered()), this, SLOT(debugCpuPpu()));
Expand Down Expand Up @@ -94,7 +93,7 @@ MainWindow::MainWindow(QWidget *parent) :
int maxwid = m_screen->maximumWidth() > m_keyboard->maximumWidth() ? m_screen->maximumWidth() : m_keyboard->maximumWidth();
ui->centralWidget->setMaximumWidth(maxwid);

m_dockDebug = new QDockWidget(tr("Processor"));
m_dockDebug = new QDockWidget(tr("Debug"));
m_dockDebug->setObjectName("dockDebug");
m_dockDebug->setWidget(m_debug);
m_dockDebug->setFeatures(m_dockDebug->features() & ~QDockWidget::DockWidgetClosable);
Expand Down Expand Up @@ -259,9 +258,11 @@ void MainWindow::updateMenu()
g_pBoard->IsHardImageAttached(2) ? ":/images/iconHdd.svg" : ":/images/iconHddSlot.svg" ));

ui->actionDebugConsoleView->setChecked(m_console->isVisible());
ui->actionDebugDebugView->setChecked(m_dockDebug->isVisible());
ui->actionDebugDisasmView->setChecked(m_dockDisasm->isVisible());
ui->actionDebugMemoryView->setChecked(m_dockMemory->isVisible());

if (m_debug != nullptr)
m_debug->updateToolbar();
}

void MainWindow::updateAllViews()
Expand Down Expand Up @@ -732,16 +733,13 @@ void MainWindow::debugConsoleView()

if (!okShow)
{
if (this->isMaximized())
this->showNormal();
this->adjustSize();
}

updateMenu();
}
void MainWindow::debugDebugView()
{
m_dockDebug->setVisible(!m_dockDebug->isVisible());
updateMenu();
}
void MainWindow::debugDisasmView()
{
m_dockDisasm->setVisible(!m_dockDisasm->isVisible());
Expand Down Expand Up @@ -774,6 +772,7 @@ void MainWindow::debugClearConsole()
{
m_console->clear();
}

void MainWindow::debugRemoveAllBreakpoints()
{
m_console->execConsoleCommand("bc");
Expand Down
1 change: 0 additions & 1 deletion emulator/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public slots:
void emulatorHardDrive2();
void debugCpuPpu();
void debugConsoleView();
void debugDebugView();
void debugDisasmView();
void debugMemoryView();
void debugStepInto();
Expand Down
9 changes: 0 additions & 9 deletions emulator/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
<addaction name="actionDebugConsoleView"/>
<addaction name="actionDebugCpuPpu"/>
<addaction name="separator"/>
<addaction name="actionDebugDebugView"/>
<addaction name="actionDebugDisasmView"/>
<addaction name="actionDebugMemoryView"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -353,14 +352,6 @@
<string>Step Over</string>
</property>
</action>
<action name="actionDebugDebugView">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Processor View</string>
</property>
</action>
<action name="actionDebugDisasmView">
<property name="checkable">
<bool>true</bool>
Expand Down
1 change: 1 addition & 0 deletions emulator/qconsoleview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ QConsoleView::QConsoleView()
QFont font = Common_GetMonospacedFont();
m_log->setReadOnly(true);
m_log->setFont(font);
m_prompt->setFont(font);
m_edit->setFont(font);

QObject::connect(m_edit, SIGNAL(returnPressed()), this, SLOT(execConsoleCommand()));
Expand Down
10 changes: 10 additions & 0 deletions emulator/qdebugview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,26 @@ QDebugView::QDebugView(QWidget *mainWindow) :
m_memmapCtrl = new QDebugMemoryMapCtrl(this);
m_memmapCtrl->setGeometry(x, 0, cxMemmap, cyHeight);

m_actionDebugger = m_toolbar->addAction(QIcon(":/images/iconDebugger.svg"), "");
QAction* actionCpuPpu = m_toolbar->addAction(QIcon(":/images/iconCpuPpu.svg"), "");
m_toolbar->addSeparator();
QAction* actionStepInto = m_toolbar->addAction(QIcon(":/images/iconStepInto.svg"), "");
QAction* actionStepOver = m_toolbar->addAction(QIcon(":/images/iconStepOver.svg"), "");
m_actionDebugger->setCheckable(true);

QObject::connect(m_actionDebugger, SIGNAL(triggered()), mainWindow, SLOT(debugConsoleView()));
QObject::connect(actionCpuPpu, SIGNAL(triggered()), this, SLOT(switchCpuPpu()));
QObject::connect(actionStepInto, SIGNAL(triggered()), mainWindow, SLOT(debugStepInto()));
QObject::connect(actionStepOver, SIGNAL(triggered()), mainWindow, SLOT(debugStepOver()));

setFocusPolicy(Qt::ClickFocus);

updateToolbar();
}

void QDebugView::updateToolbar()
{
m_actionDebugger->setChecked(true);
}

void QDebugView::updateWindowText()
Expand Down
2 changes: 2 additions & 0 deletions emulator/qdebugview.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class QDebugView : public QWidget
void setCurrentProc(bool okProc);
CProcessor* getCurrentProc() const;
bool isCpuOrPpu() const;
void updateToolbar();
void updateData();
void updateWindowText();

Expand All @@ -34,6 +35,7 @@ public slots:

private:
QToolBar* m_toolbar;
QAction* m_actionDebugger;
QDebugCtrl* m_procCtrl;
QDebugCtrl* m_stackCtrl;
QDebugCtrl* m_portsCtrl;
Expand Down

0 comments on commit 7a73c84

Please sign in to comment.