summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-09-16 22:09:58 +1000
committer Vas Crabb <vas@vastheman.com>2022-09-16 22:23:34 +1000
commitc76cf754b3cb1a07f8d3ca585bb3a055d78f25be (patch)
tree833fa7b23f8a84a79fd052008a6ad7c3847b46da /src/osd
parent1aae44005b59aa712fb60f639ddbb9e8e5e7a357 (diff)
debugger/win: Added capability to save/restore window arrangement.
* Format is mostly compatible with the Cocoa debugger, besides reversed vertical positioning. * Made Qt debugger more compatible with configuration format used by Win32 and Cocoa debuggers. * emu/config.cpp: Preserve elements with no registered handlers in default and system configuation files.
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/debugger/debug_module.h8
-rw-r--r--src/osd/modules/debugger/debugqt.cpp9
-rw-r--r--src/osd/modules/debugger/debugwin.cpp103
-rw-r--r--src/osd/modules/debugger/osx/debugconsole.mm32
-rw-r--r--src/osd/modules/debugger/osx/debugosx.h35
-rw-r--r--src/osd/modules/debugger/osx/debugview.mm28
-rw-r--r--src/osd/modules/debugger/osx/debugwindowhandler.h13
-rw-r--r--src/osd/modules/debugger/osx/debugwindowhandler.mm22
-rw-r--r--src/osd/modules/debugger/osx/deviceinfoviewer.mm2
-rw-r--r--src/osd/modules/debugger/osx/devicesviewer.mm2
-rw-r--r--src/osd/modules/debugger/osx/disassemblyview.mm4
-rw-r--r--src/osd/modules/debugger/osx/disassemblyviewer.mm6
-rw-r--r--src/osd/modules/debugger/osx/errorlogviewer.mm2
-rw-r--r--src/osd/modules/debugger/osx/memoryview.mm18
-rw-r--r--src/osd/modules/debugger/osx/memoryviewer.mm6
-rw-r--r--src/osd/modules/debugger/osx/pointsviewer.mm6
-rw-r--r--src/osd/modules/debugger/qt/breakpointswindow.cpp6
-rw-r--r--src/osd/modules/debugger/qt/dasmwindow.cpp23
-rw-r--r--src/osd/modules/debugger/qt/deviceinformationwindow.cpp10
-rw-r--r--src/osd/modules/debugger/qt/deviceswindow.cpp4
-rw-r--r--src/osd/modules/debugger/qt/logwindow.cpp6
-rw-r--r--src/osd/modules/debugger/qt/mainwindow.cpp6
-rw-r--r--src/osd/modules/debugger/qt/memorywindow.cpp118
-rw-r--r--src/osd/modules/debugger/qt/windowqt.cpp28
-rw-r--r--src/osd/modules/debugger/qt/windowqt.h2
-rw-r--r--src/osd/modules/debugger/win/consolewininfo.cpp14
-rw-r--r--src/osd/modules/debugger/win/consolewininfo.h1
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.cpp65
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.h4
-rw-r--r--src/osd/modules/debugger/win/debugwin.h2
-rw-r--r--src/osd/modules/debugger/win/debugwininfo.cpp106
-rw-r--r--src/osd/modules/debugger/win/debugwininfo.h13
-rw-r--r--src/osd/modules/debugger/win/disasmbasewininfo.cpp20
-rw-r--r--src/osd/modules/debugger/win/disasmbasewininfo.h2
-rw-r--r--src/osd/modules/debugger/win/disasmviewinfo.cpp26
-rw-r--r--src/osd/modules/debugger/win/disasmviewinfo.h4
-rw-r--r--src/osd/modules/debugger/win/disasmwininfo.cpp32
-rw-r--r--src/osd/modules/debugger/win/disasmwininfo.h3
-rw-r--r--src/osd/modules/debugger/win/logwininfo.cpp9
-rw-r--r--src/osd/modules/debugger/win/logwininfo.h1
-rw-r--r--src/osd/modules/debugger/win/memoryviewinfo.cpp34
-rw-r--r--src/osd/modules/debugger/win/memoryviewinfo.h4
-rw-r--r--src/osd/modules/debugger/win/memorywininfo.cpp34
-rw-r--r--src/osd/modules/debugger/win/memorywininfo.h4
-rw-r--r--src/osd/modules/debugger/win/pointswininfo.cpp43
-rw-r--r--src/osd/modules/debugger/win/pointswininfo.h4
-rw-r--r--src/osd/modules/debugger/win/uimetrics.h2
-rw-r--r--src/osd/modules/debugger/xmlconfig.cpp45
-rw-r--r--src/osd/modules/debugger/xmlconfig.h63
49 files changed, 825 insertions, 209 deletions
diff --git a/src/osd/modules/debugger/debug_module.h b/src/osd/modules/debugger/debug_module.h
index fb659a1b312..9e3d85f9fe8 100644
--- a/src/osd/modules/debugger/debug_module.h
+++ b/src/osd/modules/debugger/debug_module.h
@@ -5,8 +5,10 @@
*
*/
-#ifndef DEBUG_MODULE_H_
-#define DEBUG_MODULE_H_
+#ifndef MAME_OSD_DEBUGGER_DEBUG_MODULE_H
+#define MAME_OSD_DEBUGGER_DEBUG_MODULE_H
+
+#pragma once
#include "osdepend.h"
#include "modules/osdmodule.h"
@@ -30,4 +32,4 @@ public:
-#endif /* DEBUG_MODULE_H_ */
+#endif // MAME_OSD_DEBUGGER_DEBUG_MODULE_H
diff --git a/src/osd/modules/debugger/debugqt.cpp b/src/osd/modules/debugger/debugqt.cpp
index a48f419a6a3..dbc638d354a 100644
--- a/src/osd/modules/debugger/debugqt.cpp
+++ b/src/osd/modules/debugger/debugqt.cpp
@@ -32,6 +32,9 @@
#include "qt/deviceswindow.h"
#include "qt/deviceinformationwindow.h"
+#include "util/xmlfile.h"
+
+
class debug_qt : public osd_module, public debug_module
#if defined(_WIN32) && !defined(SDLMAME_WIN32)
, public QAbstractNativeEventFilter
@@ -89,9 +92,9 @@ void xml_configuration_load(running_machine &machine, config_type cfg_type, conf
// Configuration load
util::xml::data_node const *wnode = nullptr;
- for (wnode = parentnode->get_child("window"); wnode; wnode = wnode->get_next_sibling("window"))
+ for (wnode = parentnode->get_child(osd::debugger::NODE_WINDOW); wnode; wnode = wnode->get_next_sibling(osd::debugger::NODE_WINDOW))
{
- WindowQtConfig::WindowType type = (WindowQtConfig::WindowType)wnode->get_attribute_int("type", WindowQtConfig::WIN_TYPE_UNKNOWN);
+ WindowQtConfig::WindowType type = (WindowQtConfig::WindowType)wnode->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, WindowQtConfig::WIN_TYPE_UNKNOWN);
switch (type)
{
case WindowQtConfig::WIN_TYPE_MAIN: xmlConfigurations.push_back(std::make_unique<MainWindowQtConfig>()); break;
@@ -119,7 +122,7 @@ void xml_configuration_save(running_machine &machine, config_type cfg_type, util
WindowQtConfig &config = *xmlConfigurations[i];
// Create an xml node
- util::xml::data_node *const debugger_node = parentnode->add_child("window", nullptr);
+ util::xml::data_node *const debugger_node = parentnode->add_child(osd::debugger::NODE_WINDOW, nullptr);
// Insert the appropriate information
if (debugger_node)
diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp
index 18bbc07dd70..19e95b0313e 100644
--- a/src/osd/modules/debugger/debugwin.cpp
+++ b/src/osd/modules/debugger/debugwin.cpp
@@ -22,9 +22,12 @@
#include "win/pointswininfo.h"
#include "win/uimetrics.h"
+#include "config.h"
#include "debugger.h"
#include "debug/debugcpu.h"
+#include "util/xmlfile.h"
+
#include "window.h"
#include "../input/input_common.h"
#include "../input/input_windows.h"
@@ -73,11 +76,18 @@ protected:
private:
template <typename T> T *create_window();
+ void config_load(config_type cfgtype, config_level cfglevel, util::xml::data_node const *parentnode);
+ void config_save(config_type cfgtype, util::xml::data_node *parentnode);
+
+ 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;
+
+ util::xml::file::ptr m_config;
};
@@ -97,22 +107,32 @@ void debugger_windows::init_debugger(running_machine &machine)
{
m_machine = &machine;
m_metrics = std::make_unique<ui_metrics>(downcast<osd_options &>(m_machine->options()));
+ machine.configuration().config_register(
+ "debugger",
+ configuration_manager::load_delegate(&debugger_windows::config_load, this),
+ configuration_manager::save_delegate(&debugger_windows::config_save, this));
}
void debugger_windows::wait_for_debugger(device_t &device, bool firststop)
{
// create a console window
- if (m_main_console == nullptr)
+ if (!m_main_console)
m_main_console = create_window<consolewin_info>();
// update the views in the console to reflect the current CPU
- if (m_main_console != nullptr)
+ if (m_main_console)
m_main_console->set_cpu(device);
// when we are first stopped, adjust focus to us
- if (firststop && (m_main_console != nullptr))
+ if (firststop && m_main_console)
{
+ if (m_config)
+ {
+ for (util::xml::data_node const *node = m_config->get_first_child(); node; node = node->get_next_sibling())
+ load_configuration(*node);
+ m_config.reset();
+ }
m_main_console->set_foreground();
if (winwindow_has_focus())
m_main_console->set_default_focus();
@@ -247,21 +267,90 @@ void debugger_windows::hide_all()
}
-template <typename T> T *debugger_windows::create_window()
+template <typename T>
+T *debugger_windows::create_window()
{
// allocate memory
std::unique_ptr<T> info = std::make_unique<T>(static_cast<debugger_windows_interface &>(*this));
if (info->is_valid())
{
+ T &result(*info);
m_window_list.push_back(std::move(info));
- T *ptr = dynamic_cast<T*>(m_window_list.back().get());
- return ptr;
+ return &result;
}
return nullptr;
}
-#else /* not windows */
+void debugger_windows::config_load(config_type cfgtype, config_level cfglevel, util::xml::data_node const *parentnode)
+{
+ if (parentnode)
+ {
+ if (config_type::SYSTEM == cfgtype)
+ {
+ if (m_main_console)
+ {
+ load_configuration(*parentnode);
+ }
+ else
+ {
+ if (!m_config)
+ m_config = util::xml::file::create();
+ parentnode->copy_into(*m_config);
+ }
+ }
+ }
+}
+
+
+void debugger_windows::config_save(config_type cfgtype, util::xml::data_node *parentnode)
+{
+ if (config_type::SYSTEM == cfgtype)
+ {
+ for (auto &info : m_window_list)
+ info->save_configuration(*parentnode);
+ }
+}
+
+
+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;
+ 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>();
+ break;
+ case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER:
+ win = create_window<disasmwin_info>();
+ break;
+ case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER:
+ win = create_window<logwin_info>();
+ break;
+ case osd::debugger::WINDOW_TYPE_POINTS_VIEWER:
+ win = create_window<pointswin_info>();
+ break;
+ case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER:
+ // not supported
+ break;
+ case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER:
+ // not supported
+ break;
+ default:
+ break;
+ }
+ if (win)
+ win->restore_configuration_from_node(*node);
+ }
+}
+
+
+#else // not Windows
MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows")
#endif
diff --git a/src/osd/modules/debugger/osx/debugconsole.mm b/src/osd/modules/debugger/osx/debugconsole.mm
index c1689a8b855..f6d01375403 100644
--- a/src/osd/modules/debugger/osx/debugconsole.mm
+++ b/src/osd/modules/debugger/osx/debugconsole.mm
@@ -380,30 +380,30 @@
- (void)loadConfiguration:(util::xml::data_node const *)parentnode {
util::xml::data_node const *node = nullptr;
- for (node = parentnode->get_child("window"); node; node = node->get_next_sibling("window"))
+ for (node = parentnode->get_child(osd::debugger::NODE_WINDOW); node; node = node->get_next_sibling(osd::debugger::NODE_WINDOW))
{
MAMEDebugWindowHandler *win = nil;
- switch (node->get_attribute_int("type", -1))
+ switch (node->get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, -1))
{
- case MAME_DEBUGGER_WINDOW_TYPE_CONSOLE:
+ case osd::debugger::WINDOW_TYPE_CONSOLE:
[self restoreConfigurationFromNode:node];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER:
+ case osd::debugger::WINDOW_TYPE_MEMORY_VIEWER:
win = [[MAMEMemoryViewer alloc] initWithMachine:*machine console:self];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER:
+ case osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER:
win = [[MAMEDisassemblyViewer alloc] initWithMachine:*machine console:self];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER:
+ case osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER:
win = [[MAMEErrorLogViewer alloc] initWithMachine:*machine console:self];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER:
+ case osd::debugger::WINDOW_TYPE_POINTS_VIEWER:
win = [[MAMEPointsViewer alloc] initWithMachine:*machine console:self];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER:
+ case osd::debugger::WINDOW_TYPE_DEVICES_VIEWER:
win = [[MAMEDevicesViewer alloc] initWithMachine:*machine console:self];
break;
- case MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER:
+ case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER:
// FIXME: needs device info on init, make another variant
//win = [[MAMEDeviceInfoViewer alloc] initWithMachine:*machine console:self];
break;
@@ -423,15 +423,15 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_CONSOLE);
- util::xml::data_node *const splits = node->add_child("splits", nullptr);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_CONSOLE);
+ util::xml::data_node *const splits = node->add_child(osd::debugger::NODE_WINDOW_SPLITS, nullptr);
if (splits)
{
- splits->set_attribute_float("state",
+ splits->set_attribute_float(osd::debugger::ATTR_SPLITS_CONSOLE_STATE,
[regSplit isSubviewCollapsed:[[regSplit subviews] objectAtIndex:0]]
? 0.0
: NSMaxX([[[regSplit subviews] objectAtIndex:0] frame]));
- splits->set_attribute_float("disassembly",
+ splits->set_attribute_float(osd::debugger::ATTR_SPLITS_CONSOLE_DISASSEMBLY,
[dasmSplit isSubviewCollapsed:[[dasmSplit subviews] objectAtIndex:0]]
? 0.0
: NSMaxY([[[dasmSplit subviews] objectAtIndex:0] frame]));
@@ -442,12 +442,12 @@
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
- util::xml::data_node const *const splits = node->get_child("splits");
+ util::xml::data_node const *const splits = node->get_child(osd::debugger::NODE_WINDOW_SPLITS);
if (splits)
{
- [regSplit setPosition:splits->get_attribute_float("state", NSMaxX([[[regSplit subviews] objectAtIndex:0] frame]))
+ [regSplit setPosition:splits->get_attribute_float(osd::debugger::ATTR_SPLITS_CONSOLE_STATE, NSMaxX([[[regSplit subviews] objectAtIndex:0] frame]))
ofDividerAtIndex:0];
- [dasmSplit setPosition:splits->get_attribute_float("disassembly", NSMaxY([[[dasmSplit subviews] objectAtIndex:0] frame]))
+ [dasmSplit setPosition:splits->get_attribute_float(osd::debugger::ATTR_SPLITS_CONSOLE_DISASSEMBLY, NSMaxY([[[dasmSplit subviews] objectAtIndex:0] frame]))
ofDividerAtIndex:0];
}
[dasmView restoreConfigurationFromNode:node];
diff --git a/src/osd/modules/debugger/osx/debugosx.h b/src/osd/modules/debugger/osx/debugosx.h
index 9d48402c032..6e0a47089d9 100644
--- a/src/osd/modules/debugger/osx/debugosx.h
+++ b/src/osd/modules/debugger/osx/debugosx.h
@@ -6,8 +6,13 @@
//
//============================================================
-#ifndef __SDL_DEBUGOSX__
-#define __SDL_DEBUGOSX__
+#ifndef MAME_OSD_DEBUGGER_OSX_DEBUGOSX_H
+#define MAME_OSD_DEBUGGER_OSX_DEBUGOSX_H
+
+#pragma once
+
+#include "../xmlconfig.h"
+
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
@@ -20,30 +25,6 @@
// standard Cocoa headers
#import <Cocoa/Cocoa.h>
-// workarounds for 10.6 warnings
-#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
-@protocol NSWindowDelegate <NSObject>
-@end
-
-@protocol NSSplitViewDelegate <NSObject>
-@end
-
-@protocol NSControlTextEditingDelegate <NSObject>
-@end
-
-@protocol NSTextFieldDelegate <NSControlTextEditingDelegate>
-@end
-
-@protocol NSOutlineViewDataSource <NSObject>
-@end
-
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED
-
#endif // __OBJC__
-#endif // __SDL_DEBUGOSX__
+#endif // MAME_OSD_DEBUGGER_OSX_DEBUGOSX_H
diff --git a/src/osd/modules/debugger/osx/debugview.mm b/src/osd/modules/debugger/osx/debugview.mm
index 8853be80622..aae93622f6c 100644
--- a/src/osd/modules/debugger/osx/debugview.mm
+++ b/src/osd/modules/debugger/osx/debugview.mm
@@ -493,22 +493,22 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
if (view->cursor_supported())
{
- util::xml::data_node *const selection = node->add_child("selection", nullptr);
+ util::xml::data_node *const selection = node->add_child(osd::debugger::NODE_WINDOW_SELECTION, nullptr);
if (selection)
{
debug_view_xy const pos = view->cursor_position();
- selection->set_attribute_int("visible", view->cursor_visible() ? 1 : 0);
- selection->set_attribute_int("start_x", pos.x);
- selection->set_attribute_int("start_y", pos.y);
+ selection->set_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_VISIBLE, 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);
}
}
- util::xml::data_node *const scroll = node->add_child("scroll", nullptr);
+ util::xml::data_node *const scroll = node->add_child(osd::debugger::NODE_WINDOW_SCROLL, nullptr);
if (scroll)
{
NSRect const visible = [self visibleRect];
- scroll->set_attribute_float("position_x", visible.origin.x);
- scroll->set_attribute_float("position_y", visible.origin.y);
+ scroll->set_attribute_float(osd::debugger::ATTR_SCROLL_ORIGIN_X, visible.origin.x);
+ scroll->set_attribute_float(osd::debugger::ATTR_SCROLL_ORIGIN_Y, visible.origin.y);
}
}
@@ -516,23 +516,23 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
if (view->cursor_supported())
{
- util::xml::data_node const *const selection = node->get_child("selection");
+ util::xml::data_node const *const selection = node->get_child(osd::debugger::NODE_WINDOW_SELECTION);
if (selection)
{
debug_view_xy pos = view->cursor_position();
- view->set_cursor_visible(0 != selection->get_attribute_int("visible", view->cursor_visible() ? 1 : 0));
- pos.x = selection->get_attribute_int("start_x", pos.x);
- pos.y = selection->get_attribute_int("start_y", pos.y);
+ view->set_cursor_visible(0 != selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_VISIBLE, view->cursor_visible() ? 1 : 0));
+ pos.x = selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_X, pos.x);
+ pos.y = selection->get_attribute_int(osd::debugger::ATTR_SELECTION_CURSOR_Y, pos.y);
view->set_cursor_position(pos);
}
}
- util::xml::data_node const *const scroll = node->get_child("scroll");
+ util::xml::data_node const *const scroll = node->get_child(osd::debugger::NODE_WINDOW_SCROLL);
if (scroll)
{
NSRect visible = [self visibleRect];
- visible.origin.x = scroll->get_attribute_float("position_x", visible.origin.x);
- visible.origin.y = scroll->get_attribute_float("position_y", visible.origin.y);
+ visible.origin.x = scroll->get_attribute_float(osd::debugger::ATTR_SCROLL_ORIGIN_X, visible.origin.x);
+ visible.origin.y = scroll->get_attribute_float(osd::debugger::ATTR_SCROLL_ORIGIN_Y, visible.origin.y);
[self scrollRectToVisible:visible];
}
}
diff --git a/src/osd/modules/debugger/osx/debugwindowhandler.h b/src/osd/modules/debugger/osx/debugwindowhandler.h
index c48bbb031b2..00c7327f2ba 100644
--- a/src/osd/modules/debugger/osx/debugwindowhandler.h
+++ b/src/osd/modules/debugger/osx/debugwindowhandler.h
@@ -23,19 +23,6 @@ extern NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification;
extern NSString *const MAMESaveDebuggerConfigurationNotification;
-// for compatibility with the Qt debugger
-enum
-{
- MAME_DEBUGGER_WINDOW_TYPE_CONSOLE = 1,
- MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER,
- MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER,
- MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER,
- MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER,
- MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER,
- MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER
-};
-
-
@interface MAMEDebugWindowHandler : NSObject <NSWindowDelegate>
{
NSWindow *window;
diff --git a/src/osd/modules/debugger/osx/debugwindowhandler.mm b/src/osd/modules/debugger/osx/debugwindowhandler.mm
index ec79887e308..ebeb1711dc4 100644
--- a/src/osd/modules/debugger/osx/debugwindowhandler.mm
+++ b/src/osd/modules/debugger/osx/debugwindowhandler.mm
@@ -276,7 +276,7 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
if (m == machine)
{
util::xml::data_node *parentnode = (util::xml::data_node *)[[[notification userInfo] objectForKey:@"MAMEDebugParentNode"] pointerValue];
- util::xml::data_node *node = parentnode->add_child("window", nullptr);
+ util::xml::data_node *node = parentnode->add_child(osd::debugger::NODE_WINDOW, nullptr);
if (node)
[self saveConfigurationToNode:node];
}
@@ -285,19 +285,19 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
NSRect frame = [window frame];
- node->set_attribute_float("position_x", frame.origin.x);
- node->set_attribute_float("position_y", frame.origin.y);
- node->set_attribute_float("size_x", frame.size.width);
- node->set_attribute_float("size_y", frame.size.height);
+ node->set_attribute_float(osd::debugger::ATTR_WINDOW_POSITION_X, frame.origin.x);
+ node->set_attribute_float(osd::debugger::ATTR_WINDOW_POSITION_Y, frame.origin.y);
+ node->set_attribute_float(osd::debugger::ATTR_WINDOW_WIDTH, frame.size.width);
+ node->set_attribute_float(osd::debugger::ATTR_WINDOW_HEIGHT, frame.size.height);
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
NSRect frame = [window frame];
- frame.origin.x = node->get_attribute_float("position_x", frame.origin.x);
- frame.origin.y = node->get_attribute_float("position_y", frame.origin.y);
- frame.size.width = node->get_attribute_float("size_x", frame.size.width);
- frame.size.height = node->get_attribute_float("size_y", frame.size.height);
+ frame.origin.x = node->get_attribute_float(osd::debugger::ATTR_WINDOW_POSITION_X, frame.origin.x);
+ frame.origin.y = node->get_attribute_float(osd::debugger::ATTR_WINDOW_POSITION_Y, frame.origin.y);
+ frame.size.width = node->get_attribute_float(osd::debugger::ATTR_WINDOW_WIDTH, frame.size.width);
+ frame.size.height = node->get_attribute_float(osd::debugger::ATTR_WINDOW_HEIGHT, frame.size.height);
NSSize min = [window minSize];
frame.size.width = std::max(frame.size.width, min.width);
@@ -493,13 +493,13 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->add_child("expression", [[self expression] UTF8String]);
+ node->add_child(osd::debugger::NODE_WINDOW_EXPRESSION, [[self expression] UTF8String]);
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
- util::xml::data_node const *const expr = node->get_child("expression");
+ util::xml::data_node const *const expr = node->get_child(osd::debugger::NODE_WINDOW_EXPRESSION);
if (expr && expr->get_value())
[self setExpression:[NSString stringWithUTF8String:expr->get_value()]];
}
diff --git a/src/osd/modules/debugger/osx/deviceinfoviewer.mm b/src/osd/modules/debugger/osx/deviceinfoviewer.mm
index 61fdd8c8613..e23110308ba 100644
--- a/src/osd/modules/debugger/osx/deviceinfoviewer.mm
+++ b/src/osd/modules/debugger/osx/deviceinfoviewer.mm
@@ -237,7 +237,7 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER);
}
@end
diff --git a/src/osd/modules/debugger/osx/devicesviewer.mm b/src/osd/modules/debugger/osx/devicesviewer.mm
index 23dba724b9d..0ec4047ec63 100644
--- a/src/osd/modules/debugger/osx/devicesviewer.mm
+++ b/src/osd/modules/debugger/osx/devicesviewer.mm
@@ -185,7 +185,7 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DEVICES_VIEWER);
}
diff --git a/src/osd/modules/debugger/osx/disassemblyview.mm b/src/osd/modules/debugger/osx/disassemblyview.mm
index 2e230c27e1c..0f703d8c7f1 100644
--- a/src/osd/modules/debugger/osx/disassemblyview.mm
+++ b/src/osd/modules/debugger/osx/disassemblyview.mm
@@ -274,14 +274,14 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
debug_view_disasm *const dasmView = downcast<debug_view_disasm *>(view);
- node->set_attribute_int("rightbar", dasmView->right_column());
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmView->right_column());
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
debug_view_disasm *const dasmView = downcast<debug_view_disasm *>(view);
- dasmView->set_right_column((disasm_right_column)node->get_attribute_int("rightbar", dasmView->right_column()));
+ dasmView->set_right_column((disasm_right_column)node->get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmView->right_column()));
}
@end
diff --git a/src/osd/modules/debugger/osx/disassemblyviewer.mm b/src/osd/modules/debugger/osx/disassemblyviewer.mm
index 64d665a31cb..97e23c9a0cd 100644
--- a/src/osd/modules/debugger/osx/disassemblyviewer.mm
+++ b/src/osd/modules/debugger/osx/disassemblyviewer.mm
@@ -232,15 +232,15 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER);
- node->set_attribute_int("cpu", [dasmView selectedSubviewIndex]);
+ 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, [dasmView selectedSubviewIndex]);
[dasmView saveConfigurationToNode:node];
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
- int const region = node->get_attribute_int("cpu", [dasmView selectedSubviewIndex]);
+ int const region = node->get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, [dasmView selectedSubviewIndex]);
[dasmView selectSubviewAtIndex:region];
[window setTitle:[NSString stringWithFormat:@"Disassembly: %@", [dasmView selectedSubviewName]]];
[subviewButton selectItemAtIndex:[subviewButton indexOfItemWithTag:[dasmView selectedSubviewIndex]]];
diff --git a/src/osd/modules/debugger/osx/errorlogviewer.mm b/src/osd/modules/debugger/osx/errorlogviewer.mm
index 1fd12c9c9c1..3b1a58f485b 100644
--- a/src/osd/modules/debugger/osx/errorlogviewer.mm
+++ b/src/osd/modules/debugger/osx/errorlogviewer.mm
@@ -64,7 +64,7 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_ERROR_LOG_VIEWER);
}
@end
diff --git a/src/osd/modules/debugger/osx/memoryview.mm b/src/osd/modules/debugger/osx/memoryview.mm
index 03055bd7daf..24521e81ba4 100644
--- a/src/osd/modules/debugger/osx/memoryview.mm
+++ b/src/osd/modules/debugger/osx/memoryview.mm
@@ -212,20 +212,22 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
debug_view_memory *const memView = downcast<debug_view_memory *>(view);
- node->set_attribute_int("reverse", memView->reverse() ? 1 : 0);
- node->set_attribute_int("addressmode", memView->physical() ? 1 : 0);
- node->set_attribute_int("dataformat", int(memView->get_data_format()));
- node->set_attribute_int("rowchunks", memView->chunks_per_row());
+ 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->get_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());
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
debug_view_memory *const memView = downcast<debug_view_memory *>(view);
- memView->set_reverse(0 != node->get_attribute_int("reverse", memView->reverse() ? 1 : 0));
- memView->set_physical(0 != node->get_attribute_int("addressmode", memView->physical() ? 1 : 0));
- memView->set_data_format(debug_view_memory::data_format(node->get_attribute_int("dataformat", int(memView->get_data_format()))));
- memView->set_chunks_per_row(node->get_attribute_int("rowchunks", memView->chunks_per_row()));
+ 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()));
}
diff --git a/src/osd/modules/debugger/osx/memoryviewer.mm b/src/osd/modules/debugger/osx/memoryviewer.mm
index b1064aee69f..b9c38bbd4d2 100644
--- a/src/osd/modules/debugger/osx/memoryviewer.mm
+++ b/src/osd/modules/debugger/osx/memoryviewer.mm
@@ -178,15 +178,15 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER);
- node->set_attribute_int("memoryregion", [memoryView selectedSubviewIndex]);
+ 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, [memoryView selectedSubviewIndex]);
[memoryView saveConfigurationToNode:node];
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
- int const region = node->get_attribute_int("memoryregion", [memoryView selectedSubviewIndex]);
+ int const region = node->get_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, [memoryView selectedSubviewIndex]);
[memoryView selectSubviewAtIndex:region];
[window setTitle:[NSString stringWithFormat:@"Memory: %@", [memoryView selectedSubviewName]]];
[subviewButton selectItemAtIndex:[subviewButton indexOfItemWithTag:[memoryView selectedSubviewIndex]]];
diff --git a/src/osd/modules/debugger/osx/pointsviewer.mm b/src/osd/modules/debugger/osx/pointsviewer.mm
index 0399fb10d1b..215ad163087 100644
--- a/src/osd/modules/debugger/osx/pointsviewer.mm
+++ b/src/osd/modules/debugger/osx/pointsviewer.mm
@@ -172,14 +172,14 @@
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER);
- node->set_attribute_int("bwtype", [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_POINTS_VIEWER);
+ node->set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]);
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
- int const tab = node->get_attribute_int("bwtype", [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]);
+ int const tab = node->get_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, [tabs indexOfTabViewItem:[tabs selectedTabViewItem]]);
if ((0 <= tab) && ([tabs numberOfTabViewItems] > tab))
{
[subviewButton selectItemAtIndex:tab];
diff --git a/src/osd/modules/debugger/qt/breakpointswindow.cpp b/src/osd/modules/debugger/qt/breakpointswindow.cpp
index 6af8fe7ba36..3b71e22690d 100644
--- a/src/osd/modules/debugger/qt/breakpointswindow.cpp
+++ b/src/osd/modules/debugger/qt/breakpointswindow.cpp
@@ -6,6 +6,8 @@
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "util/xmlfile.h"
+
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QMenu>
@@ -140,12 +142,12 @@ void BreakpointsWindowQtConfig::applyToQWidget(QWidget* widget)
void BreakpointsWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute_int("bwtype", m_bwType);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, m_bwType);
}
void BreakpointsWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
- m_bwType = node.get_attribute_int("bwtype", m_bwType);
+ m_bwType = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, m_bwType);
}
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp
index 21e2520d712..d46ceb2d767 100644
--- a/src/osd/modules/debugger/qt/dasmwindow.cpp
+++ b/src/osd/modules/debugger/qt/dasmwindow.cpp
@@ -8,6 +8,8 @@
#include "debug/dvdisasm.h"
#include "debug/points.h"
+#include "util/xmlfile.h"
+
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QAction>
@@ -288,11 +290,11 @@ void DasmWindowQtConfig::buildFromQWidget(QWidget *widget)
QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
if (rightBarGroup->checkedAction()->text() == "Raw Opcodes")
- m_rightBar = 0;
+ m_rightBar = DASM_RIGHTCOL_RAW;
else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes")
- m_rightBar = 1;
+ m_rightBar = DASM_RIGHTCOL_ENCRYPTED;
else if (rightBarGroup->checkedAction()->text() == "Comments")
- m_rightBar = 2;
+ m_rightBar = DASM_RIGHTCOL_COMMENTS;
}
void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
@@ -302,20 +304,23 @@ void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
QComboBox *cpu = window->findChild<QComboBox *>("cpu");
cpu->setCurrentIndex(m_cpu);
- QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
- rightBarGroup->actions()[m_rightBar]->trigger();
+ if ((DASM_RIGHTCOL_RAW <= m_rightBar) && (DASM_RIGHTCOL_COMMENTS >= m_rightBar))
+ {
+ QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
+ rightBarGroup->actions()[m_rightBar - 1]->trigger();
+ }
}
void DasmWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute_int("cpu", m_cpu);
- node.set_attribute_int("rightbar", m_rightBar);
+ 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);
- m_cpu = node.get_attribute_int("cpu", m_cpu);
- m_rightBar = node.get_attribute_int("rightbar", m_rightBar);
+ 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);
}
diff --git a/src/osd/modules/debugger/qt/deviceinformationwindow.cpp b/src/osd/modules/debugger/qt/deviceinformationwindow.cpp
index 431a0df492a..29b30f927d4 100644
--- a/src/osd/modules/debugger/qt/deviceinformationwindow.cpp
+++ b/src/osd/modules/debugger/qt/deviceinformationwindow.cpp
@@ -1,12 +1,14 @@
// license:BSD-3-Clause
// copyright-holders:Andrew Gardner
#include "emu.h"
+#include "deviceinformationwindow.h"
+
+#include "util/xmlfile.h"
+
#include <QtWidgets/QFrame>
#include <QtWidgets/QLabel>
#include <QtWidgets/QVBoxLayout>
-#include "deviceinformationwindow.h"
-
DeviceInformationWindow::DeviceInformationWindow(running_machine &machine, device_t *device, QWidget *parent) :
WindowQt(machine, nullptr),
@@ -127,12 +129,12 @@ void DeviceInformationWindowQtConfig::applyToQWidget(QWidget *widget)
void DeviceInformationWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute("device-tag", m_device_tag.c_str());
+ node.set_attribute(osd::debugger::ATTR_WINDOW_DEVICE_TAG, m_device_tag.c_str());
}
void DeviceInformationWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
- m_device_tag = node.get_attribute_string("device-tag", ":");
+ m_device_tag = node.get_attribute_string(osd::debugger::ATTR_WINDOW_DEVICE_TAG, ":");
}
diff --git a/src/osd/modules/debugger/qt/deviceswindow.cpp b/src/osd/modules/debugger/qt/deviceswindow.cpp
index 0e7a94ceb97..51ad0ecc8c2 100644
--- a/src/osd/modules/debugger/qt/deviceswindow.cpp
+++ b/src/osd/modules/debugger/qt/deviceswindow.cpp
@@ -2,8 +2,12 @@
// copyright-holders:Andrew Gardner
#include "emu.h"
#include "deviceswindow.h"
+
#include "deviceinformationwindow.h"
+#include "util/xmlfile.h"
+
+
DevicesWindowModel::DevicesWindowModel(running_machine &machine, QObject *parent) :
m_machine(machine)
{
diff --git a/src/osd/modules/debugger/qt/logwindow.cpp b/src/osd/modules/debugger/qt/logwindow.cpp
index 9649014fc6f..838ae29de02 100644
--- a/src/osd/modules/debugger/qt/logwindow.cpp
+++ b/src/osd/modules/debugger/qt/logwindow.cpp
@@ -1,14 +1,16 @@
// license:BSD-3-Clause
// copyright-holders:Andrew Gardner
#include "emu.h"
-#include <QtWidgets/QVBoxLayout>
-
#include "logwindow.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debug/dvdisasm.h"
+#include "util/xmlfile.h"
+
+#include <QtWidgets/QVBoxLayout>
+
LogWindow::LogWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
diff --git a/src/osd/modules/debugger/qt/mainwindow.cpp b/src/osd/modules/debugger/qt/mainwindow.cpp
index afea2e07919..ec7bafee33c 100644
--- a/src/osd/modules/debugger/qt/mainwindow.cpp
+++ b/src/osd/modules/debugger/qt/mainwindow.cpp
@@ -8,6 +8,8 @@
#include "debug/dvdisasm.h"
#include "debug/points.h"
+#include "util/xmlfile.h"
+
#include <QtGui/QCloseEvent>
#include <QtWidgets/QAction>
#include <QtWidgets/QDockWidget>
@@ -499,7 +501,7 @@ void MainWindowQtConfig::applyToQWidget(QWidget *widget)
void MainWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute_int("rightbar", m_rightBar);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
node.set_attribute("qtwindowstate", m_windowState.toPercentEncoding().data());
}
@@ -509,7 +511,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("rightbar", m_rightBar);
+ m_rightBar = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}
DasmDockWidget::~DasmDockWidget()
diff --git a/src/osd/modules/debugger/qt/memorywindow.cpp b/src/osd/modules/debugger/qt/memorywindow.cpp
index 09d13c5d6d4..8373a56ec3f 100644
--- a/src/osd/modules/debugger/qt/memorywindow.cpp
+++ b/src/osd/modules/debugger/qt/memorywindow.cpp
@@ -7,6 +7,8 @@
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "util/xmlfile.h"
+
#include <QtGui/QClipboard>
#include <QtGui/QMouseEvent>
#include <QtWidgets/QActionGroup>
@@ -76,17 +78,17 @@ MemoryWindow::MemoryWindow(running_machine &machine, QWidget *parent) :
// Create a data format group
QActionGroup *dataFormat = new QActionGroup(this);
dataFormat->setObjectName("dataformat");
- QAction *formatActOne = new QAction("1-byte hexadecimal", this);
- QAction *formatActTwo = new QAction("2-byte hexadecimal", this);
- QAction *formatActFour = new QAction("4-byte hexadecimal", this);
- QAction *formatActEight = new QAction("8-byte hexadecimal", this);
- QAction *formatActOneOctal = new QAction("1-byte octal", this);
- QAction *formatActTwoOctal = new QAction("2-byte octal", this);
- QAction *formatActFourOctal = new QAction("4-byte octal", this);
- QAction *formatActEightOctal = new QAction("8-byte octal", this);
- 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);
+ QAction *formatActOne = new QAction("1-byte Chunks (Hex)", this);
+ QAction *formatActTwo = new QAction("2-byte Chunks (Hex)", this);
+ QAction *formatActFour = new QAction("4-byte Chunks (Hex)", this);
+ QAction *formatActEight = new QAction("8-byte Chunks (Hex)", this);
+ QAction *formatActOneOctal = new QAction("1-byte Chunks (Octal)", this);
+ QAction *formatActTwoOctal = new QAction("2-byte Chunks (Octal)", this);
+ QAction *formatActFourOctal = new QAction("4-byte Chunks (Octal)", this);
+ QAction *formatActEightOctal = new QAction("8-byte Chunks (Octal)", this);
+ 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");
@@ -484,35 +486,35 @@ void MemoryWindowQtConfig::buildFromQWidget(QWidget *widget)
QActionGroup *radixGroup = window->findChild<QActionGroup*>("radixgroup");
if (radixGroup->checkedAction()->text() == "Hexadecimal Addresses")
- m_addressRadix = 0;
+ m_addressRadix = 16;
else if (radixGroup->checkedAction()->text() == "Decimal Addresses")
- m_addressRadix = 1;
+ m_addressRadix = 10;
else if (radixGroup->checkedAction()->text() == "Octal Addresses")
- m_addressRadix = 2;
+ m_addressRadix = 8;
QActionGroup *dataFormat = window->findChild<QActionGroup*>("dataformat");
- if (dataFormat->checkedAction()->text() == "1-byte hexadecimal")
- m_dataFormat = 0;
- else if (dataFormat->checkedAction()->text() == "2-byte hexadecimal")
- m_dataFormat = 1;
- else if (dataFormat->checkedAction()->text() == "4-byte hexadecimal")
- m_dataFormat = 2;
- else if (dataFormat->checkedAction()->text() == "8-byte hexadecimal")
- m_dataFormat = 3;
- else if (dataFormat->checkedAction()->text() == "1-byte octal")
- m_dataFormat = 4;
- else if (dataFormat->checkedAction()->text() == "2-byte octal")
- m_dataFormat = 5;
- else if (dataFormat->checkedAction()->text() == "4-byte octal")
- m_dataFormat = 6;
- else if (dataFormat->checkedAction()->text() == "8-byte octal")
- m_dataFormat = 7;
- else if (dataFormat->checkedAction()->text() == "32 bit floating point")
- m_dataFormat = 8;
- else if (dataFormat->checkedAction()->text() == "64 bit floating point")
- m_dataFormat = 9;
- else if (dataFormat->checkedAction()->text() == "80 bit floating point")
- m_dataFormat = 10;
+ if (dataFormat->checkedAction()->text() == "1-byte Chunks (Hex)")
+ m_dataFormat = int(debug_view_memory::data_format::HEX_8BIT);
+ else if (dataFormat->checkedAction()->text() == "2-byte Chunks (Hex)")
+ m_dataFormat = int(debug_view_memory::data_format::HEX_16BIT);
+ else if (dataFormat->checkedAction()->text() == "4-byte Chunks (Hex)")
+ m_dataFormat = int(debug_view_memory::data_format::HEX_32BIT);
+ else if (dataFormat->checkedAction()->text() == "8-byte Chunks (Hex)")
+ m_dataFormat = int(debug_view_memory::data_format::HEX_64BIT);
+ else if (dataFormat->checkedAction()->text() == "1-byte Chunks (Octal)")
+ m_dataFormat = int(debug_view_memory::data_format::OCTAL_8BIT);
+ else if (dataFormat->checkedAction()->text() == "2-byte Chunks (Octal)")
+ m_dataFormat = int(debug_view_memory::data_format::OCTAL_16BIT);
+ else if (dataFormat->checkedAction()->text() == "4-byte Chunks (Octal)")
+ m_dataFormat = int(debug_view_memory::data_format::OCTAL_32BIT);
+ else if (dataFormat->checkedAction()->text() == "8-byte Chunks (Octal)")
+ m_dataFormat = int(debug_view_memory::data_format::OCTAL_64BIT);
+ else if (dataFormat->checkedAction()->text() == "32-bit floating point")
+ m_dataFormat = int(debug_view_memory::data_format::FLOAT_32BIT);
+ else if (dataFormat->checkedAction()->text() == "64-bit Floating Point")
+ m_dataFormat = int(debug_view_memory::data_format::FLOAT_64BIT);
+ else if (dataFormat->checkedAction()->text() == "80-bit Floating Point")
+ m_dataFormat = int(debug_view_memory::data_format::FLOAT_80BIT);
}
@@ -531,30 +533,50 @@ void MemoryWindowQtConfig::applyToQWidget(QWidget *widget)
addressGroup->actions()[m_addressMode]->trigger();
QActionGroup *radixGroup = window->findChild<QActionGroup*>("radixgroup");
- radixGroup->actions()[m_addressRadix]->trigger();
+ switch (m_addressRadix)
+ {
+ case 16: radixGroup->actions()[0]->trigger(); break;
+ case 10: radixGroup->actions()[1]->trigger(); break;
+ case 8: radixGroup->actions()[2]->trigger(); break;
+ default: break;
+ }
QActionGroup *dataFormat = window->findChild<QActionGroup*>("dataformat");
- dataFormat->actions()[m_dataFormat]->trigger();
+ switch (debug_view_memory::data_format(m_dataFormat))
+ {
+ 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;
+ }
}
void MemoryWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute_int("memoryregion", m_memoryRegion);
- node.set_attribute_int("reverse", m_reverse);
- node.set_attribute_int("addressmode", m_addressMode);
- node.set_attribute_int("addressradix", m_addressRadix);
- node.set_attribute_int("dataformat", m_dataFormat);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REGION, m_memoryRegion);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_REVERSE_COLUMNS, m_reverse);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_MODE, m_addressMode);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_ADDRESS_RADIX, m_addressRadix);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_MEMORY_DATA_FORMAT, m_dataFormat);
}
void MemoryWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
- m_memoryRegion = node.get_attribute_int("memoryregion", m_memoryRegion);
- m_reverse = node.get_attribute_int("reverse", m_reverse);
- m_addressMode = node.get_attribute_int("addressmode", m_addressMode);
- m_addressRadix = node.get_attribute_int("addressradix", m_addressRadix);
- m_dataFormat = node.get_attribute_int("dataformat", m_dataFormat);
+ 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);
}
diff --git a/src/osd/modules/debugger/qt/windowqt.cpp b/src/osd/modules/debugger/qt/windowqt.cpp
index 852d1f5449c..1d7ba70b5a6 100644
--- a/src/osd/modules/debugger/qt/windowqt.cpp
+++ b/src/osd/modules/debugger/qt/windowqt.cpp
@@ -12,6 +12,8 @@
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "util/xmlfile.h"
+
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
@@ -35,15 +37,15 @@ WindowQt::WindowQt(running_machine &machine, QWidget *parent) :
debugActOpenMemory->setShortcut(QKeySequence("Ctrl+M"));
connect(debugActOpenMemory, &QAction::triggered, this, &WindowQt::debugActOpenMemory);
- QAction *debugActOpenDasm = new QAction("New &Dasm Window", this);
+ QAction *debugActOpenDasm = new QAction("New &Disassembly Window", this);
debugActOpenDasm->setShortcut(QKeySequence("Ctrl+D"));
connect(debugActOpenDasm, &QAction::triggered, this, &WindowQt::debugActOpenDasm);
- QAction *debugActOpenLog = new QAction("New &Log Window", this);
+ QAction *debugActOpenLog = new QAction("New Error &Log Window", this);
debugActOpenLog->setShortcut(QKeySequence("Ctrl+L"));
connect(debugActOpenLog, &QAction::triggered, this, &WindowQt::debugActOpenLog);
- QAction *debugActOpenPoints = new QAction("New &Break|Watchpoints Window", this);
+ QAction *debugActOpenPoints = new QAction("New (&Break|Watch)points Window", this);
debugActOpenPoints->setShortcut(QKeySequence("Ctrl+B"));
connect(debugActOpenPoints, &QAction::triggered, this, &WindowQt::debugActOpenPoints);
@@ -261,19 +263,19 @@ void WindowQtConfig::applyToQWidget(QWidget *widget)
void WindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
- node.set_attribute_int("type", m_type);
- node.set_attribute_int("position_x", m_position.x());
- node.set_attribute_int("position_y", m_position.y());
- node.set_attribute_int("size_x", m_size.x());
- node.set_attribute_int("size_y", m_size.y());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, m_position.x());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, m_position.y());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, m_size.x());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, m_size.y());
}
void WindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
- m_size.setX(node.get_attribute_int("size_x", m_size.x()));
- m_size.setY(node.get_attribute_int("size_y", m_size.y()));
- m_position.setX(node.get_attribute_int("position_x", m_position.x()));
- m_position.setY(node.get_attribute_int("position_y", m_position.y()));
- m_type = (WindowQtConfig::WindowType)node.get_attribute_int("type", m_type);
+ 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 = (WindowQtConfig::WindowType)node.get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
}
diff --git a/src/osd/modules/debugger/qt/windowqt.h b/src/osd/modules/debugger/qt/windowqt.h
index 15cbe470f2f..cb1d28342a9 100644
--- a/src/osd/modules/debugger/qt/windowqt.h
+++ b/src/osd/modules/debugger/qt/windowqt.h
@@ -3,6 +3,8 @@
#ifndef MAME_DEBUGGER_QT_WINDOWQT_H
#define MAME_DEBUGGER_QT_WINDOWQT_H
+#include "../xmlconfig.h"
+
#include "config.h"
#include "debugger.h"
diff --git a/src/osd/modules/debugger/win/consolewininfo.cpp b/src/osd/modules/debugger/win/consolewininfo.cpp
index b2f12b69331..83eba523f74 100644
--- a/src/osd/modules/debugger/win/consolewininfo.cpp
+++ b/src/osd/modules/debugger/win/consolewininfo.cpp
@@ -12,6 +12,9 @@
#include "debugviewinfo.h"
#include "uimetrics.h"
+// devices
+#include "imagedev/cassette.h"
+
// emu
#include "debug/debugcon.h"
#include "debugger.h"
@@ -19,8 +22,8 @@
#include "softlist_dev.h"
#include "debug/debugcpu.h"
-// devices
-#include "imagedev/cassette.h"
+// util
+#include "util/xmlfile.h"
// osd/windows
#include "winutf8.h"
@@ -496,6 +499,13 @@ 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);
+}
+
+
void consolewin_info::process_string(std::string const &string)
{
if (string.empty()) // an empty string is a single step
diff --git a/src/osd/modules/debugger/win/consolewininfo.h b/src/osd/modules/debugger/win/consolewininfo.h
index 2d93895b64d..a5b79832578 100644
--- a/src/osd/modules/debugger/win/consolewininfo.h
+++ b/src/osd/modules/debugger/win/consolewininfo.h
@@ -27,6 +27,7 @@ protected:
virtual void recompute_children() override;
virtual void update_menu() override;
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
private:
enum
diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp
index 6965d032dfa..faed31e74bc 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.cpp
+++ b/src/osd/modules/debugger/win/debugviewinfo.cpp
@@ -12,9 +12,12 @@
#include "debugwininfo.h"
#include "uimetrics.h"
#include "debugger.h"
+
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "util/xmlfile.h"
+
#include "strconv.h"
#include "winutil.h"
@@ -180,6 +183,18 @@ void debugview_info::send_pagedown()
}
+int debugview_info::source_index() const
+{
+ if (m_view)
+ {
+ debug_view_source const *const source = m_view->source();
+ if (source)
+ return m_view->source_index(*source);
+ }
+ return -1;
+}
+
+
char const *debugview_info::source_name() const
{
if (m_view)
@@ -284,6 +299,56 @@ HWND debugview_info::create_source_combobox(HWND parent, LONG_PTR userdata)
}
+void debugview_info::restore_configuration_from_node(util::xml::data_node const &node)
+{
+ if (m_view->cursor_supported())
+ {
+ util::xml::data_node const *const selection = node.get_child(osd::debugger::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_position(pos);
+ }
+ }
+
+ util::xml::data_node const *const scroll = node.get_child(osd::debugger::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();
+ m_view->set_visible_position(origin);
+ }
+}
+
+
+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);
+ 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);
+ }
+ }
+
+ util::xml::data_node *const scroll = node.add_child(osd::debugger::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());
+ }
+}
+
+
void debugview_info::add_items_to_context_menu(HMENU menu)
{
AppendMenu(menu, MF_ENABLED, ID_CONTEXT_COPY_VISIBLE, TEXT("Copy Visible"));
diff --git a/src/osd/modules/debugger/win/debugviewinfo.h b/src/osd/modules/debugger/win/debugviewinfo.h
index beb5ee66ff0..0836f1bdf75 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.h
+++ b/src/osd/modules/debugger/win/debugviewinfo.h
@@ -42,6 +42,7 @@ public:
bool cursor_supported() const { return m_view->cursor_supported(); }
bool cursor_visible() const { return m_view->cursor_visible(); }
+ int source_index() const;
char const *source_name() const;
device_t *source_device() const;
bool source_is_visible_cpu() const;
@@ -51,6 +52,9 @@ public:
HWND create_source_combobox(HWND parent, LONG_PTR userdata);
+ virtual void restore_configuration_from_node(util::xml::data_node const &node);
+ virtual void save_configuration_to_node(util::xml::data_node &node);
+
protected:
enum
{
diff --git a/src/osd/modules/debugger/win/debugwin.h b/src/osd/modules/debugger/win/debugwin.h
index e999b87334f..aeaf7252eec 100644
--- a/src/osd/modules/debugger/win/debugwin.h
+++ b/src/osd/modules/debugger/win/debugwin.h
@@ -10,6 +10,8 @@
#pragma once
+#include "../xmlconfig.h"
+
// standard windows headers
#include <windows.h>
#include <windowsx.h>
diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp
index fdd486f3e80..f449d39dbf8 100644
--- a/src/osd/modules/debugger/win/debugwininfo.cpp
+++ b/src/osd/modules/debugger/win/debugwininfo.cpp
@@ -14,12 +14,17 @@
#include "debugger.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+
+#include "util/xmlfile.h"
+
#include "window.h"
#include "winutf8.h"
-
#include "winutil.h"
+
#include "modules/lib/osdobj_common.h"
+#include <cstring>
+
bool debugwin_info::s_window_class_registered = false;
@@ -251,6 +256,89 @@ 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);
+ if (node)
+ save_configuration_to_node(*node);
+}
+
+
+void debugwin_info::restore_configuration_from_node(util::xml::data_node const &node)
+{
+ // get current size to use for defaults
+ RECT bounds;
+ POINT origin;
+ origin.x = 0;
+ origin.y = 0;
+ if (!GetClientRect(window(), &bounds) && ClientToScreen(window(), &origin))
+ return;
+
+ // 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);
+ // TODO: sanity checks...
+ if (!AdjustWindowRectEx(&desired, DEBUG_WINDOW_STYLE, GetMenu(window()) ? TRUE : FALSE, DEBUG_WINDOW_STYLE_EX))
+ return;
+
+ // actually move the window
+ MoveWindow(
+ window(),
+ desired.left,
+ desired.top,
+ desired.right - desired.left,
+ desired.bottom - desired.top,
+ TRUE);
+
+ // restrict to one monitor and avoid toolbars
+ HMONITOR const nearest_monitor = MonitorFromWindow(window(), MONITOR_DEFAULTTONEAREST);
+ if (nearest_monitor)
+ {
+ MONITORINFO info;
+ std::memset(&info, 0, sizeof(info));
+ info.cbSize = sizeof(info);
+ if (GetMonitorInfo(nearest_monitor, &info))
+ {
+ if (desired.right > info.rcWork.right)
+ {
+ desired.left -= desired.right - info.rcWork.right;
+ desired.right = info.rcWork.right;
+ }
+ if (desired.bottom > info.rcWork.bottom)
+ {
+ desired.top -= desired.bottom - info.rcWork.bottom;
+ desired.bottom = info.rcWork.bottom;
+ }
+ if (desired.left < info.rcWork.left)
+ {
+ desired.right += info.rcWork.left - desired.left;
+ desired.left = info.rcWork.left;
+ }
+ if (desired.top < info.rcWork.top)
+ {
+ desired.bottom += info.rcWork.top - desired.top;
+ desired.top = info.rcWork.top;
+ }
+ desired.bottom = std::min(info.rcWork.bottom, desired.bottom);
+ desired.right = std::min(info.rcWork.right, desired.right);
+ MoveWindow(
+ window(),
+ desired.left,
+ desired.top,
+ desired.right - desired.left,
+ desired.bottom - desired.top,
+ TRUE);
+ }
+ }
+
+ // sort out contents
+ recompute_children();
+}
+
+
void debugwin_info::recompute_children()
{
if (m_views[0] != nullptr)
@@ -392,6 +480,22 @@ void debugwin_info::draw_border(HDC dc, RECT &bounds)
}
+void debugwin_info::save_configuration_to_node(util::xml::data_node &node)
+{
+ RECT bounds;
+ POINT origin;
+ origin.x = 0;
+ 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);
+ }
+}
+
+
void debugwin_info::draw_border(HDC dc, HWND child)
{
RECT bounds;
diff --git a/src/osd/modules/debugger/win/debugwininfo.h b/src/osd/modules/debugger/win/debugwininfo.h
index 20cea0d477d..f311d40ad2f 100644
--- a/src/osd/modules/debugger/win/debugwininfo.h
+++ b/src/osd/modules/debugger/win/debugwininfo.h
@@ -49,6 +49,9 @@ public:
virtual bool handle_key(WPARAM wparam, LPARAM lparam);
+ void save_configuration(util::xml::data_node &parentnode);
+ virtual void restore_configuration_from_node(util::xml::data_node const &node);
+
protected:
static DWORD const DEBUG_WINDOW_STYLE = (WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN) & (~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX);
static DWORD const DEBUG_WINDOW_STYLE_EX = 0;
@@ -125,6 +128,8 @@ protected:
void draw_border(HDC dc, RECT &bounds);
void draw_border(HDC dc, HWND child);
+ virtual void save_configuration_to_node(util::xml::data_node &node);
+
std::unique_ptr<debugview_info> m_views[MAX_VIEWS];
private:
@@ -141,12 +146,12 @@ private:
HWND m_wnd;
WNDPROC const m_handler;
- uint32_t m_minwidth, m_maxwidth;
- uint32_t m_minheight, m_maxheight;
+ uint32_t m_minwidth, m_maxwidth;
+ uint32_t m_minheight, m_maxheight;
- uint16_t m_ignore_char_lparam;
+ uint16_t m_ignore_char_lparam;
static bool s_window_class_registered;
};
-#endif
+#endif // MAME_DEBUGGER_WIN_DEBUGWININFO_H
diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.cpp b/src/osd/modules/debugger/win/disasmbasewininfo.cpp
index 4f8a58ad0d1..e33e327d237 100644
--- a/src/osd/modules/debugger/win/disasmbasewininfo.cpp
+++ b/src/osd/modules/debugger/win/disasmbasewininfo.cpp
@@ -27,7 +27,7 @@ disasmbasewin_info::disasmbasewin_info(debugger_windows_interface &debugger, boo
return;
m_views[0].reset(new disasmview_info(debugger, *this, window()));
- if ((m_views[0] == nullptr) || !m_views[0]->is_valid())
+ if (!m_views[0] || !m_views[0]->is_valid())
{
m_views[0].reset();
return;
@@ -118,7 +118,7 @@ void disasmbasewin_info::update_menu()
// first find an existing breakpoint at this address
const debug_breakpoint *bp = debug->breakpoint_find(address);
- if (bp == nullptr)
+ if (!bp)
{
ModifyMenu(menu, ID_TOGGLE_BREAKPOINT, MF_BYCOMMAND, ID_TOGGLE_BREAKPOINT, TEXT("Set breakpoint at cursor\tF9"));
ModifyMenu(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND, ID_DISABLE_BREAKPOINT, TEXT("Disable breakpoint at cursor\tShift+F9"));
@@ -131,7 +131,7 @@ void disasmbasewin_info::update_menu()
else
ModifyMenu(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND, ID_DISABLE_BREAKPOINT, TEXT("Enable breakpoint at cursor\tShift+F9"));
}
- bool const available = (bp != nullptr) && (!is_main_console() || dasmview->source_is_visible_cpu());
+ bool const available = bp && (!is_main_console() || dasmview->source_is_visible_cpu());
EnableMenuItem(menu, ID_DISABLE_BREAKPOINT, MF_BYCOMMAND | (available ? MF_ENABLED : MF_GRAYED));
}
else
@@ -263,3 +263,17 @@ bool disasmbasewin_info::handle_command(WPARAM wparam, LPARAM lparam)
}
return editwin_info::handle_command(wparam, lparam);
}
+
+
+void disasmbasewin_info::restore_configuration_from_node(util::xml::data_node const &node)
+{
+ editwin_info::restore_configuration_from_node(node);
+ m_views[0]->restore_configuration_from_node(node);
+}
+
+
+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);
+}
diff --git a/src/osd/modules/debugger/win/disasmbasewininfo.h b/src/osd/modules/debugger/win/disasmbasewininfo.h
index c22f7f08e78..ab93e5c7828 100644
--- a/src/osd/modules/debugger/win/disasmbasewininfo.h
+++ b/src/osd/modules/debugger/win/disasmbasewininfo.h
@@ -22,10 +22,12 @@ public:
virtual ~disasmbasewin_info();
virtual bool handle_key(WPARAM wparam, LPARAM lparam) override;
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
protected:
virtual void update_menu() override;
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
#endif // MAME_DEBUGGER_WIN_DISASMBASEWININFO_H
diff --git a/src/osd/modules/debugger/win/disasmviewinfo.cpp b/src/osd/modules/debugger/win/disasmviewinfo.cpp
index 8884bee5195..9829c39590a 100644
--- a/src/osd/modules/debugger/win/disasmviewinfo.cpp
+++ b/src/osd/modules/debugger/win/disasmviewinfo.cpp
@@ -9,6 +9,8 @@
#include "emu.h"
#include "disasmviewinfo.h"
+#include "util/xmlfile.h"
+
disasmview_info::disasmview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent) :
debugview_info(debugger, owner, parent, DVT_DISASSEMBLY)
@@ -21,6 +23,12 @@ disasmview_info::~disasmview_info()
}
+char const *disasmview_info::expression() const
+{
+ return view<debug_view_disasm>()->expression();
+}
+
+
disasm_right_column disasmview_info::right_column() const
{
return view<debug_view_disasm>()->right_column();
@@ -43,3 +51,21 @@ void disasmview_info::set_right_column(disasm_right_column contents)
{
view<debug_view_disasm>()->set_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())));
+
+ debugview_info::restore_configuration_from_node(node);
+}
+
+
+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());
+}
diff --git a/src/osd/modules/debugger/win/disasmviewinfo.h b/src/osd/modules/debugger/win/disasmviewinfo.h
index 0685d762346..1f506a9e9c5 100644
--- a/src/osd/modules/debugger/win/disasmviewinfo.h
+++ b/src/osd/modules/debugger/win/disasmviewinfo.h
@@ -23,11 +23,15 @@ public:
disasmview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent);
virtual ~disasmview_info();
+ char const *expression() const;
disasm_right_column right_column() const;
offs_t selected_address() const;
void set_expression(const std::string &expression);
void set_right_column(disasm_right_column contents);
+
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
#endif // MAME_DEBUGGER_WIN_DISASMVIEWINFO_H
diff --git a/src/osd/modules/debugger/win/disasmwininfo.cpp b/src/osd/modules/debugger/win/disasmwininfo.cpp
index b94eadbba03..7e8b7b564fb 100644
--- a/src/osd/modules/debugger/win/disasmwininfo.cpp
+++ b/src/osd/modules/debugger/win/disasmwininfo.cpp
@@ -12,6 +12,9 @@
#include "debugviewinfo.h"
#include "disasmviewinfo.h"
#include "uimetrics.h"
+
+#include "util/xmlfile.h"
+
#include "winutf8.h"
@@ -143,3 +146,32 @@ void disasmwin_info::update_caption()
{
win_set_window_text_utf8(window(), std::string("Disassembly: ").append(m_views[0]->source_name()).c_str());
}
+
+
+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()));
+ 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);
+ if (expr && expr->get_value())
+ {
+ set_editwnd_text(expr->get_value());
+ process_string(expr->get_value());
+ }
+
+ disasmbasewin_info::restore_configuration_from_node(node);
+}
+
+
+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());
+}
diff --git a/src/osd/modules/debugger/win/disasmwininfo.h b/src/osd/modules/debugger/win/disasmwininfo.h
index 71764bab0ef..1c45e77ea58 100644
--- a/src/osd/modules/debugger/win/disasmwininfo.h
+++ b/src/osd/modules/debugger/win/disasmwininfo.h
@@ -21,10 +21,13 @@ public:
disasmwin_info(debugger_windows_interface &debugger);
virtual ~disasmwin_info();
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
+
protected:
virtual void recompute_children() override;
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
virtual void draw_contents(HDC dc) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node);
private:
virtual void process_string(const std::string &string) override;
diff --git a/src/osd/modules/debugger/win/logwininfo.cpp b/src/osd/modules/debugger/win/logwininfo.cpp
index 88b6022aa9a..102deabf5e8 100644
--- a/src/osd/modules/debugger/win/logwininfo.cpp
+++ b/src/osd/modules/debugger/win/logwininfo.cpp
@@ -12,6 +12,8 @@
#include "debugviewinfo.h"
#include "logviewinfo.h"
+#include "util/xmlfile.h"
+
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)
@@ -63,3 +65,10 @@ bool logwin_info::handle_command(WPARAM wparam, LPARAM lparam)
}
return debugwin_info::handle_command(wparam, 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);
+}
diff --git a/src/osd/modules/debugger/win/logwininfo.h b/src/osd/modules/debugger/win/logwininfo.h
index b40d184485e..156d1583eb7 100644
--- a/src/osd/modules/debugger/win/logwininfo.h
+++ b/src/osd/modules/debugger/win/logwininfo.h
@@ -23,6 +23,7 @@ public:
protected:
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
#endif
diff --git a/src/osd/modules/debugger/win/memoryviewinfo.cpp b/src/osd/modules/debugger/win/memoryviewinfo.cpp
index a8891553987..09659d298c7 100644
--- a/src/osd/modules/debugger/win/memoryviewinfo.cpp
+++ b/src/osd/modules/debugger/win/memoryviewinfo.cpp
@@ -9,6 +9,8 @@
#include "emu.h"
#include "memoryviewinfo.h"
+#include "util/xmlfile.h"
+
#include "strconv.h"
@@ -23,6 +25,12 @@ memoryview_info::~memoryview_info()
}
+char const *memoryview_info::expression() const
+{
+ return view<debug_view_memory>()->expression();
+}
+
+
debug_view_memory::data_format memoryview_info::data_format() const
{
return view<debug_view_memory>()->get_data_format();
@@ -83,6 +91,32 @@ 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()));
+
+ debugview_info::restore_configuration_from_node(node);
+}
+
+
+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());
+}
+
+
void memoryview_info::add_items_to_context_menu(HMENU menu)
{
debugview_info::add_items_to_context_menu(menu);
diff --git a/src/osd/modules/debugger/win/memoryviewinfo.h b/src/osd/modules/debugger/win/memoryviewinfo.h
index ccc451acd3e..e8a845ee3b9 100644
--- a/src/osd/modules/debugger/win/memoryviewinfo.h
+++ b/src/osd/modules/debugger/win/memoryviewinfo.h
@@ -24,6 +24,7 @@ public:
memoryview_info(debugger_windows_interface &debugger, debugwin_info &owner, HWND parent);
virtual ~memoryview_info();
+ char const *expression() const;
debug_view_memory::data_format data_format() const;
uint32_t chunks_per_row() const;
bool reverse() const;
@@ -37,6 +38,9 @@ public:
void set_physical(bool physical);
void set_address_radix(int radix);
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
+
protected:
enum
{
diff --git a/src/osd/modules/debugger/win/memorywininfo.cpp b/src/osd/modules/debugger/win/memorywininfo.cpp
index 3ed9b6b9482..4a33f73ce0a 100644
--- a/src/osd/modules/debugger/win/memorywininfo.cpp
+++ b/src/osd/modules/debugger/win/memorywininfo.cpp
@@ -13,6 +13,8 @@
#include "memoryviewinfo.h"
#include "uimetrics.h"
+#include "util/xmlfile.h"
+
#include "winutf8.h"
@@ -388,3 +390,35 @@ void memorywin_info::update_caption()
{
win_set_window_text_utf8(window(), std::string("Memory: ").append(m_views[0]->source_name()).c_str());
}
+
+
+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()));
+ 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);
+ if (expr && expr->get_value())
+ {
+ set_editwnd_text(expr->get_value());
+ process_string(expr->get_value());
+ }
+
+ editwin_info::restore_configuration_from_node(node);
+
+ m_views[0]->restore_configuration_from_node(node);
+}
+
+
+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());
+ m_views[0]->save_configuration_to_node(node);
+}
diff --git a/src/osd/modules/debugger/win/memorywininfo.h b/src/osd/modules/debugger/win/memorywininfo.h
index e0436605707..c67036978ac 100644
--- a/src/osd/modules/debugger/win/memorywininfo.h
+++ b/src/osd/modules/debugger/win/memorywininfo.h
@@ -22,12 +22,14 @@ public:
virtual ~memorywin_info();
virtual bool handle_key(WPARAM wparam, LPARAM lparam) override;
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
protected:
virtual void recompute_children() override;
virtual void update_menu() override;
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
virtual void draw_contents(HDC dc) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
private:
virtual void process_string(const std::string &string) override;
@@ -37,4 +39,4 @@ private:
HWND m_combownd;
};
-#endif
+#endif // MAME_DEBUGGER_WIN_MEMORYWININFO_H
diff --git a/src/osd/modules/debugger/win/pointswininfo.cpp b/src/osd/modules/debugger/win/pointswininfo.cpp
index 93926a697ae..27e34908717 100644
--- a/src/osd/modules/debugger/win/pointswininfo.cpp
+++ b/src/osd/modules/debugger/win/pointswininfo.cpp
@@ -11,6 +11,8 @@
#include "debugviewinfo.h"
+#include "util/xmlfile.h"
+
#include "winutf8.h"
@@ -131,3 +133,44 @@ bool pointswin_info::handle_command(WPARAM wparam, LPARAM lparam)
}
return debugwin_info::handle_command(wparam, 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))
+ {
+ case 0:
+ SendMessage(window(), WM_COMMAND, ID_SHOW_BREAKPOINTS, 0);
+ break;
+ case 1:
+ SendMessage(window(), WM_COMMAND, ID_SHOW_WATCHPOINTS, 0);
+ break;
+ case 2:
+ SendMessage(window(), WM_COMMAND, ID_SHOW_REGISTERPOINTS, 0);
+ break;
+ }
+
+ debugwin_info::restore_configuration_from_node(node);
+}
+
+
+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);
+ switch (m_views[0]->type())
+ {
+ case DVT_BREAK_POINTS:
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 0);
+ break;
+ case DVT_WATCH_POINTS:
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 1);
+ break;
+ case DVT_REGISTER_POINTS:
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 2);
+ break;
+ default:
+ break;
+ }
+}
diff --git a/src/osd/modules/debugger/win/pointswininfo.h b/src/osd/modules/debugger/win/pointswininfo.h
index 4e36155105e..0d463e75e17 100644
--- a/src/osd/modules/debugger/win/pointswininfo.h
+++ b/src/osd/modules/debugger/win/pointswininfo.h
@@ -22,10 +22,12 @@ public:
virtual ~pointswin_info();
virtual bool handle_key(WPARAM wparam, LPARAM lparam) override;
+ virtual void restore_configuration_from_node(util::xml::data_node const &node) override;
protected:
virtual void update_menu() override;
virtual bool handle_command(WPARAM wparam, LPARAM lparam) override;
+ virtual void save_configuration_to_node(util::xml::data_node &node) override;
};
-#endif
+#endif // MAME_DEBUGGER_WIN_POINTSWININFO_H
diff --git a/src/osd/modules/debugger/win/uimetrics.h b/src/osd/modules/debugger/win/uimetrics.h
index 2687ada036c..a87e04bafee 100644
--- a/src/osd/modules/debugger/win/uimetrics.h
+++ b/src/osd/modules/debugger/win/uimetrics.h
@@ -41,4 +41,4 @@ private:
uint32_t const m_vscroll_width;
};
-#endif
+#endif // MAME_DEBUGGER_WIN_UIMETRICS_H
diff --git a/src/osd/modules/debugger/xmlconfig.cpp b/src/osd/modules/debugger/xmlconfig.cpp
new file mode 100644
index 00000000000..a2a29d668a2
--- /dev/null
+++ b/src/osd/modules/debugger/xmlconfig.cpp
@@ -0,0 +1,45 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+
+#include "xmlconfig.h"
+
+namespace osd::debugger {
+
+char const *const NODE_WINDOW = "window";
+
+char const *const NODE_WINDOW_SPLITS = "splits";
+char const *const NODE_WINDOW_SELECTION = "selection";
+char const *const NODE_WINDOW_SCROLL = "scroll";
+char const *const NODE_WINDOW_EXPRESSION = "expression";
+
+char const *const ATTR_WINDOW_TYPE = "type";
+char const *const ATTR_WINDOW_POSITION_X = "position_x";
+char const *const ATTR_WINDOW_POSITION_Y = "position_y";
+char const *const ATTR_WINDOW_WIDTH = "size_x";
+char const *const ATTR_WINDOW_HEIGHT = "size_y";
+
+char const *const ATTR_WINDOW_MEMORY_REGION = "memoryregion";
+char const *const ATTR_WINDOW_MEMORY_REVERSE_COLUMNS = "reverse";
+char const *const ATTR_WINDOW_MEMORY_ADDRESS_MODE = "addressmode";
+char const *const ATTR_WINDOW_MEMORY_ADDRESS_RADIX = "addressradix";
+char const *const ATTR_WINDOW_MEMORY_DATA_FORMAT = "dataformat";
+char const *const ATTR_WINDOW_MEMORY_ROW_CHUNKS = "rowchunks";
+
+char const *const ATTR_WINDOW_DISASSEMBLY_CPU = "cpu";
+char const *const ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN = "rightbar";
+
+char const *const ATTR_WINDOW_POINTS_TYPE = "bwtype";
+
+char const *const ATTR_WINDOW_DEVICE_TAG = "device-tag";
+
+char const *const ATTR_SPLITS_CONSOLE_STATE = "state";
+char const *const ATTR_SPLITS_CONSOLE_DISASSEMBLY = "disassembly";
+
+char const *const ATTR_SELECTION_CURSOR_VISIBLE = "visible";
+char const *const ATTR_SELECTION_CURSOR_X = "start_x";
+char const *const ATTR_SELECTION_CURSOR_Y = "start_y";
+
+char const *const ATTR_SCROLL_ORIGIN_X = "position_x";
+char const *const ATTR_SCROLL_ORIGIN_Y = "position_y";
+
+} // namespace osd::debugger
diff --git a/src/osd/modules/debugger/xmlconfig.h b/src/osd/modules/debugger/xmlconfig.h
new file mode 100644
index 00000000000..5696e412304
--- /dev/null
+++ b/src/osd/modules/debugger/xmlconfig.h
@@ -0,0 +1,63 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+#ifndef MAME_OSD_DEBUGGER_XMLCONFIG_H
+#define MAME_OSD_DEBUGGER_XMLCONFIG_H
+
+#pragma once
+
+namespace osd::debugger {
+
+// Qt debugger started using these numeric types - they should be switched to mnemonics at some point
+enum
+{
+
+WINDOW_TYPE_CONSOLE = 1,
+WINDOW_TYPE_MEMORY_VIEWER,
+WINDOW_TYPE_DISASSEMBLY_VIEWER,
+WINDOW_TYPE_ERROR_LOG_VIEWER,
+WINDOW_TYPE_POINTS_VIEWER,
+WINDOW_TYPE_DEVICES_VIEWER,
+WINDOW_TYPE_DEVICE_INFO_VIEWER
+
+};
+
+extern char const *const NODE_WINDOW;
+
+extern char const *const NODE_WINDOW_SPLITS;
+extern char const *const NODE_WINDOW_SELECTION;
+extern char const *const NODE_WINDOW_SCROLL;
+extern char const *const NODE_WINDOW_EXPRESSION;
+
+extern char const *const ATTR_WINDOW_TYPE;
+extern char const *const ATTR_WINDOW_POSITION_X;
+extern char const *const ATTR_WINDOW_POSITION_Y;
+extern char const *const ATTR_WINDOW_WIDTH;
+extern char const *const ATTR_WINDOW_HEIGHT;
+
+extern char const *const ATTR_WINDOW_MEMORY_REGION;
+extern char const *const ATTR_WINDOW_MEMORY_REVERSE_COLUMNS;
+extern char const *const ATTR_WINDOW_MEMORY_ADDRESS_MODE;
+extern char const *const ATTR_WINDOW_MEMORY_ADDRESS_RADIX;
+extern char const *const ATTR_WINDOW_MEMORY_DATA_FORMAT;
+extern char const *const ATTR_WINDOW_MEMORY_ROW_CHUNKS;
+
+extern char const *const ATTR_WINDOW_DISASSEMBLY_CPU;
+extern char const *const ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN;
+
+extern char const *const ATTR_WINDOW_POINTS_TYPE;
+
+extern char const *const ATTR_WINDOW_DEVICE_TAG;
+
+extern char const *const ATTR_SPLITS_CONSOLE_STATE;
+extern char const *const ATTR_SPLITS_CONSOLE_DISASSEMBLY;
+
+extern char const *const ATTR_SELECTION_CURSOR_VISIBLE;
+extern char const *const ATTR_SELECTION_CURSOR_X;
+extern char const *const ATTR_SELECTION_CURSOR_Y;
+
+extern char const *const ATTR_SCROLL_ORIGIN_X;
+extern char const *const ATTR_SCROLL_ORIGIN_Y;
+
+} // namespace osd::debugger
+
+#endif // MAME_OSD_DEBUGGER_XMLCONFIG_H