Added basic support for saving/restoring Cocoa debugger window state, compatible with Qt debugger where possible

This commit is contained in:
Vas Crabb 2017-07-20 22:01:02 +10:00
parent a549c6408a
commit c36c1572ec
19 changed files with 413 additions and 103 deletions

View File

@ -18,6 +18,7 @@
// MAME headers // MAME headers
#include "emu.h" #include "emu.h"
#include "config.h"
#include "debugger.h" #include "debugger.h"
// MAMEOS headers // MAMEOS headers
@ -39,8 +40,9 @@
class debugger_osx : public osd_module, public debug_module class debugger_osx : public osd_module, public debug_module
{ {
public: public:
debugger_osx() debugger_osx() :
: osd_module(OSD_DEBUG_PROVIDER, "osx"), debug_module(), osd_module(OSD_DEBUG_PROVIDER, "osx"),
debug_module(),
m_machine(nullptr), m_machine(nullptr),
m_console(nil) m_console(nil)
{ {
@ -60,6 +62,11 @@ public:
virtual void debugger_update(); virtual void debugger_update();
private: private:
void create_console();
void build_menus();
void config_load(config_type cfgtype, util::xml::data_node const *parentnode);
void config_save(config_type cfgtype, util::xml::data_node *parentnode);
running_machine *m_machine; running_machine *m_machine;
MAMEDebugConsole *m_console; MAMEDebugConsole *m_console;
@ -70,8 +77,10 @@ MODULE_DEFINITION(DEBUG_OSX, debugger_osx)
std::atomic_bool debugger_osx::s_added_menus(false); std::atomic_bool debugger_osx::s_added_menus(false);
//============================================================ //============================================================
// debugger_osx::init // debugger_osx::init
// initialise debugger module
//============================================================ //============================================================
int debugger_osx::init(const osd_options &options) int debugger_osx::init(const osd_options &options)
@ -79,15 +88,17 @@ int debugger_osx::init(const osd_options &options)
return 0; return 0;
} }
//============================================================ //============================================================
// debugger_osx::exit // debugger_osx::exit
// clean up debugger module
//============================================================ //============================================================
void debugger_osx::exit() void debugger_osx::exit()
{ {
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
if (m_console) if (m_console)
{ {
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine] NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine]
forKey:@"MAMEDebugMachine"]; forKey:@"MAMEDebugMachine"];
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification [[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification
@ -96,21 +107,28 @@ void debugger_osx::exit()
[m_console release]; [m_console release];
m_console = nil; m_console = nil;
m_machine = nullptr; m_machine = nullptr;
}
[pool release]; [pool release];
} }
}
//============================================================ //============================================================
// debugger_osx::init_debugger // debugger_osx::init_debugger
// attach debugger module to a machine
//============================================================ //============================================================
void debugger_osx::init_debugger(running_machine &machine) void debugger_osx::init_debugger(running_machine &machine)
{ {
m_machine = &machine; m_machine = &machine;
machine.configuration().config_register(
"debugger",
config_load_delegate(&debugger_osx::config_load, this),
config_save_delegate(&debugger_osx::config_save, this));
} }
//============================================================ //============================================================
// debugger_osx::wait_for_debugger // debugger_osx::wait_for_debugger
// perform debugger event processing
//============================================================ //============================================================
void debugger_osx::wait_for_debugger(device_t &device, bool firststop) void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
@ -118,7 +136,63 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
// create a console window // create a console window
create_console();
// make sure the debug windows are visible
if (firststop)
{
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:&device],
@"MAMEDebugDevice",
[NSValue valueWithPointer:m_machine],
@"MAMEDebugMachine",
nil];
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEShowDebuggerNotification
object:m_console
userInfo:info];
}
// get and process messages
NSEvent *ev = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantFuture]
inMode:NSDefaultRunLoopMode
dequeue:YES];
if (ev != nil)
[NSApp sendEvent:ev];
[pool release];
}
//============================================================
// debugger_osx::debugger_update
//============================================================
void debugger_osx::debugger_update()
{
}
//============================================================
// debugger_osx::create_console
// create main debugger window if we haven't already done so
//============================================================
void debugger_osx::create_console()
{
if (m_console == nil) if (m_console == nil)
{
build_menus();
m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine];
}
}
//============================================================
// debugger_osx::build_menus
// extend global menu bar with debugging options
//============================================================
void debugger_osx::build_menus()
{ {
if (!s_added_menus.exchange(true, std::memory_order_relaxed)) if (!s_added_menus.exchange(true, std::memory_order_relaxed))
{ {
@ -210,38 +284,44 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]] keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
setKeyEquivalentModifierMask:NSShiftKeyMask]; setKeyEquivalentModifierMask:NSShiftKeyMask];
} }
m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine];
} }
// make sure the debug windows are visible
if (firststop) //============================================================
// debugger_osx::config_load
// restore state based on configuration XML
//============================================================
void debugger_osx::config_load(config_type cfgtype, util::xml::data_node const *parentnode)
{ {
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:&device], if ((config_type::GAME == cfgtype) && parentnode)
@"MAMEDebugDevice", {
[NSValue valueWithPointer:m_machine], NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
@"MAMEDebugMachine", create_console();
nil]; [m_console loadConfiguration:parentnode];
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEShowDebuggerNotification [pool release];
object:m_console }
userInfo:info]; }
}
// get and process messages //============================================================
NSEvent *ev = [NSApp nextEventMatchingMask:NSAnyEventMask // debugger_osx::config_save
untilDate:[NSDate distantFuture] // save state to system XML
inMode:NSDefaultRunLoopMode //============================================================
dequeue:YES];
if (ev != nil) void debugger_osx::config_save(config_type cfgtype, util::xml::data_node *parentnode)
[NSApp sendEvent:ev]; {
if ((config_type::GAME == cfgtype) && m_console)
{
NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init];
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:m_machine],
@"MAMEDebugMachine",
[NSValue valueWithPointer:parentnode],
@"MAMEDebugParentNode",
nil];
[[NSNotificationCenter defaultCenter] postNotificationName:MAMESaveDebuggerConfigurationNotification
object:m_console
userInfo:info];
[pool release]; [pool release];
} }
//============================================================
// debugger_update
//============================================================
void debugger_osx::debugger_update()
{
} }

View File

@ -50,6 +50,10 @@
- (void)showDebugger:(NSNotification *)notification; - (void)showDebugger:(NSNotification *)notification;
- (void)auxiliaryWindowWillClose:(NSNotification *)notification; - (void)auxiliaryWindowWillClose:(NSNotification *)notification;
- (void)loadConfiguration:(util::xml::data_node const *)parentnode;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor; - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command; - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command;

View File

@ -25,6 +25,8 @@
#include "debug/debugcon.h" #include "debug/debugcon.h"
#include "debug/debugcpu.h" #include "debug/debugcpu.h"
#include "util/xmlfile.h"
@implementation MAMEDebugConsole @implementation MAMEDebugConsole
@ -378,6 +380,55 @@
} }
- (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"))
{
MAMEDebugWindowHandler *win = nil;
switch (node->get_attribute_int("type", -1))
{
case MAME_DEBUGGER_WINDOW_TYPE_CONSOLE:
[self restoreConfigurationFromNode:node];
break;
case MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER:
win = [[MAMEMemoryViewer alloc] initWithMachine:*machine console:self];
break;
case MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER:
win = [[MAMEDisassemblyViewer alloc] initWithMachine:*machine console:self];
break;
case MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER:
win = [[MAMEErrorLogViewer alloc] initWithMachine:*machine console:self];
break;
case MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER:
win = [[MAMEPointsViewer alloc] initWithMachine:*machine console:self];
break;
case MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER:
win = [[MAMEDevicesViewer alloc] initWithMachine:*machine console:self];
break;
case MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER:
// FIXME: needs device info on init, make another variant
//win = [[MAMEDeviceInfoViewer alloc] initWithMachine:*machine console:self];
break;
default:
break;
}
if (win)
{
[auxiliaryWindows addObject:win];
[win restoreConfigurationFromNode:node];
[win release];
[win activate];
}
}
}
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_CONSOLE);
}
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor { - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor {
if (control == commandField) if (control == commandField)
[history edit]; [history edit];

View File

@ -20,6 +20,20 @@
extern NSString *const MAMEHideDebuggerNotification; extern NSString *const MAMEHideDebuggerNotification;
extern NSString *const MAMEShowDebuggerNotification; extern NSString *const MAMEShowDebuggerNotification;
extern NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification; 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> @interface MAMEDebugWindowHandler : NSObject <NSWindowDelegate>
@ -55,6 +69,10 @@ extern NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification;
- (void)showDebugger:(NSNotification *)notification; - (void)showDebugger:(NSNotification *)notification;
- (void)hideDebugger:(NSNotification *)notification; - (void)hideDebugger:(NSNotification *)notification;
- (void)saveConfig:(NSNotification *)notification;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node;
@end @end
@ -99,4 +117,7 @@ extern NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification;
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor; - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command; - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node;
@end @end

View File

@ -15,6 +15,9 @@
#include "debugger.h" #include "debugger.h"
#include "util/xmlfile.h"
//============================================================ //============================================================
// NOTIFICATIONS // NOTIFICATIONS
//============================================================ //============================================================
@ -22,6 +25,7 @@
NSString *const MAMEHideDebuggerNotification = @"MAMEHideDebuggerNotification"; NSString *const MAMEHideDebuggerNotification = @"MAMEHideDebuggerNotification";
NSString *const MAMEShowDebuggerNotification = @"MAMEShowDebuggerNotification"; NSString *const MAMEShowDebuggerNotification = @"MAMEShowDebuggerNotification";
NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryDebugWindowWillCloseNotification"; NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryDebugWindowWillCloseNotification";
NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerConfigurationNotification";
//============================================================ //============================================================
@ -154,6 +158,10 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD
[window setTitle:t]; [window setTitle:t];
[window setContentMinSize:NSMakeSize(320, 240)]; [window setContentMinSize:NSMakeSize(320, 240)];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(saveConfig:)
name:MAMESaveDebuggerConfigurationNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(showDebugger:) selector:@selector(showDebugger:)
name:MAMEShowDebuggerNotification name:MAMEShowDebuggerNotification
@ -269,6 +277,46 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD
[window orderOut:self]; [window orderOut:self];
} }
- (void)saveConfig:(NSNotification *)notification {
running_machine *m = (running_machine *)[[[notification userInfo] objectForKey:@"MAMEDebugMachine"] pointerValue];
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);
if (node)
[self saveConfigurationToNode:node];
}
}
- (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);
}
- (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);
NSSize min = [window minSize];
frame.size.width = std::max(frame.size.width, min.width);
frame.size.height = std::max(frame.size.height, min.height);
NSSize max = [window maxSize];
frame.size.width = std::min(frame.size.width, max.width);
frame.size.height = std::min(frame.size.height, max.height);
[window setFrame:frame display:YES];
}
@end @end
@ -449,4 +497,18 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD
return NO; return NO;
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->add_child("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");
if (expr && expr->get_value())
[self setExpression:[NSString stringWithUTF8String:expr->get_value()]];
}
@end @end

View File

@ -23,4 +23,6 @@
- (id)initWithDevice:(device_t &)d machine:(running_machine &)m console:(MAMEDebugConsole *)c; - (id)initWithDevice:(device_t &)d machine:(running_machine &)m console:(MAMEDebugConsole *)c;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
@end @end

View File

@ -9,6 +9,8 @@
#include "emu.h" #include "emu.h"
#import "deviceinfoviewer.h" #import "deviceinfoviewer.h"
#include "util/xmlfile.h"
@interface MAMEDeviceInfoView : NSView @interface MAMEDeviceInfoView : NSView
{ {
@ -232,4 +234,10 @@
return self; return self;
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DEVICE_INFO_VIEWER);
}
@end @end

View File

@ -26,4 +26,6 @@
- (IBAction)showDeviceDetail:(id)sender; - (IBAction)showDeviceDetail:(id)sender;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
@end @end

View File

@ -11,6 +11,8 @@
#import "debugconsole.h" #import "debugconsole.h"
#include "util/xmlfile.h"
@interface MAMEDeviceWrapper : NSObject @interface MAMEDeviceWrapper : NSObject
{ {
@ -181,6 +183,12 @@
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DEVICES_VIEWER);
}
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
return [(MAMEDeviceWrapper *)item children] > 0; return [(MAMEDeviceWrapper *)item children] > 0;
} }

View File

@ -33,4 +33,6 @@
- (IBAction)changeSubview:(id)sender; - (IBAction)changeSubview:(id)sender;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
@end @end

View File

@ -17,6 +17,8 @@
#include "debug/debugcon.h" #include "debug/debugcon.h"
#include "debug/debugcpu.h" #include "debug/debugcpu.h"
#include "util/xmlfile.h"
@implementation MAMEDisassemblyViewer @implementation MAMEDisassemblyViewer
@ -227,6 +229,12 @@
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_DISASSEMBLY_VIEWER);
}
- (BOOL)validateMenuItem:(NSMenuItem *)item { - (BOOL)validateMenuItem:(NSMenuItem *)item {
SEL const action = [item action]; SEL const action = [item action];
BOOL const inContextMenu = ([item menu] == [dasmView menu]); BOOL const inContextMenu = ([item menu] == [dasmView menu]);

View File

@ -23,4 +23,6 @@
- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c; - (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
@end @end

View File

@ -11,6 +11,8 @@
#import "errorlogview.h" #import "errorlogview.h"
#include "util/xmlfile.h"
@implementation MAMEErrorLogViewer @implementation MAMEErrorLogViewer
@ -59,4 +61,10 @@
[super dealloc]; [super dealloc];
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_ERROR_LOG_VIEWER);
}
@end @end

View File

@ -40,6 +40,9 @@
- (IBAction)showReverseViewToggle:(id)sender; - (IBAction)showReverseViewToggle:(id)sender;
- (IBAction)changeBytesPerLine:(id)sender; - (IBAction)changeBytesPerLine:(id)sender;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node;
- (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index; - (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;
- (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index; - (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;

View File

@ -12,6 +12,8 @@
#include "debug/debugcpu.h" #include "debug/debugcpu.h"
#include "debug/debugvw.h" #include "debug/debugvw.h"
#include "util/xmlfile.h"
@implementation MAMEMemoryView @implementation MAMEMemoryView
@ -107,7 +109,8 @@
- (void)selectSubviewAtIndex:(int)index { - (void)selectSubviewAtIndex:(int)index {
int const selected = view->source_list().indexof(*view->source()); int const selected = view->source_list().indexof(*view->source());
if (selected != index) { if (selected != index)
{
view->set_source(*view->source_list().find(index)); view->set_source(*view->source_list().find(index));
if ([[self window] firstResponder] != self) if ([[self window] firstResponder] != self)
view->set_cursor_visible(false); view->set_cursor_visible(false);
@ -197,6 +200,24 @@
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
debug_view_memory *const memView = downcast<debug_view_memory *>(view);
node->set_attribute_int("memoryregion", [self selectedSubviewIndex]);
node->set_attribute_int("reverse", memView->reverse() ? 1 : 0);
node->set_attribute_int("addressmode", memView->physical() ? 1 : 0);
node->set_attribute_int("dataformat", memView->get_data_format());
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
debug_view_memory *const memView = downcast<debug_view_memory *>(view);
[self selectSubviewAtIndex:node->get_attribute_int("memoryregion", [self selectedSubviewIndex])];
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(node->get_attribute_int("dataformat", memView->get_data_format()));
}
- (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index { - (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index {
NSInteger tag; NSInteger tag;
for (tag = 1; tag <= 8; tag <<= 1) { for (tag = 1; tag <= 8; tag <<= 1) {

View File

@ -29,4 +29,7 @@
- (IBAction)changeSubview:(id)sender; - (IBAction)changeSubview:(id)sender;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node;
@end @end

View File

@ -17,6 +17,8 @@
#include "debug/debugcpu.h" #include "debug/debugcpu.h"
#include "debug/dvmemory.h" #include "debug/dvmemory.h"
#include "util/xmlfile.h"
@implementation MAMEMemoryViewer @implementation MAMEMemoryViewer
@ -173,4 +175,17 @@
[window setTitle:[NSString stringWithFormat:@"Memory: %@", [memoryView selectedSubviewName]]]; [window setTitle:[NSString stringWithFormat:@"Memory: %@", [memoryView selectedSubviewName]]];
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_MEMORY_VIEWER);
[memoryView saveConfigurationToNode:node];
}
- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
[super restoreConfigurationFromNode:node];
[memoryView restoreConfigurationFromNode:node];
}
@end @end

View File

@ -25,4 +25,6 @@
- (IBAction)changeSubview:(id)sender; - (IBAction)changeSubview:(id)sender;
- (void)saveConfigurationToNode:(util::xml::data_node *)node;
@end @end

View File

@ -12,6 +12,8 @@
#import "breakpointsview.h" #import "breakpointsview.h"
#import "watchpointsview.h" #import "watchpointsview.h"
#include "util/xmlfile.h"
@implementation MAMEPointsViewer @implementation MAMEPointsViewer
@ -141,4 +143,10 @@
[window setTitle:[[sender selectedItem] title]]; [window setTitle:[[sender selectedItem] title]];
} }
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
node->set_attribute_int("type", MAME_DEBUGGER_WINDOW_TYPE_POINTS_VIEWER);
}
@end @end