diff options
Diffstat (limited to 'src/osd/modules/debugger/qt/dasmwindow.cpp')
-rw-r--r-- | src/osd/modules/debugger/qt/dasmwindow.cpp | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp index d46ceb2d767..79167169c1b 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.cpp +++ b/src/osd/modules/debugger/qt/dasmwindow.cpp @@ -51,7 +51,7 @@ DasmWindow::DasmWindow(running_machine &machine, QWidget *parent) : connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated); // Force a recompute of the disassembly region - downcast<debug_view_disasm *>(m_dasmView->view())->set_expression("curpc"); + m_dasmView->view<debug_view_disasm>()->set_expression("curpc"); // Populate the combo box & set the proper CPU populateComboBox(); @@ -119,6 +119,19 @@ DasmWindow::~DasmWindow() } +void DasmWindow::saveConfigurationToNode(util::xml::data_node &node) +{ + WindowQt::saveConfigurationToNode(node); + + node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER); + + debug_view_disasm &dasmview = *m_dasmView->view<debug_view_disasm>(); + node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_dasmView->sourceIndex()); + node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column()); + node.add_child(osd::debugger::NODE_WINDOW_EXPRESSION, dasmview.expression()); +} + + void DasmWindow::cpuChanged(int index) { if (index < m_dasmView->view()->source_count()) @@ -132,7 +145,7 @@ void DasmWindow::cpuChanged(int index) void DasmWindow::expressionSubmitted() { const QString expression = m_inputEdit->text(); - downcast<debug_view_disasm *>(m_dasmView->view())->set_expression(expression.toLocal8Bit().data()); + m_dasmView->view<debug_view_disasm>()->set_expression(expression.toLocal8Bit().data()); m_dasmView->viewport()->update(); } @@ -141,7 +154,7 @@ void DasmWindow::toggleBreakpointAtCursor(bool changedTo) { if (m_dasmView->view()->cursor_visible()) { - offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); + offs_t const address = m_dasmView->view<debug_view_disasm>()->selected_address(); device_t *const device = m_dasmView->view()->source()->device(); device_debug *const cpuinfo = device->debug(); @@ -172,7 +185,7 @@ void DasmWindow::enableBreakpointAtCursor(bool changedTo) { if (m_dasmView->view()->cursor_visible()) { - offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); + offs_t const address = m_dasmView->view<debug_view_disasm>()->selected_address(); device_t *const device = m_dasmView->view()->source()->device(); device_debug *const cpuinfo = device->debug(); @@ -196,7 +209,7 @@ void DasmWindow::runToCursor(bool changedTo) { if (m_dasmView->view()->cursor_visible()) { - offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); + offs_t const address = m_dasmView->view<debug_view_disasm>()->selected_address(); m_dasmView->view()->source()->device()->debug()->go(address); } } @@ -204,7 +217,7 @@ void DasmWindow::runToCursor(bool changedTo) void DasmWindow::rightBarChanged(QAction* changedTo) { - debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmView->view()); + debug_view_disasm* dasmView = m_dasmView->view<debug_view_disasm>(); if (changedTo->text() == "Raw Opcodes") { dasmView->set_right_column(DASM_RIGHTCOL_RAW); @@ -228,7 +241,7 @@ void DasmWindow::dasmViewUpdated() bool breakpointEnabled = false; if (haveCursor) { - offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address(); + offs_t const address = m_dasmView->view<debug_view_disasm>()->selected_address(); device_t *const device = m_dasmView->view()->source()->device(); device_debug *const cpuinfo = device->debug(); @@ -281,21 +294,6 @@ void DasmWindow::setToCurrentCpu() //========================================================================= // DasmWindowQtConfig //========================================================================= -void DasmWindowQtConfig::buildFromQWidget(QWidget *widget) -{ - WindowQtConfig::buildFromQWidget(widget); - DasmWindow *window = dynamic_cast<DasmWindow *>(widget); - QComboBox *cpu = window->findChild<QComboBox *>("cpu"); - m_cpu = cpu->currentIndex(); - - QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup"); - if (rightBarGroup->checkedAction()->text() == "Raw Opcodes") - m_rightBar = DASM_RIGHTCOL_RAW; - else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes") - m_rightBar = DASM_RIGHTCOL_ENCRYPTED; - else if (rightBarGroup->checkedAction()->text() == "Comments") - m_rightBar = DASM_RIGHTCOL_COMMENTS; -} void DasmWindowQtConfig::applyToQWidget(QWidget *widget) { @@ -311,13 +309,6 @@ void DasmWindowQtConfig::applyToQWidget(QWidget *widget) } } -void DasmWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const -{ - WindowQtConfig::addToXmlDataNode(node); - node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu); - node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar); -} - void DasmWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node) { WindowQtConfig::recoverFromXmlNode(node); |