Debugger updates:

Made closing the Qt debugger console window hide all debugger windows
and run the emulated machine (debugger windows will be shown on next
user break or breakpoint hit).  This matches the behaviour of the Win32
and Cocoa debuggers.

Made Qt debugger clean up its windows on exit rather than on subsequent
starts.  This fixes GitHub #9789.

Made Qt debugger less reliant on global variables, and made code to save
and load configuration a bit less convoluted.  It still needs more
refactoring on this front, but it's in slightly better shape now.

Made Qt debugger a bit less crashy on invalid configuration.  Still
plenty of ways to crash it, but every little bit counts.

Made Qt debugger do less comparisons on menu item names and object
names - it might be possible to localise one day.

Moved all the C++ debugger implementations into namespaces.  They're
using awfully generic class names, so it's about time.
This commit is contained in:
Vas Crabb 2022-09-20 04:22:51 +10:00
parent 05d3b10a6c
commit 76541e8c81
55 changed files with 602 additions and 482 deletions

View File

@ -391,15 +391,15 @@ function qtdebuggerbuild()
custombuildtask {
{ MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.h", GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.h", GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.h", GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.h", GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", { },{ MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.h", GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.h", GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.h", GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.h", GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" } },
}

View File

@ -166,6 +166,8 @@ void gbck003_device::device_reset()
// TODO: proper reset state
m_bank_setting[1] = 1U;
set_bank_rom_high(bank_rom_entry_high());
}

View File

@ -265,6 +265,9 @@ void slmulti_device::device_reset()
{
mbc_ram_device_base<mbc_dual_uniform_device_base>::device_reset();
// TODO: proper reset state
m_high_page_rom = 1U;
m_view_ram.disable();
set_bank_rom_low(m_base_page_rom & ~m_page_mask_rom);
@ -373,6 +376,7 @@ void slmulti_device::do_config_cmd(u8 data)
break;
case 0xbb:
// TODO: can this cause RAM to be enabled if 0x0a was previously written to 0x0000-0x1fff?
m_enable_ram = BIT(data, 5);
m_base_page_ram = BIT(data, 0, 4);
m_page_mask_ram = BIT(data, 4) ? 0x00 : 0x03;
@ -383,6 +387,8 @@ void slmulti_device::do_config_cmd(u8 data)
m_base_page_ram,
m_page_mask_ram);
update_bank_ram();
if (!m_enable_ram)
m_view_ram.disable();
break;
default:

View File

@ -7,18 +7,24 @@
//============================================================
#include "emu.h"
#include "debug_module.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debug/points.h"
#include "debug/textbuf.h"
#include "debug_module.h"
#include "debugger.h"
#include "fileio.h"
#include "modules/lib/osdobj_common.h"
#include "modules/osdmodule.h"
#include "fileio.h"
#include <cinttypes>
namespace {
//-------------------------------------------------------------------------
#define MAX_PACKET_SIZE 16384
@ -1443,5 +1449,7 @@ void debug_gdbstub::handle_character(char ch)
}
}
} // anonymous namespace
//-------------------------------------------------------------------------
MODULE_DEFINITION(DEBUG_GDBSTUB, debug_gdbstub)

View File

@ -3,9 +3,11 @@
// ImGui based debugger
#include "emu.h"
#include "debug_module.h"
#include "imgui/imgui.h"
#include "render.h"
#include "uiinput.h"
#include "imagedev/floppy.h"
#include "debug/debugvw.h"
#include "debug/dvdisasm.h"
@ -14,14 +16,16 @@
#include "debug/dvwpoints.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debugger.h"
#include "render.h"
#include "uiinput.h"
#include "config.h"
#include "debugger.h"
#include "modules/lib/osdobj_common.h"
#include "debug_module.h"
#include "modules/osdmodule.h"
#include "zippath.h"
#include "imagedev/floppy.h"
namespace {
class debug_area
{
@ -1563,4 +1567,6 @@ void debug_imgui::debugger_update()
}
}
} // anonymous namespace
MODULE_DEFINITION(DEBUG_IMGUI, debug_imgui)

View File

@ -35,39 +35,57 @@
#include "util/xmlfile.h"
#if defined(SDLMAME_UNIX) || defined(SDLMAME_WIN32)
extern int sdl_entered_debugger;
#elif defined(_WIN32)
void winwindow_update_cursor_state(running_machine &machine);
bool winwindow_qt_filter(void *message);
#endif
namespace {
class debug_qt : public osd_module, public debug_module
#if defined(_WIN32) && !defined(SDLMAME_WIN32)
, public QAbstractNativeEventFilter
#endif
{
public:
debug_qt() : osd_module(OSD_DEBUG_PROVIDER, "qt"), debug_module(), m_machine(nullptr)
debug_qt() :
osd_module(OSD_DEBUG_PROVIDER, "qt"),
debug_module(),
m_machine(nullptr),
m_mainwindow(nullptr)
{
}
virtual ~debug_qt() { }
virtual int init(const osd_options &options) { return 0; }
virtual void exit() { }
virtual void exit();
virtual void init_debugger(running_machine &machine);
virtual void wait_for_debugger(device_t &device, bool firststop);
virtual void debugger_update();
#if defined(_WIN32) && !defined(SDLMAME_WIN32)
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *) Q_DECL_OVERRIDE;
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override
{
winwindow_qt_filter(message);
return false;
}
#endif
private:
void configuration_load(config_type which_type, config_level level, util::xml::data_node const *parentnode);
void configuration_save(config_type which_type, util::xml::data_node *parentnode);
void gather_save_configurations();
void load_window_configurations(util::xml::data_node const &parentnode);
running_machine *m_machine;
osd::debugger::qt::MainWindow *m_mainwindow;
util::xml::file::ptr m_config;
};
namespace {
//============================================================
// "Global" variables to make QT happy
//============================================================
@ -76,122 +94,21 @@ int qtArgc = 1;
char qtArg0[] = "mame";
char *qtArgv[] = { qtArg0, nullptr };
bool oneShot = true;
MainWindow *mainQtWindow = nullptr;
//============================================================
// XML configuration save/load
//============================================================
// Global variable used to feed the xml configuration callbacks
std::vector<std::unique_ptr<WindowQtConfig> > xmlConfigurations;
void xml_configuration_load(running_machine &machine, config_type cfg_type, config_level cfg_level, util::xml::data_node const *parentnode)
{
// We only care about system configuration files
if ((cfg_type != config_type::SYSTEM) || !parentnode)
return;
xmlConfigurations.clear();
// Configuration load
util::xml::data_node const *wnode = nullptr;
for (wnode = parentnode->get_child(osd::debugger::NODE_WINDOW); wnode; wnode = wnode->get_next_sibling(osd::debugger::NODE_WINDOW))
{
switch (wnode->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, -1))
{
case osd::debugger::WINDOW_TYPE_CONSOLE: xmlConfigurations.push_back(std::make_unique<MainWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER: xmlConfigurations.push_back(std::make_unique<MemoryWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER: xmlConfigurations.push_back(std::make_unique<DasmWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER: xmlConfigurations.push_back(std::make_unique<LogWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_POINTS_VIEWER: xmlConfigurations.push_back(std::make_unique<BreakpointsWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER: xmlConfigurations.push_back(std::make_unique<DevicesWindowQtConfig>()); break;
case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER: xmlConfigurations.push_back(std::make_unique<DeviceInformationWindowQtConfig>()); break;
default: continue;
}
xmlConfigurations.back()->recoverFromXmlNode(*wnode);
}
}
//============================================================
// Utilities
//============================================================
void load_and_clear_main_window_config(std::vector<std::unique_ptr<WindowQtConfig> > &configList)
{
for (int i = 0; i < configList.size(); i++)
{
WindowQtConfig &config = *configList[i];
if (config.m_type == osd::debugger::WINDOW_TYPE_CONSOLE)
{
config.applyToQWidget(mainQtWindow);
configList.erase(configList.begin() + i);
break;
}
}
}
void setup_additional_startup_windows(running_machine &machine, std::vector<std::unique_ptr<WindowQtConfig> > &configList)
{
for (int i = 0; i < configList.size(); i++)
{
WindowQtConfig &config = *configList[i];
WindowQt *foo = nullptr;
switch (config.m_type)
{
case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER:
foo = new MemoryWindow(machine); break;
case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER:
foo = new DasmWindow(machine); break;
case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER:
foo = new LogWindow(machine); break;
case osd::debugger::WINDOW_TYPE_POINTS_VIEWER:
foo = new BreakpointsWindow(machine); break;
case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER:
foo = new DevicesWindow(machine); break;
case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER:
foo = new DeviceInformationWindow(machine); break;
default:
break;
}
config.applyToQWidget(foo);
foo->show();
}
}
void bring_main_window_to_front()
{
foreach (QWidget *widget, QApplication::topLevelWidgets())
{
if (dynamic_cast<MainWindow *>(widget))
{
widget->activateWindow();
widget->raise();
}
}
}
} // anonymous namespace
//============================================================
// Core functionality
//============================================================
#if defined(_WIN32) && !defined(SDLMAME_WIN32)
bool winwindow_qt_filter(void *message);
bool debug_qt::nativeEventFilter(const QByteArray &eventType, void *message, long *)
void debug_qt::exit()
{
winwindow_qt_filter(message);
return false;
// If you've done a hard reset, clear out existing widgets
if (m_mainwindow)
m_mainwindow->setExiting();
QApplication::closeAllWindows();
qApp->processEvents(QEventLoop::AllEvents, 1);
m_mainwindow = nullptr;
}
#endif
void debug_qt::init_debugger(running_machine &machine)
{
@ -203,23 +120,12 @@ void debug_qt::init_debugger(running_machine &machine)
QAbstractEventDispatcher::instance()->installNativeEventFilter(this);
#endif
}
else
{
// If you've done a hard reset, clear out existing widgets & get ready for re-init
foreach (QWidget *widget, QApplication::topLevelWidgets())
{
if (!widget->isWindow() || widget->windowType() != Qt::Window)
continue;
delete widget;
}
oneShot = true;
}
m_machine = &machine;
// Setup the configuration XML saving and loading
machine.configuration().config_register("debugger",
configuration_manager::load_delegate(&xml_configuration_load, &machine),
configuration_manager::load_delegate(&debug_qt::configuration_load, this),
configuration_manager::save_delegate(&debug_qt::configuration_save, this));
}
@ -228,12 +134,6 @@ void debug_qt::init_debugger(running_machine &machine)
// Core functionality
//============================================================
#if defined(SDLMAME_UNIX) || defined(SDLMAME_WIN32)
extern int sdl_entered_debugger;
#elif defined(_WIN32)
void winwindow_update_cursor_state(running_machine &machine);
#endif
void debug_qt::wait_for_debugger(device_t &device, bool firststop)
{
#if defined(SDLMAME_UNIX) || defined(SDLMAME_WIN32)
@ -241,61 +141,55 @@ void debug_qt::wait_for_debugger(device_t &device, bool firststop)
#endif
// Dialog initialization
if (oneShot)
if (!m_mainwindow)
{
mainQtWindow = new MainWindow(*m_machine);
load_and_clear_main_window_config(xmlConfigurations);
setup_additional_startup_windows(*m_machine, xmlConfigurations);
mainQtWindow->show();
oneShot = false;
m_mainwindow = new osd::debugger::qt::MainWindow(*m_machine);
if (m_config)
{
load_window_configurations(*m_config->get_first_child());
m_config.reset();
}
m_mainwindow->show();
}
// Ensure all top level widgets are visible & bring main window to front
foreach (QWidget *widget, QApplication::topLevelWidgets())
{
if (!widget->isWindow() || widget->windowType() != Qt::Window)
continue;
widget->show();
if (widget->isWindow() && (widget->windowType() == Qt::Window))
widget->show();
}
if (firststop)
bring_main_window_to_front();
{
m_mainwindow->activateWindow();
m_mainwindow->raise();
}
// Set the main window to display the proper cpu
mainQtWindow->setProcessor(&device);
m_mainwindow->setProcessor(&device);
// Run our own QT event loop
osd_sleep(osd_ticks_per_second() / 1000 * 50);
qApp->processEvents(QEventLoop::AllEvents, 1);
// Refresh everyone if requested
if (mainQtWindow->wantsRefresh())
if (m_mainwindow->wantsRefresh())
{
QWidgetList allWidgets = qApp->allWidgets();
for (int i = 0; i < allWidgets.length(); i++)
allWidgets[i]->update();
mainQtWindow->clearRefreshFlag();
m_mainwindow->clearRefreshFlag();
}
// Hide all top level widgets if requested
if (mainQtWindow->wantsHide())
if (m_mainwindow->wantsHide())
{
foreach (QWidget *widget, QApplication::topLevelWidgets())
{
if (!widget->isWindow() || widget->windowType() != Qt::Window)
continue;
widget->hide();
if (widget->isWindow() && (widget->windowType() == Qt::Window))
widget->hide();
}
mainQtWindow->clearHideFlag();
}
// Exit if the machine has been instructed to do so (scheduled event == exit || hard_reset)
if (m_machine->scheduled_event_pending())
{
// Keep a list of windows we want to save.
// We need to do this here because by the time xml_configuration_save gets called
// all the QT windows are already gone.
gather_save_configurations();
m_mainwindow->clearHideFlag();
}
#if defined(_WIN32) && !defined(SDLMAME_WIN32)
@ -314,37 +208,92 @@ void debug_qt::debugger_update()
}
void debug_qt::configuration_load(config_type which_type, config_level level, util::xml::data_node const *parentnode)
{
// We only care about system configuration files for now
if ((config_type::SYSTEM == which_type) && parentnode)
{
if (m_mainwindow)
{
load_window_configurations(*parentnode);
}
else
{
m_config = util::xml::file::create();
parentnode->copy_into(*m_config);
}
}
}
void debug_qt::configuration_save(config_type which_type, util::xml::data_node *parentnode)
{
// We only save system configuration for now
if ((config_type::SYSTEM == which_type) && parentnode && m_config)
if ((config_type::SYSTEM == which_type) && parentnode)
{
for (util::xml::data_node const *node = m_config->get_first_child(); node; node = node->get_next_sibling())
node->copy_into(*parentnode);
m_config.reset();
// Loop over all the open windows
for (QWidget *widget : QApplication::topLevelWidgets())
{
if (!widget->isWindow() || (widget->windowType() != Qt::Window))
continue;
osd::debugger::qt::WindowQt *const win = dynamic_cast<osd::debugger::qt::WindowQt *>(widget);
if (win)
win->saveConfiguration(*parentnode);
}
}
}
void debug_qt::gather_save_configurations()
void debug_qt::load_window_configurations(util::xml::data_node const &parentnode)
{
m_config = util::xml::file::create();
// Loop over all the open windows
foreach (QWidget *widget, QApplication::topLevelWidgets())
for (util::xml::data_node const *wnode = parentnode.get_child(osd::debugger::NODE_WINDOW); wnode; wnode = wnode->get_next_sibling(osd::debugger::NODE_WINDOW))
{
if (!widget->isVisible())
continue;
if (!widget->isWindow() || widget->windowType() != Qt::Window)
continue;
WindowQt *const win = dynamic_cast<WindowQt *>(widget);
if (win)
win->saveConfiguration(*m_config);
std::unique_ptr<osd::debugger::qt::WindowQtConfig> cfg;
osd::debugger::qt::WindowQt *win = nullptr;
switch (wnode->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, -1))
{
case osd::debugger::WINDOW_TYPE_CONSOLE:
cfg = std::make_unique<osd::debugger::qt::MainWindowQtConfig>();
break;
case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER:
cfg = std::make_unique<osd::debugger::qt::MemoryWindowQtConfig>();
win = new osd::debugger::qt::MemoryWindow(*m_machine);
break;
case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER:
cfg = std::make_unique<osd::debugger::qt::DasmWindowQtConfig>();
win = new osd::debugger::qt::DasmWindow(*m_machine);
break;
case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER:
cfg = std::make_unique<osd::debugger::qt::LogWindowQtConfig>();
win = new osd::debugger::qt::LogWindow(*m_machine);
break;
case osd::debugger::WINDOW_TYPE_POINTS_VIEWER:
cfg = std::make_unique<osd::debugger::qt::BreakpointsWindowQtConfig>();
win = new osd::debugger::qt::BreakpointsWindow(*m_machine);
break;
case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER:
cfg = std::make_unique<osd::debugger::qt::DevicesWindowQtConfig>();
win = new osd::debugger::qt::DevicesWindow(*m_machine);
break;
case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER:
cfg = std::make_unique<osd::debugger::qt::DeviceInformationWindowQtConfig>();
win = new osd::debugger::qt::DeviceInformationWindow(*m_machine);
break;
}
if (cfg)
{
cfg->recoverFromXmlNode(*wnode);
if (win)
cfg->applyToQWidget(win);
else if (osd::debugger::WINDOW_TYPE_CONSOLE == cfg->m_type)
cfg->applyToQWidget(m_mainwindow);
}
}
}
} // anonymous namespace
#else // USE_QTDEBUG
MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt")

View File

@ -33,7 +33,12 @@
#include "../input/input_windows.h"
class debugger_windows : public osd_module, public debug_module, protected debugger_windows_interface
namespace {
class debugger_windows :
public osd_module,
public debug_module,
protected osd::debugger::win::debugger_windows_interface
{
public:
debugger_windows() :
@ -61,7 +66,7 @@ public:
protected:
virtual running_machine &machine() const override { return *m_machine; }
virtual ui_metrics &metrics() const override { return *m_metrics; }
virtual osd::debugger::win::ui_metrics &metrics() const override { return *m_metrics; }
virtual void set_color_theme(int index) override;
virtual bool get_save_window_arrangement() const override { return m_save_windows; }
virtual void set_save_window_arrangement(bool save) override { m_save_windows = save; }
@ -69,11 +74,11 @@ protected:
virtual bool const &waiting_for_debugger() const override { return m_waiting_for_debugger; }
virtual bool seq_pressed() const override;
virtual void create_memory_window() override { create_window<memorywin_info>(); }
virtual void create_disasm_window() override { create_window<disasmwin_info>(); }
virtual void create_log_window() override { create_window<logwin_info>(); }
virtual void create_points_window() override { create_window<pointswin_info>(); }
virtual void remove_window(debugwin_info &info) override;
virtual void create_memory_window() override { create_window<osd::debugger::win::memorywin_info>(); }
virtual void create_disasm_window() override { create_window<osd::debugger::win::disasmwin_info>(); }
virtual void create_log_window() override { create_window<osd::debugger::win::logwin_info>(); }
virtual void create_points_window() override { create_window<osd::debugger::win::pointswin_info>(); }
virtual void remove_window(osd::debugger::win::debugwin_info &info) override;
virtual void show_all() override;
virtual void hide_all() override;
@ -86,11 +91,11 @@ private:
void load_configuration(util::xml::data_node const &parentnode);
running_machine *m_machine;
std::unique_ptr<ui_metrics> m_metrics;
bool m_waiting_for_debugger;
std::vector<std::unique_ptr<debugwin_info>> m_window_list;
consolewin_info *m_main_console;
running_machine *m_machine;
std::unique_ptr<osd::debugger::win::ui_metrics> m_metrics;
bool m_waiting_for_debugger;
std::vector<std::unique_ptr<osd::debugger::win::debugwin_info> > m_window_list;
osd::debugger::win::consolewin_info *m_main_console;
util::xml::file::ptr m_config;
bool m_save_windows;
@ -112,7 +117,7 @@ void debugger_windows::exit()
void debugger_windows::init_debugger(running_machine &machine)
{
m_machine = &machine;
m_metrics = std::make_unique<ui_metrics>(downcast<osd_options &>(m_machine->options()));
m_metrics = std::make_unique<osd::debugger::win::ui_metrics>(downcast<osd_options &>(m_machine->options()));
machine.configuration().config_register(
"debugger",
configuration_manager::load_delegate(&debugger_windows::config_load, this),
@ -124,7 +129,7 @@ void debugger_windows::wait_for_debugger(device_t &device, bool firststop)
{
// create a console window
if (!m_main_console)
m_main_console = create_window<consolewin_info>();
m_main_console = create_window<osd::debugger::win::consolewin_info>();
// update the views in the console to reflect the current CPU
if (m_main_console)
@ -256,7 +261,7 @@ bool debugger_windows::seq_pressed() const
}
void debugger_windows::remove_window(debugwin_info &info)
void debugger_windows::remove_window(osd::debugger::win::debugwin_info &info)
{
for (auto it = m_window_list.begin(); it != m_window_list.end(); ++it)
if (it->get() == &info) {
@ -345,23 +350,23 @@ void debugger_windows::load_configuration(util::xml::data_node const &parentnode
{
for (util::xml::data_node const *node = parentnode.get_child(osd::debugger::NODE_WINDOW); node; node = node->get_next_sibling(osd::debugger::NODE_WINDOW))
{
debugwin_info *win = nullptr;
osd::debugger::win::debugwin_info *win = nullptr;
switch (node->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, -1))
{
case osd::debugger::WINDOW_TYPE_CONSOLE:
m_main_console->restore_configuration_from_node(*node);
break;
case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER:
win = create_window<memorywin_info>();
win = create_window<osd::debugger::win::memorywin_info>();
break;
case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER:
win = create_window<disasmwin_info>();
win = create_window<osd::debugger::win::disasmwin_info>();
break;
case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER:
win = create_window<logwin_info>();
win = create_window<osd::debugger::win::logwin_info>();
break;
case osd::debugger::WINDOW_TYPE_POINTS_VIEWER:
win = create_window<pointswin_info>();
win = create_window<osd::debugger::win::pointswin_info>();
break;
case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER:
// not supported
@ -377,6 +382,7 @@ void debugger_windows::load_configuration(util::xml::data_node const &parentnode
}
}
} // anonymous namespace
#else // not Windows
MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows")

View File

@ -14,6 +14,9 @@
#include "debug/debugcpu.h"
#include "debugger.h"
namespace {
class debug_none : public osd_module, public debug_module
{
public:
@ -50,4 +53,6 @@ void debug_none::debugger_update()
{
}
} // anonymous namespace
MODULE_DEFINITION(DEBUG_NONE, debug_none)

View File

@ -15,6 +15,8 @@
#include <QtWidgets/QVBoxLayout>
namespace osd::debugger::qt {
BreakpointsWindow::BreakpointsWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
{
@ -85,19 +87,19 @@ void BreakpointsWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_POINTS_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_POINTS_VIEWER);
if (m_breakpointsView)
{
switch (m_breakpointsView->view()->type())
{
case DVT_BREAK_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 0);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 0);
break;
case DVT_WATCH_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 1);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 1);
break;
case DVT_REGISTER_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 2);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 2);
break;
default:
break;
@ -152,5 +154,7 @@ void BreakpointsWindowQtConfig::applyToQWidget(QWidget* widget)
void BreakpointsWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
m_bwType = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, m_bwType);
m_bwType = node.get_attribute_int(ATTR_WINDOW_POINTS_TYPE, m_bwType);
}
} // namespace osd::debugger::qt

View File

@ -7,6 +7,8 @@
#include "windowqt.h"
namespace osd::debugger::qt {
//============================================================
// The Breakpoints Window.
//============================================================
@ -37,7 +39,7 @@ class BreakpointsWindowQtConfig : public WindowQtConfig
{
public:
BreakpointsWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_POINTS_VIEWER),
WindowQtConfig(WINDOW_TYPE_POINTS_VIEWER),
m_bwType(0)
{
}
@ -51,4 +53,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_BREAKPOINTSWINDOW_H

View File

@ -17,6 +17,8 @@
#include <QtWidgets/QMenuBar>
namespace osd::debugger::qt {
DasmWindow::DasmWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
{
@ -92,6 +94,9 @@ DasmWindow::DasmWindow(running_machine &machine, QWidget *parent) :
QAction *rightActRaw = new QAction("Raw Opcodes", this);
QAction *rightActEncrypted = new QAction("Encrypted Opcodes", this);
QAction *rightActComments = new QAction("Comments", this);
rightActRaw->setData(int(DASM_RIGHTCOL_RAW));
rightActEncrypted->setData(int(DASM_RIGHTCOL_ENCRYPTED));
rightActComments->setData(int(DASM_RIGHTCOL_COMMENTS));
rightActRaw->setCheckable(true);
rightActEncrypted->setCheckable(true);
rightActComments->setCheckable(true);
@ -123,12 +128,12 @@ 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);
node.set_attribute_int(ATTR_WINDOW_TYPE, 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());
node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_dasmView->sourceIndex());
node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
node.add_child(NODE_WINDOW_EXPRESSION, dasmview.expression());
}
@ -217,19 +222,8 @@ void DasmWindow::runToCursor(bool changedTo)
void DasmWindow::rightBarChanged(QAction* changedTo)
{
debug_view_disasm* dasmView = m_dasmView->view<debug_view_disasm>();
if (changedTo->text() == "Raw Opcodes")
{
dasmView->set_right_column(DASM_RIGHTCOL_RAW);
}
else if (changedTo->text() == "Encrypted Opcodes")
{
dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
}
else if (changedTo->text() == "Comments")
{
dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
}
debug_view_disasm *const dasmView = m_dasmView->view<debug_view_disasm>();
dasmView->set_right_column(disasm_right_column(changedTo->data().toInt()));
m_dasmView->viewport()->update();
}
@ -302,16 +296,22 @@ void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
QComboBox *cpu = window->findChild<QComboBox *>("cpu");
cpu->setCurrentIndex(m_cpu);
if ((DASM_RIGHTCOL_RAW <= m_rightBar) && (DASM_RIGHTCOL_COMMENTS >= m_rightBar))
QActionGroup *const rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
for (QAction *action : rightBarGroup->actions())
{
QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
rightBarGroup->actions()[m_rightBar - 1]->trigger();
if (action->data().toInt() == m_rightBar)
{
action->trigger();
break;
}
}
}
void DasmWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
m_cpu = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu);
m_rightBar = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
m_cpu = node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu);
m_rightBar = node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}
} // namespace osd::debugger::qt

View File

@ -12,6 +12,8 @@
#include <QtWidgets/QLineEdit>
namespace osd::debugger::qt {
//============================================================
// The Disassembly Window.
//============================================================
@ -60,7 +62,7 @@ class DasmWindowQtConfig : public WindowQtConfig
{
public:
DasmWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER),
WindowQtConfig(WINDOW_TYPE_DISASSEMBLY_VIEWER),
m_cpu(0),
m_rightBar(0)
{
@ -76,5 +78,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_DASMWINDOW_H

View File

@ -16,6 +16,9 @@
#define horizontalAdvance width
#endif
namespace osd::debugger::qt {
DebuggerView::DebuggerView(
debug_view_type type,
running_machine &machine,
@ -374,3 +377,5 @@ void DebuggerView::debuggerViewUpdate(debug_view &debugView, void *osdPrivate)
dView->update();
emit dView->updated();
}
} // namespace osd::debugger::qt

View File

@ -11,6 +11,8 @@
#include <QtWidgets/QMenu>
namespace osd::debugger::qt {
class DebuggerView : public QAbstractScrollArea
{
Q_OBJECT
@ -53,4 +55,6 @@ private:
bool m_preferBottom;
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_DEBUGGERVIEW_H

View File

@ -10,6 +10,8 @@
#include <QtWidgets/QVBoxLayout>
namespace osd::debugger::qt {
DeviceInformationWindow::DeviceInformationWindow(running_machine &machine, device_t *device, QWidget *parent) :
WindowQt(machine, nullptr),
m_device(device)
@ -34,9 +36,9 @@ void DeviceInformationWindow::saveConfigurationToNode(util::xml::data_node &node
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_DEVICE_INFO_VIEWER);
node.set_attribute(osd::debugger::ATTR_WINDOW_DEVICE_TAG, m_device->tag());
node.set_attribute(ATTR_WINDOW_DEVICE_TAG, m_device->tag());
}
@ -128,5 +130,7 @@ void DeviceInformationWindowQtConfig::applyToQWidget(QWidget *widget)
void DeviceInformationWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
m_device_tag = node.get_attribute_string(osd::debugger::ATTR_WINDOW_DEVICE_TAG, ":");
m_device_tag = node.get_attribute_string(ATTR_WINDOW_DEVICE_TAG, ":");
}
} // namespace osd::debugger::qt

View File

@ -7,6 +7,9 @@
#include "windowqt.h"
namespace osd::debugger::qt {
//============================================================
// The Device Information Window.
//============================================================
@ -41,7 +44,7 @@ public:
std::string m_device_tag;
DeviceInformationWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER)
WindowQtConfig(WINDOW_TYPE_DEVICE_INFO_VIEWER)
{
}
@ -51,5 +54,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_DEVICEINFORMATIONWINDOW_H

View File

@ -8,6 +8,8 @@
#include "util/xmlfile.h"
namespace osd::debugger::qt {
DevicesWindowModel::DevicesWindowModel(running_machine &machine, QObject *parent) :
m_machine(machine)
{
@ -160,7 +162,7 @@ void DevicesWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DEVICES_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_DEVICES_VIEWER);
}
@ -180,3 +182,5 @@ void DevicesWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
}
} // namespace osd::debugger::qt

View File

@ -10,6 +10,8 @@
#include <QtWidgets/QTreeView>
namespace osd::debugger::qt {
//============================================================
// The model for the treeview
//============================================================
@ -68,7 +70,7 @@ class DevicesWindowQtConfig : public WindowQtConfig
{
public:
DevicesWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_DEVICES_VIEWER)
WindowQtConfig(WINDOW_TYPE_DEVICES_VIEWER)
{
}
@ -80,5 +82,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_DEVICESWINDOW_H

View File

@ -12,6 +12,8 @@
#include <QtWidgets/QVBoxLayout>
namespace osd::debugger::qt {
LogWindow::LogWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
{
@ -50,7 +52,7 @@ void LogWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_ERROR_LOG_VIEWER);
}
@ -68,3 +70,5 @@ void LogWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
}
} // namespace osd::debugger::qt

View File

@ -9,6 +9,8 @@
#include "windowqt.h"
namespace osd::debugger::qt {
//============================================================
// The Log Window.
//============================================================
@ -36,7 +38,7 @@ class LogWindowQtConfig : public WindowQtConfig
{
public:
LogWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER)
WindowQtConfig(WINDOW_TYPE_ERROR_LOG_VIEWER)
{
}
@ -46,5 +48,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_LOGWINDOW_H

View File

@ -19,10 +19,13 @@
#include <QtWidgets/QScrollBar>
namespace osd::debugger::qt {
MainWindow::MainWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr),
m_historyIndex(0),
m_inputHistory()
m_inputHistory(),
m_exiting(false)
{
setGeometry(300, 300, 1000, 600);
@ -70,6 +73,9 @@ MainWindow::MainWindow(running_machine &machine, QWidget *parent) :
QAction *rightActRaw = new QAction("Raw Opcodes", this);
QAction *rightActEncrypted = new QAction("Encrypted Opcodes", this);
QAction *rightActComments = new QAction("Comments", this);
rightActRaw->setData(int(DASM_RIGHTCOL_RAW));
rightActEncrypted->setData(int(DASM_RIGHTCOL_ENCRYPTED));
rightActComments->setData(int(DASM_RIGHTCOL_COMMENTS));
rightActRaw->setCheckable(true);
rightActEncrypted->setCheckable(true);
rightActComments->setCheckable(true);
@ -152,10 +158,10 @@ void MainWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_CONSOLE);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_CONSOLE);
debug_view_disasm &dasmview = *m_dasmFrame->view()->view<debug_view_disasm>();
node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
node.set_attribute("qtwindowstate", saveState().toPercentEncoding().data());
}
@ -163,10 +169,12 @@ void MainWindow::saveConfigurationToNode(util::xml::data_node &node)
// Used to intercept the user clicking 'X' in the upper corner
void MainWindow::closeEvent(QCloseEvent *event)
{
debugActQuit();
// Insure the window doesn't disappear before we get a chance to save its parameters
event->ignore();
if (!m_exiting)
{
// Don't actually close the window - it will be brought back on user break
debugActRunAndHide();
event->ignore();
}
}
@ -279,14 +287,7 @@ void MainWindow::runToCursor(bool changedTo)
void MainWindow::rightBarChanged(QAction *changedTo)
{
debug_view_disasm *const dasmView = m_dasmFrame->view()->view<debug_view_disasm>();
if (changedTo->text() == "Raw Opcodes")
dasmView->set_right_column(DASM_RIGHTCOL_RAW);
else if (changedTo->text() == "Encrypted Opcodes")
dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
else if (changedTo->text() == "Comments")
dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
dasmView->set_right_column(disasm_right_column(changedTo->data().toInt()));
m_dasmFrame->view()->viewport()->update();
}
@ -489,8 +490,15 @@ void MainWindowQtConfig::applyToQWidget(QWidget *widget)
MainWindow *window = dynamic_cast<MainWindow *>(widget);
window->restoreState(m_windowState);
QActionGroup* rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
rightBarGroup->actions()[m_rightBar - 1]->trigger();
QActionGroup *const rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
for (QAction *action : rightBarGroup->actions())
{
if (action->data().toInt() == m_rightBar)
{
action->trigger();
break;
}
}
}
@ -499,7 +507,7 @@ void MainWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
WindowQtConfig::recoverFromXmlNode(node);
const char* state = node.get_attribute_string("qtwindowstate", "");
m_windowState = QByteArray::fromPercentEncoding(state);
m_rightBar = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
m_rightBar = node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}
DasmDockWidget::~DasmDockWidget()
@ -509,3 +517,5 @@ DasmDockWidget::~DasmDockWidget()
ProcessorDockWidget::~ProcessorDockWidget()
{
}
} // namespace osd::debugger::qt

View File

@ -17,6 +17,8 @@
#include <vector>
namespace osd::debugger::qt {
class DasmDockWidget;
class ProcessorDockWidget;
@ -34,6 +36,8 @@ public:
void setProcessor(device_t *processor);
void setExiting() { m_exiting = true; }
protected:
virtual void saveConfigurationToNode(util::xml::data_node &node) override;
@ -56,13 +60,15 @@ private slots:
void dasmViewUpdated();
// Closing the main window actually exits the program
// Closing the main window hides the debugger and runs the emulated system
void debugActClose();
private:
void createImagesMenu();
void addToHistory(const QString& command);
void executeCommand(bool withClear);
// Widgets and docks
QLineEdit *m_inputEdit;
DebuggerView *m_consoleView;
@ -77,8 +83,8 @@ private:
// Terminal history
int m_historyIndex;
std::vector<QString> m_inputHistory;
void addToHistory(const QString& command);
void executeCommand(bool withClear);
bool m_exiting;
};
@ -160,7 +166,7 @@ class MainWindowQtConfig : public WindowQtConfig
{
public:
MainWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_CONSOLE),
WindowQtConfig(WINDOW_TYPE_CONSOLE),
m_rightBar(0),
m_windowState()
{}
@ -175,5 +181,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_MAINWINDOW_H

View File

@ -24,6 +24,9 @@
#define horizontalAdvance width
#endif
namespace osd::debugger::qt {
MemoryWindow::MemoryWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
{
@ -89,17 +92,17 @@ MemoryWindow::MemoryWindow(running_machine &machine, QWidget *parent) :
QAction *formatAct32bitFloat = new QAction("32-bit Floating Point", this);
QAction *formatAct64bitFloat = new QAction("64-bit Floating Point", this);
QAction *formatAct80bitFloat = new QAction("80-bit Floating Point", this);
formatActOne->setObjectName("formatActOne");
formatActTwo->setObjectName("formatActTwo");
formatActFour->setObjectName("formatActFour");
formatActEight->setObjectName("formatActEight");
formatActOneOctal->setObjectName("formatActOneOctal");
formatActTwoOctal->setObjectName("formatActTwoOctal");
formatActFourOctal->setObjectName("formatActFourOctal");
formatActEightOctal->setObjectName("formatActEightOctal");
formatAct32bitFloat->setObjectName("formatAct32bitFloat");
formatAct64bitFloat->setObjectName("formatAct64bitFloat");
formatAct80bitFloat->setObjectName("formatAct80bitFloat");
formatActOne->setData(int(debug_view_memory::data_format::HEX_8BIT));
formatActTwo->setData(int(debug_view_memory::data_format::HEX_16BIT));
formatActFour->setData(int(debug_view_memory::data_format::HEX_32BIT));
formatActEight->setData(int(debug_view_memory::data_format::HEX_64BIT));
formatActOneOctal->setData(int(debug_view_memory::data_format::OCTAL_8BIT));
formatActTwoOctal->setData(int(debug_view_memory::data_format::OCTAL_16BIT));
formatActFourOctal->setData(int(debug_view_memory::data_format::OCTAL_32BIT));
formatActEightOctal->setData(int(debug_view_memory::data_format::OCTAL_64BIT));
formatAct32bitFloat->setData(int(debug_view_memory::data_format::FLOAT_32BIT));
formatAct64bitFloat->setData(int(debug_view_memory::data_format::FLOAT_64BIT));
formatAct80bitFloat->setData(int(debug_view_memory::data_format::FLOAT_80BIT));
formatActOne->setCheckable(true);
formatActTwo->setCheckable(true);
formatActFour->setCheckable(true);
@ -141,6 +144,8 @@ MemoryWindow::MemoryWindow(running_machine &machine, QWidget *parent) :
addressGroup->setObjectName("addressgroup");
QAction *addressActLogical = new QAction("Logical Addresses", this);
QAction *addressActPhysical = new QAction("Physical Addresses", this);
addressActLogical->setData(false);
addressActPhysical->setData(true);
addressActLogical->setCheckable(true);
addressActPhysical->setCheckable(true);
addressActLogical->setActionGroup(addressGroup);
@ -156,9 +161,9 @@ MemoryWindow::MemoryWindow(running_machine &machine, QWidget *parent) :
QAction *radixActHexadecimal = new QAction("Hexadecimal Addresses", this);
QAction *radixActDecimal = new QAction("Decimal Addresses", this);
QAction *radixActOctal = new QAction("Octal Addresses", this);
radixActHexadecimal->setObjectName("radixHexadecimal");
radixActDecimal->setObjectName("radixDecimal");
radixActOctal->setObjectName("radixOctal");
radixActHexadecimal->setData(16);
radixActDecimal->setData(10);
radixActOctal->setData(8);
radixActHexadecimal->setCheckable(true);
radixActDecimal->setCheckable(true);
radixActOctal->setCheckable(true);
@ -218,16 +223,16 @@ void MemoryWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_MEMORY_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_MEMORY_VIEWER);
debug_view_memory &memView = *m_memTable->view<debug_view_memory>();
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, m_memTable->sourceIndex());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memView.reverse() ? 1 : 0);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_MODE, memView.physical() ? 1 : 0);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memView.address_radix());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memView.get_data_format()));
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ROW_CHUNKS, memView.chunks_per_row());
node.add_child(osd::debugger::NODE_WINDOW_EXPRESSION, memView.expression());
node.set_attribute_int(ATTR_WINDOW_MEMORY_REGION, m_memTable->sourceIndex());
node.set_attribute_int(ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memView.reverse() ? 1 : 0);
node.set_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_MODE, memView.physical() ? 1 : 0);
node.set_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memView.address_radix());
node.set_attribute_int(ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memView.get_data_format()));
node.set_attribute_int(ATTR_WINDOW_MEMORY_ROW_CHUNKS, memView.chunks_per_row());
node.add_child(NODE_WINDOW_EXPRESSION, memView.expression());
}
@ -239,28 +244,26 @@ void MemoryWindow::memoryRegionChanged(int index)
m_memTable->viewport()->update();
// Update the data format radio buttons to the memory region's default
debug_view_memory *memView = m_memTable->view<debug_view_memory>();
switch (memView->get_data_format())
debug_view_memory *const memView = m_memTable->view<debug_view_memory>();
QActionGroup *const dataFormat = findChild<QActionGroup *>("dataformat");
for (QAction *action : dataFormat->actions())
{
case debug_view_memory::data_format::HEX_8BIT: dataFormatMenuItem("formatActOne")->setChecked(true); break;
case debug_view_memory::data_format::HEX_16BIT: dataFormatMenuItem("formatActTwo")->setChecked(true); break;
case debug_view_memory::data_format::HEX_32BIT: dataFormatMenuItem("formatActFour")->setChecked(true); break;
case debug_view_memory::data_format::HEX_64BIT: dataFormatMenuItem("formatActEight")->setChecked(true); break;
case debug_view_memory::data_format::OCTAL_8BIT: dataFormatMenuItem("formatActOneOctal")->setChecked(true); break;
case debug_view_memory::data_format::OCTAL_16BIT: dataFormatMenuItem("formatActTwoOctal")->setChecked(true); break;
case debug_view_memory::data_format::OCTAL_32BIT: dataFormatMenuItem("formatActFourOctal")->setChecked(true); break;
case debug_view_memory::data_format::OCTAL_64BIT: dataFormatMenuItem("formatActEightOctal")->setChecked(true); break;
case debug_view_memory::data_format::FLOAT_32BIT: dataFormatMenuItem("formatAct32bitFloat")->setChecked(true); break;
case debug_view_memory::data_format::FLOAT_64BIT: dataFormatMenuItem("formatAct64bitFloat")->setChecked(true); break;
case debug_view_memory::data_format::FLOAT_80BIT: dataFormatMenuItem("formatAct80bitFloat")->setChecked(true); break;
default: break;
if (debug_view_memory::data_format(action->data().toInt()) == memView->get_data_format())
{
action->setChecked(true);
break;
}
}
switch (memView->address_radix())
QActionGroup *radixGroup = findChild<QActionGroup*>("radixgroup");
for (QAction *action : radixGroup->actions())
{
case 8: dataFormatMenuItem("radixOctal")->setChecked(true); break;
case 10: dataFormatMenuItem("radixDecimal")->setChecked(true); break;
case 16: dataFormatMenuItem("radixHexadecimal")->setChecked(true); break;
default: break;
if (action->data().toInt() == memView->address_radix())
{
action->setChecked(true);
break;
}
}
}
}
@ -287,30 +290,7 @@ void MemoryWindow::expressionSubmitted()
void MemoryWindow::formatChanged(QAction* changedTo)
{
debug_view_memory *const memView = m_memTable->view<debug_view_memory>();
if (changedTo->text() == "1-byte hexadecimal")
memView->set_data_format(debug_view_memory::data_format::HEX_8BIT);
else if (changedTo->text() == "2-byte hexadecimal")
memView->set_data_format(debug_view_memory::data_format::HEX_16BIT);
else if (changedTo->text() == "4-byte hexadecimal")
memView->set_data_format(debug_view_memory::data_format::HEX_32BIT);
else if (changedTo->text() == "8-byte hexadecimal")
memView->set_data_format(debug_view_memory::data_format::HEX_64BIT);
else if (changedTo->text() == "1-byte octal")
memView->set_data_format(debug_view_memory::data_format::OCTAL_8BIT);
else if (changedTo->text() == "2-byte octal")
memView->set_data_format(debug_view_memory::data_format::OCTAL_16BIT);
else if (changedTo->text() == "4-byte octal")
memView->set_data_format(debug_view_memory::data_format::OCTAL_32BIT);
else if (changedTo->text() == "8-byte octal")
memView->set_data_format(debug_view_memory::data_format::OCTAL_64BIT);
else if (changedTo->text() == "32 bit floating point")
memView->set_data_format(debug_view_memory::data_format::FLOAT_32BIT);
else if (changedTo->text() == "64 bit floating point")
memView->set_data_format(debug_view_memory::data_format::FLOAT_64BIT);
else if (changedTo->text() == "80 bit floating point")
memView->set_data_format(debug_view_memory::data_format::FLOAT_80BIT);
memView->set_data_format(debug_view_memory::data_format(changedTo->data().toInt()));
m_memTable->viewport()->update();
}
@ -318,12 +298,7 @@ void MemoryWindow::formatChanged(QAction* changedTo)
void MemoryWindow::addressChanged(QAction* changedTo)
{
debug_view_memory *const memView = m_memTable->view<debug_view_memory>();
if (changedTo->text() == "Logical Addresses")
memView->set_physical(false);
else if (changedTo->text() == "Physical Addresses")
memView->set_physical(true);
memView->set_physical(changedTo->data().toBool());
m_memTable->viewport()->update();
}
@ -331,14 +306,7 @@ void MemoryWindow::addressChanged(QAction* changedTo)
void MemoryWindow::radixChanged(QAction* changedTo)
{
debug_view_memory *const memView = m_memTable->view<debug_view_memory>();
if (changedTo->text() == "Hexadecimal Addresses")
memView->set_address_radix(16);
else if (changedTo->text() == "Decimal Addresses")
memView->set_address_radix(10);
else if (changedTo->text() == "Octal Addresses")
memView->set_address_radix(8);
memView->set_address_radix(changedTo->data().toInt());
m_memTable->viewport()->update();
}
@ -393,25 +361,6 @@ void MemoryWindow::setToCurrentCpu()
}
// I have a hard time storing QActions as class members. This is a substitute.
QAction *MemoryWindow::dataFormatMenuItem(const QString& itemName)
{
QList<QMenu *> menus = menuBar()->findChildren<QMenu *>();
for (int i = 0; i < menus.length(); i++)
{
if (menus[i]->title() != "&Options")
continue;
QList<QAction *> actions = menus[i]->actions();
for (int j = 0; j < actions.length(); j++)
{
if (actions[j]->objectName() == itemName)
return actions[j];
}
}
return nullptr;
}
//=========================================================================
// DebuggerMemView
//=========================================================================
@ -497,33 +446,34 @@ void MemoryWindowQtConfig::applyToQWidget(QWidget *widget)
if (m_reverse)
reverse->trigger();
QActionGroup *addressGroup = window->findChild<QActionGroup*>("addressgroup");
addressGroup->actions()[m_addressMode]->trigger();
QActionGroup *radixGroup = window->findChild<QActionGroup*>("radixgroup");
switch (m_addressRadix)
QActionGroup *const addressGroup = window->findChild<QActionGroup*>("addressgroup");
for (QAction *action : addressGroup->actions())
{
case 16: radixGroup->actions()[0]->trigger(); break;
case 10: radixGroup->actions()[1]->trigger(); break;
case 8: radixGroup->actions()[2]->trigger(); break;
default: break;
if (action->data().toBool() == m_addressMode)
{
action->trigger();
break;
}
}
QActionGroup *dataFormat = window->findChild<QActionGroup*>("dataformat");
switch (debug_view_memory::data_format(m_dataFormat))
QActionGroup *const radixGroup = window->findChild<QActionGroup*>("radixgroup");
for (QAction *action : radixGroup->actions())
{
case debug_view_memory::data_format::HEX_8BIT: dataFormat->actions()[0]->trigger(); break;
case debug_view_memory::data_format::HEX_16BIT: dataFormat->actions()[1]->trigger(); break;
case debug_view_memory::data_format::HEX_32BIT: dataFormat->actions()[2]->trigger(); break;
case debug_view_memory::data_format::HEX_64BIT: dataFormat->actions()[3]->trigger(); break;
case debug_view_memory::data_format::OCTAL_8BIT: dataFormat->actions()[4]->trigger(); break;
case debug_view_memory::data_format::OCTAL_16BIT: dataFormat->actions()[5]->trigger(); break;
case debug_view_memory::data_format::OCTAL_32BIT: dataFormat->actions()[6]->trigger(); break;
case debug_view_memory::data_format::OCTAL_64BIT: dataFormat->actions()[7]->trigger(); break;
case debug_view_memory::data_format::FLOAT_32BIT: dataFormat->actions()[8]->trigger(); break;
case debug_view_memory::data_format::FLOAT_64BIT: dataFormat->actions()[9]->trigger(); break;
case debug_view_memory::data_format::FLOAT_80BIT: dataFormat->actions()[10]->trigger(); break;
default: break;
if (action->data().toInt() == m_addressRadix)
{
action->trigger();
break;
}
}
QActionGroup *const dataFormat = window->findChild<QActionGroup*>("dataformat");
for (QAction *action : dataFormat->actions())
{
if (action->data().toInt() == m_dataFormat)
{
action->trigger();
break;
}
}
}
@ -531,9 +481,11 @@ void MemoryWindowQtConfig::applyToQWidget(QWidget *widget)
void MemoryWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
m_memoryRegion = node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, m_memoryRegion);
m_reverse = node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, m_reverse);
m_addressMode = node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_MODE, m_addressMode);
m_addressRadix = node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_RADIX, m_addressRadix);
m_dataFormat = node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_DATA_FORMAT, m_dataFormat);
m_memoryRegion = node.get_attribute_int(ATTR_WINDOW_MEMORY_REGION, m_memoryRegion);
m_reverse = node.get_attribute_int(ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, m_reverse);
m_addressMode = node.get_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_MODE, m_addressMode);
m_addressRadix = node.get_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_RADIX, m_addressRadix);
m_dataFormat = node.get_attribute_int(ATTR_WINDOW_MEMORY_DATA_FORMAT, m_dataFormat);
}
} // namespace osd::debugger::qt

View File

@ -11,6 +11,9 @@
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLineEdit>
namespace osd::debugger::qt {
class DebuggerMemView;
@ -41,7 +44,6 @@ private slots:
private:
void populateComboBox();
void setToCurrentCpu();
QAction *dataFormatMenuItem(const QString &itemName);
// Widgets
QLineEdit *m_inputEdit;
@ -82,7 +84,7 @@ class MemoryWindowQtConfig : public WindowQtConfig
{
public:
MemoryWindowQtConfig() :
WindowQtConfig(osd::debugger::WINDOW_TYPE_MEMORY_VIEWER),
WindowQtConfig(WINDOW_TYPE_MEMORY_VIEWER),
m_reverse(0),
m_addressMode(0),
m_addressRadix(0),
@ -104,5 +106,6 @@ public:
void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_MEMORYWINDOW_H

View File

@ -17,6 +17,9 @@
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
namespace osd::debugger::qt {
bool WindowQt::s_refreshAll = false;
bool WindowQt::s_hideAll = false;
@ -245,7 +248,7 @@ void WindowQt::debugActQuit()
void WindowQt::saveConfiguration(util::xml::data_node &parentnode)
{
util::xml::data_node *const node = parentnode.add_child(osd::debugger::NODE_WINDOW, nullptr);
util::xml::data_node *const node = parentnode.add_child(NODE_WINDOW, nullptr);
if (node)
saveConfigurationToNode(*node);
}
@ -253,10 +256,10 @@ void WindowQt::saveConfiguration(util::xml::data_node &parentnode)
void WindowQt::saveConfigurationToNode(util::xml::data_node &node)
{
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, geometry().topLeft().x());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, geometry().topLeft().y());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, size().width());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, size().height());
node.set_attribute_int(ATTR_WINDOW_POSITION_X, geometry().topLeft().x());
node.set_attribute_int(ATTR_WINDOW_POSITION_Y, geometry().topLeft().y());
node.set_attribute_int(ATTR_WINDOW_WIDTH, size().width());
node.set_attribute_int(ATTR_WINDOW_HEIGHT, size().height());
}
@ -272,9 +275,11 @@ void WindowQtConfig::applyToQWidget(QWidget *widget)
void WindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
m_size.setX(node.get_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, m_size.x()));
m_size.setY(node.get_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, m_size.y()));
m_position.setX(node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, m_position.x()));
m_position.setY(node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, m_position.y()));
m_type = node.get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
m_size.setX(node.get_attribute_int(ATTR_WINDOW_WIDTH, m_size.x()));
m_size.setY(node.get_attribute_int(ATTR_WINDOW_HEIGHT, m_size.y()));
m_position.setX(node.get_attribute_int(ATTR_WINDOW_POSITION_X, m_position.x()));
m_position.setY(node.get_attribute_int(ATTR_WINDOW_POSITION_Y, m_position.y()));
m_type = node.get_attribute_int(ATTR_WINDOW_TYPE, m_type);
}
} // namespace osd::debugger::qt

View File

@ -10,6 +10,8 @@
#include <QtWidgets/QMainWindow>
namespace osd::debugger::qt {
//============================================================
// The Qt window that everyone derives from.
//============================================================
@ -84,5 +86,6 @@ public:
virtual void recoverFromXmlNode(util::xml::data_node const &node);
};
} // namespace osd::debugger::qt
#endif // MAME_DEBUGGER_QT_WINDOWQT_H

View File

@ -42,6 +42,8 @@
#include <wrl/client.h>
namespace osd::debugger::win {
namespace {
class comdlg_filter_helper
@ -531,7 +533,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
void consolewin_info::save_configuration_to_node(util::xml::data_node &node)
{
disasmbasewin_info::save_configuration_to_node(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_CONSOLE);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_CONSOLE);
}
@ -628,3 +630,5 @@ bool consolewin_info::get_softlist_info(device_image_interface &device)
return passes_tests;
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "disasmbasewininfo.h"
namespace osd::debugger::win {
class consolewin_info : public disasmbasewin_info
{
public:
@ -57,4 +59,6 @@ private:
std::map<std::string,std::string> slmap;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_CONSOLEWININFO_H

View File

@ -10,6 +10,8 @@
#include "debugbaseinfo.h"
namespace osd::debugger::win {
debugbase_info::debugbase_info(debugger_windows_interface &debugger) :
m_debugger(debugger),
m_machine(debugger.machine()),
@ -60,3 +62,5 @@ void debugbase_info::smart_show_window(HWND wnd, bool show)
if (visible != show)
ShowWindow(wnd, show ? SW_SHOW : SW_HIDE);
}
} // namespace osd::debugger::win

View File

@ -13,6 +13,8 @@
#include "debugwin.h"
namespace osd::debugger::win {
class debugbase_info
{
protected:
@ -35,4 +37,6 @@ private:
bool const &m_waiting_for_debugger;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DEBUGBASEINFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// debugview.c - Win32 debug window handling
// debugviewinfo.cpp - Win32 debug window handling
//
//============================================================
@ -25,6 +25,8 @@
#include <mmsystem.h>
namespace osd::debugger::win {
// debugger view styles
#define DEBUG_VIEW_STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
#define DEBUG_VIEW_STYLE_EX 0
@ -303,23 +305,23 @@ void debugview_info::restore_configuration_from_node(util::xml::data_node const
{
if (m_view->cursor_supported())
{
util::xml::data_node const *const selection = node.get_child(osd::debugger::NODE_WINDOW_SELECTION);
util::xml::data_node const *const selection = node.get_child(NODE_WINDOW_SELECTION);
if (selection)
{
debug_view_xy pos = m_view->cursor_position();
m_view->set_cursor_visible(0 != selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_VISIBLE, m_view->cursor_visible() ? 1 : 0));
selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_X, pos.x);
selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_Y, pos.y);
m_view->set_cursor_visible(0 != selection->get_attribute_int(ATTR_SELECTION_CURSOR_VISIBLE, m_view->cursor_visible() ? 1 : 0));
selection->get_attribute_int(ATTR_SELECTION_CURSOR_X, pos.x);
selection->get_attribute_int(ATTR_SELECTION_CURSOR_Y, pos.y);
m_view->set_cursor_position(pos);
}
}
util::xml::data_node const *const scroll = node.get_child(osd::debugger::NODE_WINDOW_SCROLL);
util::xml::data_node const *const scroll = node.get_child(NODE_WINDOW_SCROLL);
if (scroll)
{
debug_view_xy origin = m_view->visible_position();
origin.x = scroll->get_attribute_int(osd::debugger::ATTR_SCROLL_ORIGIN_X, origin.x * metrics().debug_font_width()) / metrics().debug_font_width();
origin.y = scroll->get_attribute_int(osd::debugger::ATTR_SCROLL_ORIGIN_Y, origin.y * metrics().debug_font_height()) / metrics().debug_font_height();
origin.x = scroll->get_attribute_int(ATTR_SCROLL_ORIGIN_X, origin.x * metrics().debug_font_width()) / metrics().debug_font_width();
origin.y = scroll->get_attribute_int(ATTR_SCROLL_ORIGIN_Y, origin.y * metrics().debug_font_height()) / metrics().debug_font_height();
m_view->set_visible_position(origin);
}
}
@ -329,22 +331,22 @@ void debugview_info::save_configuration_to_node(util::xml::data_node &node)
{
if (m_view->cursor_supported())
{
util::xml::data_node *const selection = node.add_child(osd::debugger::NODE_WINDOW_SELECTION, nullptr);
util::xml::data_node *const selection = node.add_child(NODE_WINDOW_SELECTION, nullptr);
if (selection)
{
debug_view_xy const pos = m_view->cursor_position();
selection->set_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_VISIBLE, m_view->cursor_visible() ? 1 : 0);
selection->set_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_X, pos.x);
selection->set_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_Y, pos.y);
selection->set_attribute_int(ATTR_SELECTION_CURSOR_VISIBLE, m_view->cursor_visible() ? 1 : 0);
selection->set_attribute_int(ATTR_SELECTION_CURSOR_X, pos.x);
selection->set_attribute_int(ATTR_SELECTION_CURSOR_Y, pos.y);
}
}
util::xml::data_node *const scroll = node.add_child(osd::debugger::NODE_WINDOW_SCROLL, nullptr);
util::xml::data_node *const scroll = node.add_child(NODE_WINDOW_SCROLL, nullptr);
if (scroll)
{
debug_view_xy const origin = m_view->visible_position();
scroll->set_attribute_int(osd::debugger::ATTR_SCROLL_ORIGIN_X, origin.x * metrics().debug_font_width());
scroll->set_attribute_int(osd::debugger::ATTR_SCROLL_ORIGIN_Y, origin.y * metrics().debug_font_height());
scroll->set_attribute_int(ATTR_SCROLL_ORIGIN_X, origin.x * metrics().debug_font_width());
scroll->set_attribute_int(ATTR_SCROLL_ORIGIN_Y, origin.y * metrics().debug_font_height());
}
}
@ -1074,3 +1076,5 @@ void debugview_info::register_window_class()
s_window_class_registered = true;
}
}
} // namespace osd::debugger::win

View File

@ -17,6 +17,8 @@
#include "debug/debugvw.h"
namespace osd::debugger::win {
class debugview_info : protected debugbase_info
{
public:
@ -90,4 +92,6 @@ private:
static bool s_window_class_registered;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DEBUGVIEWINFO_H

View File

@ -22,6 +22,8 @@
#endif
namespace osd::debugger::win {
class debugview_info;
class debugwin_info;
class ui_metrics;
@ -52,4 +54,6 @@ public:
virtual void hide_all() = 0;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DEBUGWIN_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// debugwininfo.c - Win32 debug window handling
// debugwininfo.cpp - Win32 debug window handling
//
//============================================================
@ -26,6 +26,8 @@
#include <cstring>
namespace osd::debugger::win {
bool debugwin_info::s_window_class_registered = false;
@ -264,7 +266,7 @@ bool debugwin_info::handle_key(WPARAM wparam, LPARAM lparam)
void debugwin_info::save_configuration(util::xml::data_node &parentnode)
{
util::xml::data_node *const node = parentnode.add_child(osd::debugger::NODE_WINDOW, nullptr);
util::xml::data_node *const node = parentnode.add_child(NODE_WINDOW, nullptr);
if (node)
save_configuration_to_node(*node);
}
@ -282,10 +284,10 @@ void debugwin_info::restore_configuration_from_node(util::xml::data_node const &
// get saved size and adjust for window chrome
RECT desired;
desired.left = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, origin.x);
desired.top = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, origin.y);
desired.right = desired.left + node.get_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, bounds.right);
desired.bottom = desired.top + node.get_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, bounds.bottom);
desired.left = node.get_attribute_int(ATTR_WINDOW_POSITION_X, origin.x);
desired.top = node.get_attribute_int(ATTR_WINDOW_POSITION_Y, origin.y);
desired.right = desired.left + node.get_attribute_int(ATTR_WINDOW_WIDTH, bounds.right);
desired.bottom = desired.top + node.get_attribute_int(ATTR_WINDOW_HEIGHT, bounds.bottom);
// TODO: sanity checks...
if (!AdjustWindowRectEx(&desired, DEBUG_WINDOW_STYLE, GetMenu(window()) ? TRUE : FALSE, DEBUG_WINDOW_STYLE_EX))
return;
@ -494,10 +496,10 @@ void debugwin_info::save_configuration_to_node(util::xml::data_node &node)
origin.y = 0;
if (GetClientRect(window(), &bounds) && ClientToScreen(window(), &origin))
{
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, origin.x);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, origin.y);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, bounds.right);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, bounds.bottom);
node.set_attribute_int(ATTR_WINDOW_POSITION_X, origin.x);
node.set_attribute_int(ATTR_WINDOW_POSITION_Y, origin.y);
node.set_attribute_int(ATTR_WINDOW_WIDTH, bounds.right);
node.set_attribute_int(ATTR_WINDOW_HEIGHT, bounds.bottom);
}
}
@ -730,3 +732,5 @@ void debugwin_info::register_window_class()
s_window_class_registered = true;
}
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "debugbaseinfo.h"
namespace osd::debugger::win {
class debugwin_info : protected debugbase_info
{
public:
@ -159,4 +161,6 @@ private:
static bool s_window_class_registered;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DEBUGWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// disasmbasewininfo.c - Win32 debug window handling
// disasmbasewininfo.cpp - Win32 debug window handling
//
//============================================================
@ -20,6 +20,8 @@
//#include "winutf8.h"
namespace osd::debugger::win {
disasmbasewin_info::disasmbasewin_info(debugger_windows_interface &debugger, bool is_main_console, LPCSTR title, WNDPROC handler) :
editwin_info(debugger, is_main_console, title, handler)
{
@ -277,3 +279,5 @@ void disasmbasewin_info::save_configuration_to_node(util::xml::data_node &node)
editwin_info::save_configuration_to_node(node);
m_views[0]->save_configuration_to_node(node);
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "editwininfo.h"
namespace osd::debugger::win {
class disasmbasewin_info : public editwin_info
{
public:
@ -30,4 +32,6 @@ protected:
virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DISASMBASEWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// disasmviewinfo.c - Win32 debug window handling
// disasmviewinfo.cpp - Win32 debug window handling
//
//============================================================
@ -12,6 +12,8 @@
#include "util/xmlfile.h"
namespace osd::debugger::win {
disasmview_info::disasmview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent) :
debugview_info(debugger, owner, parent, DVT_DISASSEMBLY)
{
@ -56,7 +58,7 @@ void disasmview_info::set_right_column(disasm_right_column contents)
void disasmview_info::restore_configuration_from_node(util::xml::data_node const &node)
{
debug_view_disasm &dasmview(*view<debug_view_disasm>());
dasmview.set_right_column(disasm_right_column(node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column())));
dasmview.set_right_column(disasm_right_column(node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column())));
debugview_info::restore_configuration_from_node(node);
}
@ -67,5 +69,7 @@ void disasmview_info::save_configuration_to_node(util::xml::data_node &node)
debugview_info::save_configuration_to_node(node);
debug_view_disasm &dasmview(*view<debug_view_disasm>());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
}
} // namespace osd::debugger::win

View File

@ -17,6 +17,8 @@
#include "debug/dvdisasm.h"
namespace osd::debugger::win {
class disasmview_info : public debugview_info
{
public:
@ -34,4 +36,6 @@ public:
virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DISASMVIEWINFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// disasmwininfo.c - Win32 debug window handling
// disasmwininfo.cpp - Win32 debug window handling
//
//============================================================
@ -18,6 +18,8 @@
#include "winutf8.h"
namespace osd::debugger::win {
disasmwin_info::disasmwin_info(debugger_windows_interface &debugger) :
disasmbasewin_info(debugger, false, "Disassembly", nullptr),
m_combownd(nullptr)
@ -150,13 +152,13 @@ void disasmwin_info::update_caption()
void disasmwin_info::restore_configuration_from_node(util::xml::data_node const &node)
{
m_views[0]->set_source_index(node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_views[0]->source_index()));
m_views[0]->set_source_index(node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_views[0]->source_index()));
int const cursource = m_views[0]->source_index();
if (0 <= cursource)
SendMessage(m_combownd, CB_SETCURSEL, cursource, 0);
update_caption();
util::xml::data_node const *const expr = node.get_child(osd::debugger::NODE_WINDOW_EXPRESSION);
util::xml::data_node const *const expr = node.get_child(NODE_WINDOW_EXPRESSION);
if (expr && expr->get_value())
{
set_editwnd_text(expr->get_value());
@ -171,7 +173,9 @@ void disasmwin_info::save_configuration_to_node(util::xml::data_node &node)
{
disasmbasewin_info::save_configuration_to_node(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_views[0]->source_index());
node.add_child(osd::debugger::NODE_WINDOW_EXPRESSION, downcast<disasmview_info *>(m_views[0].get())->expression());
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_DISASSEMBLY_VIEWER);
node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_views[0]->source_index());
node.add_child(NODE_WINDOW_EXPRESSION, downcast<disasmview_info *>(m_views[0].get())->expression());
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "disasmbasewininfo.h"
namespace osd::debugger::win {
class disasmwin_info : public disasmbasewin_info
{
public:
@ -37,4 +39,6 @@ private:
HWND m_combownd;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_DISASMWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// editwininfo.c - Win32 debug window handling
// editwininfo.cpp - Win32 debug window handling
//
//============================================================
@ -17,6 +17,8 @@
#include "winutil.h"
namespace osd::debugger::win {
namespace {
constexpr DWORD EDIT_BOX_STYLE = WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL;
@ -241,3 +243,5 @@ LRESULT CALLBACK editwin_info::static_edit_proc(HWND wnd, UINT message, WPARAM w
assert(info->m_editwnd == wnd);
return info->edit_proc(message, wparam, lparam);
}
} // namespace osd::debugger::win

View File

@ -18,6 +18,8 @@
#include <string>
namespace osd::debugger::win {
class editwin_info : public debugwin_info
{
public:
@ -55,4 +57,6 @@ private:
int m_last_history;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_EDITWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Samuele Zannoli
//============================================================
//
// logviewinfo.c - Win32 debug log window handling
// logviewinfo.cpp - Win32 debug log window handling
//
//============================================================
@ -12,6 +12,8 @@
#include "debug/dvtext.h"
namespace osd::debugger::win {
logview_info::logview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent) :
debugview_info(debugger, owner, parent, DVT_LOG)
{
@ -27,3 +29,5 @@ void logview_info::clear()
{
view<debug_view_log>()->clear();
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "debugviewinfo.h"
namespace osd::debugger::win {
class logview_info : public debugview_info
{
public:
@ -24,4 +26,6 @@ public:
void clear();
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_LOGVIEWINFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// logwininfo.c - Win32 debug window handling
// logwininfo.cpp - Win32 debug window handling
//
//============================================================
@ -15,6 +15,8 @@
#include "util/xmlfile.h"
namespace osd::debugger::win {
logwin_info::logwin_info(debugger_windows_interface &debugger) :
debugwin_info(debugger, false, std::string("Errorlog: ").append(debugger.machine().system().type.fullname()).append(" [").append(debugger.machine().system().name).append("]").c_str(), nullptr)
{
@ -70,5 +72,7 @@ bool logwin_info::handle_command(WPARAM wparam, LPARAM lparam)
void logwin_info::save_configuration_to_node(util::xml::data_node &node)
{
debugwin_info::save_configuration_to_node(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_ERROR_LOG_VIEWER);
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "debugwininfo.h"
namespace osd::debugger::win {
class logwin_info : public debugwin_info
{
public:
@ -26,4 +28,6 @@ protected:
virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
#endif
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_LOGWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// memoryviewinfo.c - Win32 debug window handling
// memoryviewinfo.cpp - Win32 debug window handling
//
//============================================================
@ -14,6 +14,8 @@
#include "strconv.h"
namespace osd::debugger::win {
memoryview_info::memoryview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent) :
debugview_info(debugger, owner, parent, DVT_MEMORY)
{
@ -94,11 +96,11 @@ void memoryview_info::set_address_radix(int radix)
void memoryview_info::restore_configuration_from_node(util::xml::data_node const &node)
{
debug_view_memory &memview(*view<debug_view_memory>());
memview.set_reverse(0 != node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memview.reverse() ? 1 : 0));
memview.set_physical(0 != node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_MODE, memview.physical() ? 1 : 0));
memview.set_address_radix(node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memview.address_radix()));
memview.set_data_format(debug_view_memory::data_format(node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memview.get_data_format()))));
memview.set_chunks_per_row(node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ROW_CHUNKS, memview.chunks_per_row()));
memview.set_reverse(0 != node.get_attribute_int(ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memview.reverse() ? 1 : 0));
memview.set_physical(0 != node.get_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_MODE, memview.physical() ? 1 : 0));
memview.set_address_radix(node.get_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memview.address_radix()));
memview.set_data_format(debug_view_memory::data_format(node.get_attribute_int(ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memview.get_data_format()))));
memview.set_chunks_per_row(node.get_attribute_int(ATTR_WINDOW_MEMORY_ROW_CHUNKS, memview.chunks_per_row()));
debugview_info::restore_configuration_from_node(node);
}
@ -109,11 +111,11 @@ void memoryview_info::save_configuration_to_node(util::xml::data_node &node)
debugview_info::save_configuration_to_node(node);
debug_view_memory &memview(*view<debug_view_memory>());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memview.reverse() ? 1 : 0);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_MODE, memview.physical() ? 1 : 0);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memview.address_radix());
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memview.get_data_format()));
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ROW_CHUNKS, memview.chunks_per_row());
node.set_attribute_int(ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, memview.reverse() ? 1 : 0);
node.set_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_MODE, memview.physical() ? 1 : 0);
node.set_attribute_int(ATTR_WINDOW_MEMORY_ADDRESS_RADIX, memview.address_radix());
node.set_attribute_int(ATTR_WINDOW_MEMORY_DATA_FORMAT, int(memview.get_data_format()));
node.set_attribute_int(ATTR_WINDOW_MEMORY_ROW_CHUNKS, memview.chunks_per_row());
}
@ -201,3 +203,5 @@ void memoryview_info::handle_context_menu(unsigned command)
};
}
} // namespace osd::debugger::win

View File

@ -18,6 +18,8 @@
#include <string>
namespace osd::debugger::win {
class memoryview_info : public debugview_info
{
public:
@ -55,4 +57,6 @@ private:
std::string m_lastpc;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_MEMORYVIEWINFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// memorywininfo.c - Win32 debug window handling
// memorywininfo.cpp - Win32 debug window handling
//
//============================================================
@ -18,6 +18,8 @@
#include "winutf8.h"
namespace osd::debugger::win {
memorywin_info::memorywin_info(debugger_windows_interface &debugger) :
editwin_info(debugger, false, "Memory", nullptr),
m_combownd(nullptr)
@ -394,13 +396,13 @@ void memorywin_info::update_caption()
void memorywin_info::restore_configuration_from_node(util::xml::data_node const &node)
{
m_views[0]->set_source_index(node.get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, m_views[0]->source_index()));
m_views[0]->set_source_index(node.get_attribute_int(ATTR_WINDOW_MEMORY_REGION, m_views[0]->source_index()));
int const cursource = m_views[0]->source_index();
if (0 <= cursource)
SendMessage(m_combownd, CB_SETCURSEL, cursource, 0);
update_caption();
util::xml::data_node const *const expr = node.get_child(osd::debugger::NODE_WINDOW_EXPRESSION);
util::xml::data_node const *const expr = node.get_child(NODE_WINDOW_EXPRESSION);
if (expr && expr->get_value())
{
set_editwnd_text(expr->get_value());
@ -417,8 +419,10 @@ void memorywin_info::save_configuration_to_node(util::xml::data_node &node)
{
editwin_info::save_configuration_to_node(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_MEMORY_VIEWER);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, m_views[0]->source_index());
node.add_child(osd::debugger::NODE_WINDOW_EXPRESSION, downcast<memoryview_info *>(m_views[0].get())->expression());
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_MEMORY_VIEWER);
node.set_attribute_int(ATTR_WINDOW_MEMORY_REGION, m_views[0]->source_index());
node.add_child(NODE_WINDOW_EXPRESSION, downcast<memoryview_info *>(m_views[0].get())->expression());
m_views[0]->save_configuration_to_node(node);
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "editwininfo.h"
namespace osd::debugger::win {
class memorywin_info : public editwin_info
{
public:
@ -39,4 +41,6 @@ private:
HWND m_combownd;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_MEMORYWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// pointswininfo.c - Win32 debug window handling
// pointswininfo.cpp - Win32 debug window handling
//
//============================================================
@ -16,6 +16,8 @@
#include "winutf8.h"
namespace osd::debugger::win {
pointswin_info::pointswin_info(debugger_windows_interface &debugger) :
debugwin_info(debugger, false, std::string("All Breakpoints").c_str(), nullptr)
{
@ -137,7 +139,7 @@ bool pointswin_info::handle_command(WPARAM wparam, LPARAM lparam)
void pointswin_info::restore_configuration_from_node(util::xml::data_node const &node)
{
switch (node.get_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, -1))
switch (node.get_attribute_int(ATTR_WINDOW_POINTS_TYPE, -1))
{
case 0:
SendMessage(window(), WM_COMMAND, ID_SHOW_BREAKPOINTS, 0);
@ -158,19 +160,21 @@ void pointswin_info::save_configuration_to_node(util::xml::data_node &node)
{
debugwin_info::save_configuration_to_node(node);
node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_POINTS_VIEWER);
node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_POINTS_VIEWER);
switch (m_views[0]->type())
{
case DVT_BREAK_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 0);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 0);
break;
case DVT_WATCH_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 1);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 1);
break;
case DVT_REGISTER_POINTS:
node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 2);
node.set_attribute_int(ATTR_WINDOW_POINTS_TYPE, 2);
break;
default:
break;
}
}
} // namespace osd::debugger::win

View File

@ -15,6 +15,8 @@
#include "debugwininfo.h"
namespace osd::debugger::win {
class pointswin_info : public debugwin_info
{
public:
@ -30,4 +32,6 @@ protected:
virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_POINTSWININFO_H

View File

@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, Vas Crabb
//============================================================
//
// uimetrics.c - Win32 debug window handling
// uimetrics.cpp - Win32 debug window handling
//
//============================================================
@ -16,6 +16,8 @@
#include <algorithm>
namespace osd::debugger::win {
COLORREF const ui_metrics::s_themes[][COLOR_COUNT] = {
{
RGB(0x00, 0x00, 0x00), // foreground normal
@ -154,3 +156,5 @@ void ui_metrics::set_color_theme(int index)
m_color_theme = index;
}
}
} // namespace osd::debugger::win

View File

@ -17,6 +17,8 @@
#include <utility>
namespace osd::debugger::win {
class ui_metrics
{
public:
@ -74,4 +76,6 @@ private:
static COLORREF const s_themes[][COLOR_COUNT];
};
} // namespace osd::debugger::win
#endif // MAME_DEBUGGER_WIN_UIMETRICS_H