summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/osx
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/debugger/osx')
-rw-r--r--src/osd/modules/debugger/osx/debugcommandhistory.h5
-rw-r--r--src/osd/modules/debugger/osx/debugcommandhistory.mm32
-rw-r--r--src/osd/modules/debugger/osx/debugconsole.mm86
-rw-r--r--src/osd/modules/debugger/osx/debugosx.h35
-rw-r--r--src/osd/modules/debugger/osx/debugview.mm94
-rw-r--r--src/osd/modules/debugger/osx/debugwindowhandler.h13
-rw-r--r--src/osd/modules/debugger/osx/debugwindowhandler.mm69
-rw-r--r--src/osd/modules/debugger/osx/deviceinfoviewer.mm23
-rw-r--r--src/osd/modules/debugger/osx/devicesviewer.mm10
-rw-r--r--src/osd/modules/debugger/osx/disassemblyview.mm55
-rw-r--r--src/osd/modules/debugger/osx/disassemblyviewer.mm31
-rw-r--r--src/osd/modules/debugger/osx/errorlogviewer.mm12
-rw-r--r--src/osd/modules/debugger/osx/exceptionpointsview.h23
-rw-r--r--src/osd/modules/debugger/osx/exceptionpointsview.mm27
-rw-r--r--src/osd/modules/debugger/osx/memoryview.mm199
-rw-r--r--src/osd/modules/debugger/osx/memoryviewer.mm20
-rw-r--r--src/osd/modules/debugger/osx/pointsviewer.mm94
-rw-r--r--src/osd/modules/debugger/osx/registerpointsview.h23
-rw-r--r--src/osd/modules/debugger/osx/registerpointsview.mm27
-rw-r--r--src/osd/modules/debugger/osx/registersview.mm6
20 files changed, 587 insertions, 297 deletions
diff --git a/src/osd/modules/debugger/osx/debugcommandhistory.h b/src/osd/modules/debugger/osx/debugcommandhistory.h
index f99767cb4be..e505aa4435c 100644
--- a/src/osd/modules/debugger/osx/debugcommandhistory.h
+++ b/src/osd/modules/debugger/osx/debugcommandhistory.h
@@ -8,6 +8,8 @@
#import "debugosx.h"
+#include "util/utilfwd.h"
+
#import <Cocoa/Cocoa.h>
@@ -32,4 +34,7 @@
- (void)reset;
- (void)clear;
+- (void)saveConfigurationToNode:(util::xml::data_node *)node;
+- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node;
+
@end
diff --git a/src/osd/modules/debugger/osx/debugcommandhistory.mm b/src/osd/modules/debugger/osx/debugcommandhistory.mm
index 74a34904ae7..e2292f973b0 100644
--- a/src/osd/modules/debugger/osx/debugcommandhistory.mm
+++ b/src/osd/modules/debugger/osx/debugcommandhistory.mm
@@ -12,6 +12,8 @@
#import "debugcommandhistory.h"
+#include "util/xmlfile.h"
+
@implementation MAMEDebugCommandHistory
@@ -54,9 +56,9 @@
- (void)add:(NSString *)entry {
if (([history count] == 0) || ![[history objectAtIndex:0] isEqualToString:entry]) {
- [history insertObject:entry atIndex:0];
- while ([history count] > length)
+ while ([history count] >= length)
[history removeLastObject];
+ [history insertObject:entry atIndex:0];
}
position = 0;
}
@@ -110,4 +112,30 @@
[history removeAllObjects];
}
+
+- (void)saveConfigurationToNode:(util::xml::data_node *)node {
+ util::xml::data_node *const hist = node->add_child(osd::debugger::NODE_WINDOW_HISTORY, nullptr);
+ if (hist) {
+ for (NSInteger i = [history count]; 0 < i; --i)
+ hist->add_child(osd::debugger::NODE_HISTORY_ITEM, [[history objectAtIndex:(i - 1)] UTF8String]);
+ }
+}
+
+
+- (void)restoreConfigurationFromNode:(util::xml::data_node const *)node {
+ [self clear];
+ util::xml::data_node const *const hist = node->get_child(osd::debugger::NODE_WINDOW_HISTORY);
+ if (hist) {
+ util::xml::data_node const *item = hist->get_child(osd::debugger::NODE_HISTORY_ITEM);
+ while (item) {
+ if (item->get_value() && *item->get_value()) {
+ while ([history count] >= length)
+ [history removeLastObject];
+ [history insertObject:[NSString stringWithUTF8String:item->get_value()] atIndex:0];
+ }
+ item = item->get_next_sibling(osd::debugger::NODE_HISTORY_ITEM);
+ }
+ }
+}
+
@end
diff --git a/src/osd/modules/debugger/osx/debugconsole.mm b/src/osd/modules/debugger/osx/debugconsole.mm
index 1bd285e8c3b..9673dc852ab 100644
--- a/src/osd/modules/debugger/osx/debugconsole.mm
+++ b/src/osd/modules/debugger/osx/debugconsole.mm
@@ -24,6 +24,7 @@
#include "debugger.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "debug/points.h"
#include "util/xmlfile.h"
@@ -141,19 +142,25 @@
NSRect const available = [[NSScreen mainScreen] visibleFrame];
NSSize const regCurrent = [regScroll frame].size;
NSSize const regSize = [NSScrollView frameSizeForContentSize:[regView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[regScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[regScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
NSSize const dasmCurrent = [dasmScroll frame].size;
NSSize const dasmSize = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[dasmScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[dasmScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
NSSize const consoleCurrent = [consoleContainer frame].size;
NSSize consoleSize = [NSScrollView frameSizeForContentSize:[consoleView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[consoleScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[consoleScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
NSRect windowFrame = [window frame];
NSSize adjustment;
@@ -181,7 +188,7 @@
[dasmSplit setFrame:rhsFrame];
// select the current processor
- [self setCPU:machine->debugger().cpu().get_visible_cpu()];
+ [self setCPU:machine->debugger().console().get_visible_cpu()];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(auxiliaryWindowWillClose:)
@@ -219,7 +226,7 @@
NSString *command = [sender stringValue];
if ([command length] == 0)
{
- machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
+ machine->debugger().console().get_visible_cpu()->debug()->single_step();
[history reset];
}
else
@@ -234,10 +241,10 @@
- (IBAction)debugToggleBreakpoint:(id)sender {
device_t &device = *[dasmView source]->device();
- if ([dasmView cursorVisible] && (machine->debugger().cpu().get_visible_cpu() == &device))
+ if ([dasmView cursorVisible] && (machine->debugger().console().get_visible_cpu() == &device))
{
offs_t const address = [dasmView selectedAddress];
- const device_debug::breakpoint *bp = [dasmView source]->device()->debug()->breakpoint_find(address);
+ const debug_breakpoint *bp = [dasmView source]->device()->debug()->breakpoint_find(address);
// if it doesn't exist, add a new one
NSString *command;
@@ -252,9 +259,9 @@
- (IBAction)debugToggleBreakpointEnable:(id)sender {
device_t &device = *[dasmView source]->device();
- if ([dasmView cursorVisible] && (machine->debugger().cpu().get_visible_cpu() == &device))
+ if ([dasmView cursorVisible] && (machine->debugger().console().get_visible_cpu() == &device))
{
- const device_debug::breakpoint *bp = [dasmView source]->device()->debug()->breakpoint_find([dasmView selectedAddress]);
+ const debug_breakpoint *bp = [dasmView source]->device()->debug()->breakpoint_find([dasmView selectedAddress]);
if (bp != nullptr)
{
NSString *command;
@@ -270,7 +277,7 @@
- (IBAction)debugRunToCursor:(id)sender {
device_t &device = *[dasmView source]->device();
- if ([dasmView cursorVisible] && (machine->debugger().cpu().get_visible_cpu() == &device))
+ if ([dasmView cursorVisible] && (machine->debugger().console().get_visible_cpu() == &device))
{
NSString *command = [NSString stringWithFormat:@"go 0x%lX", (unsigned long)[dasmView selectedAddress]];
machine->debugger().console().execute_command([command UTF8String], 1);
@@ -379,32 +386,35 @@
- (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:
- // FIXME: needs device info on init, make another variant
- //win = [[MAMEDeviceInfoViewer alloc] initWithMachine:*machine console:self];
+ case osd::debugger::WINDOW_TYPE_DEVICE_INFO_VIEWER:
+ {
+ // FIXME: feels like a leaky abstraction, but device is needed for init
+ device_t *const device = machine->root_device().subdevice(node->get_attribute_string(osd::debugger::ATTR_WINDOW_DEVICE_TAG, ":"));
+ win = [[MAMEDeviceInfoViewer alloc] initWithDevice:(device ? *device : machine->root_device()) machine:*machine console:self];
+ }
break;
default:
break;
@@ -422,34 +432,36 @@
- (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]));
}
[dasmView saveConfigurationToNode:node];
+ [history saveConfigurationToNode:node];
}
- (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];
+ [history restoreConfigurationFromNode:node];
}
@@ -499,7 +511,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification
object:self
userInfo:info];
- machine->debugger().cpu().get_visible_cpu()->debug()->go();
+ machine->debugger().console().get_visible_cpu()->debug()->go();
}
}
@@ -562,9 +574,9 @@
SEL const action = [item action];
BOOL const inContextMenu = ([item menu] == [dasmView menu]);
BOOL const haveCursor = [dasmView cursorVisible];
- BOOL const isCurrent = (machine->debugger().cpu().get_visible_cpu() == [dasmView source]->device());
+ BOOL const isCurrent = (machine->debugger().console().get_visible_cpu() == [dasmView source]->device());
- const device_debug::breakpoint *breakpoint = nullptr;
+ const debug_breakpoint *breakpoint = nullptr;
if (haveCursor)
{
breakpoint = [dasmView source]->device()->debug()->breakpoint_find([dasmView selectedAddress]);
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 f3e4c6b8b64..504eaab8fe3 100644
--- a/src/osd/modules/debugger/osx/debugview.mm
+++ b/src/osd/modules/debugger/osx/debugview.mm
@@ -10,13 +10,14 @@
#include "emu.h"
#include "debugger.h"
+#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "modules/lib/osdobj_common.h"
#include "util/xmlfile.h"
-#include <string.h>
+#include <cstring>
static NSColor *DefaultForeground;
@@ -50,6 +51,26 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
@implementation MAMEDebugView
+ (void)initialize {
+ // 10.15 and better get full adaptive Dark Mode support
+#if defined(MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
+ DefaultForeground = [[NSColor textColor] retain];
+ ChangedForeground = [[NSColor systemRedColor] retain];
+ CommentForeground = [[NSColor systemGreenColor] retain];
+ // DCA_INVALID and DCA_DISABLED currently are not set by the core, so these 4 are unused
+ InvalidForeground = [[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:1.0 alpha:1.0] retain];
+ DisabledChangedForeground = [[NSColor colorWithCalibratedRed:0.5 green:0.125 blue:0.125 alpha:1.0] retain];
+ DisabledInvalidForeground = [[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:0.5 alpha:1.0] retain];
+ DisabledCommentForeground = [[NSColor colorWithCalibratedRed:0.0 green:0.25 blue:0.0 alpha:1.0] retain];
+
+ DefaultBackground = [[NSColor textBackgroundColor] retain];
+ VisitedBackground = [[NSColor systemTealColor] retain];
+ AncillaryBackground = [[NSColor unemphasizedSelectedContentBackgroundColor] retain];
+ SelectedBackground = [[NSColor selectedContentBackgroundColor] retain];
+ CurrentBackground = [[NSColor selectedControlColor] retain];
+ SelectedCurrentBackground = [[NSColor unemphasizedSelectedContentBackgroundColor] retain];
+ InactiveSelectedBackground = [[NSColor unemphasizedSelectedContentBackgroundColor] retain];
+ InactiveSelectedCurrentBackground = [[NSColor systemGrayColor] retain];
+#else
DefaultForeground = [[NSColor colorWithCalibratedWhite:0.0 alpha:1.0] retain];
ChangedForeground = [[NSColor colorWithCalibratedRed:0.875 green:0.0 blue:0.0 alpha:1.0] retain];
InvalidForeground = [[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:1.0 alpha:1.0] retain];
@@ -66,6 +87,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
SelectedCurrentBackground = [[NSColor colorWithCalibratedRed:0.875 green:0.625 blue:0.875 alpha:1.0] retain];
InactiveSelectedBackground = [[NSColor colorWithCalibratedWhite:0.875 alpha:1.0] retain];
InactiveSelectedCurrentBackground = [[NSColor colorWithCalibratedRed:0.875 green:0.5 blue:0.625 alpha:1.0] retain];
+#endif
NonWhiteCharacters = [[[NSCharacterSet whitespaceAndNewlineCharacterSet] invertedSet] retain];
}
@@ -255,7 +277,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
[self setFont:[[self class] defaultFontForMachine:m]];
- NSMenu *contextMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Context"];
+ NSMenu *contextMenu = [[NSMenu alloc] initWithTitle:@"Context"];
[self addContextMenuItemsToMenu:contextMenu];
[self setMenu:contextMenu];
[contextMenu release];
@@ -410,15 +432,15 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
NSRange const run = NSMakeRange(0, [text length]);
[text addAttribute:NSFontAttributeName value:font range:run];
NSPasteboard *const board = [NSPasteboard generalPasteboard];
- [board declareTypes:[NSArray arrayWithObject:NSRTFPboardType] owner:nil];
- [board setData:[text RTFFromRange:run documentAttributes:[NSDictionary dictionary]] forType:NSRTFPboardType];
+ [board declareTypes:[NSArray arrayWithObject:NSPasteboardTypeRTF] owner:nil];
+ [board setData:[text RTFFromRange:run documentAttributes:[NSDictionary dictionary]] forType:NSPasteboardTypeRTF];
[text deleteCharactersInRange:run];
}
- (IBAction)paste:(id)sender {
NSPasteboard *const board = [NSPasteboard generalPasteboard];
- NSString *const avail = [board availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]];
+ NSString *const avail = [board availableTypeFromArray:[NSArray arrayWithObject:NSPasteboardTypeString]];
if (avail == nil)
{
NSBeep();
@@ -492,22 +514,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);
}
}
@@ -515,23 +537,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];
}
}
@@ -674,7 +696,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
NSUInteger start = 0, length = 0;
for (uint32_t col = origin.x; col < origin.x + size.x; col++)
{
- [[text mutableString] appendFormat:@"%c", data[col - origin.x].byte];
+ [[text mutableString] appendFormat:@"%C", unichar(data[col - origin.x].byte)];
if ((start < length) && (attr != data[col - origin.x].attrib))
{
NSRange const run = NSMakeRange(start, length - start);
@@ -742,8 +764,8 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
- (void)mouseDown:(NSEvent *)event {
NSPoint const location = [self convertPoint:[event locationInWindow] fromView:nil];
NSUInteger const modifiers = [event modifierFlags];
- view->process_click(((modifiers & NSCommandKeyMask) && [[self window] isMainWindow]) ? DCK_RIGHT_CLICK
- : (modifiers & NSAlternateKeyMask) ? DCK_MIDDLE_CLICK
+ view->process_click(((modifiers & NSEventModifierFlagCommand) && [[self window] isMainWindow]) ? DCK_RIGHT_CLICK
+ : (modifiers & NSEventModifierFlagOption) ? DCK_MIDDLE_CLICK
: DCK_LEFT_CLICK,
[self convertLocation:location]);
}
@@ -754,8 +776,8 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
NSPoint const location = [self convertPoint:[event locationInWindow] fromView:nil];
NSUInteger const modifiers = [event modifierFlags];
if (view->cursor_supported()
- && !(modifiers & NSAlternateKeyMask)
- && (!(modifiers & NSCommandKeyMask) || ![[self window] isMainWindow]))
+ && !(modifiers & NSEventModifierFlagOption)
+ && (!(modifiers & NSEventModifierFlagCommand) || ![[self window] isMainWindow]))
{
view->set_cursor_position([self convertLocation:location]);
view->set_cursor_visible(true);
@@ -782,34 +804,34 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
if ([str length] == 1)
{
- if (modifiers & NSNumericPadKeyMask)
+ if (modifiers & NSEventModifierFlagNumericPad)
{
switch ([str characterAtIndex:0])
{
case NSUpArrowFunctionKey:
- if (modifiers & NSCommandKeyMask)
+ if (modifiers & NSEventModifierFlagCommand)
view->process_char(DCH_CTRLHOME);
else
view->process_char(DCH_UP);
return;
case NSDownArrowFunctionKey:
- if (modifiers & NSCommandKeyMask)
+ if (modifiers & NSEventModifierFlagCommand)
view->process_char(DCH_CTRLEND);
else
view->process_char(DCH_DOWN);
return;
case NSLeftArrowFunctionKey:
- if (modifiers & NSCommandKeyMask)
+ if (modifiers & NSEventModifierFlagCommand)
[self typeCharacterAndScrollToCursor:DCH_HOME];
- else if (modifiers & NSAlternateKeyMask)
+ else if (modifiers & NSEventModifierFlagOption)
[self typeCharacterAndScrollToCursor:DCH_CTRLLEFT];
else
[self typeCharacterAndScrollToCursor:DCH_LEFT];
return;
case NSRightArrowFunctionKey:
- if (modifiers & NSCommandKeyMask)
+ if (modifiers & NSEventModifierFlagCommand)
[self typeCharacterAndScrollToCursor:DCH_END];
- else if (modifiers & NSAlternateKeyMask)
+ else if (modifiers & NSEventModifierFlagOption)
[self typeCharacterAndScrollToCursor:DCH_CTRLRIGHT];
else
[self typeCharacterAndScrollToCursor:DCH_RIGHT];
@@ -819,18 +841,18 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
return;
}
}
- else if (modifiers & NSFunctionKeyMask)
+ else if (modifiers & NSEventModifierFlagFunction)
{
switch ([str characterAtIndex:0])
{
case NSPageUpFunctionKey:
- if (modifiers & NSAlternateKeyMask)
+ if (modifiers & NSEventModifierFlagOption)
{
view->process_char(DCH_PUP);
return;
}
case NSPageDownFunctionKey:
- if (modifiers & NSAlternateKeyMask)
+ if (modifiers & NSEventModifierFlagOption)
{
view->process_char(DCH_PDOWN);
return;
@@ -871,7 +893,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
- (void)insertNewline:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
+ machine->debugger().console().get_visible_cpu()->debug()->single_step();
}
@@ -899,7 +921,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
if (action == @selector(paste:))
{
NSPasteboard *const board = [NSPasteboard generalPasteboard];
- return [board availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]] != nil;
+ return [board availableTypeFromArray:[NSArray arrayWithObject:NSPasteboardTypeString]] != nil;
}
else
{
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 27d487c86ff..1341f420ed9 100644
--- a/src/osd/modules/debugger/osx/debugwindowhandler.mm
+++ b/src/osd/modules/debugger/osx/debugwindowhandler.mm
@@ -14,6 +14,7 @@
#import "debugview.h"
#include "debugger.h"
+#include "debug/debugcon.h"
#include "util/xmlfile.h"
@@ -42,7 +43,7 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
NSMenuItem *runParentItem = [menu addItemWithTitle:@"Run"
action:@selector(debugRun:)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF5FunctionKey]];
- NSMenu *runMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Run"];
+ NSMenu *runMenu = [[NSMenu alloc] initWithTitle:@"Run"];
[runParentItem setSubmenu:runMenu];
[runMenu release];
[runParentItem setKeyEquivalentModifierMask:0];
@@ -64,7 +65,7 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
setKeyEquivalentModifierMask:0];
NSMenuItem *stepParentItem = [menu addItemWithTitle:@"Step" action:NULL keyEquivalent:@""];
- NSMenu *stepMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Step"];
+ NSMenu *stepMenu = [[NSMenu alloc] initWithTitle:@"Step"];
[stepParentItem setSubmenu:stepMenu];
[stepMenu release];
[[stepMenu addItemWithTitle:@"Into"
@@ -78,10 +79,10 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
[[stepMenu addItemWithTitle:@"Out"
action:@selector(debugStepOut:)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
- setKeyEquivalentModifierMask:NSShiftKeyMask];
+ setKeyEquivalentModifierMask:NSEventModifierFlagShift];
NSMenuItem *resetParentItem = [menu addItemWithTitle:@"Reset" action:NULL keyEquivalent:@""];
- NSMenu *resetMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Reset"];
+ NSMenu *resetMenu = [[NSMenu alloc] initWithTitle:@"Reset"];
[resetParentItem setSubmenu:resetMenu];
[resetMenu release];
[[resetMenu addItemWithTitle:@"Soft"
@@ -91,12 +92,12 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
[[resetMenu addItemWithTitle:@"Hard"
action:@selector(debugHardReset:)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
- setKeyEquivalentModifierMask:NSShiftKeyMask];
+ setKeyEquivalentModifierMask:NSEventModifierFlagShift];
[menu addItem:[NSMenuItem separatorItem]];
NSMenuItem *newParentItem = [menu addItemWithTitle:@"New" action:NULL keyEquivalent:@""];
- NSMenu *newMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"New"];
+ NSMenu *newMenu = [[NSMenu alloc] initWithTitle:@"New"];
[newParentItem setSubmenu:newMenu];
[newMenu release];
[newMenu addItemWithTitle:@"Memory Window"
@@ -113,7 +114,7 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
keyEquivalent:@"b"];
[newMenu addItemWithTitle:@"Devices Window"
action:@selector(debugNewDevicesWindow:)
- keyEquivalent:@"D"];
+ keyEquivalent:@""];
[menu addItem:[NSMenuItem separatorItem]];
@@ -126,7 +127,7 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
NSPopUpButton *actionButton = [[NSPopUpButton alloc] initWithFrame:frame pullsDown:YES];
[actionButton setTitle:@""];
[actionButton addItemWithTitle:@""];
- [actionButton setBezelStyle:NSShadowlessSquareBezelStyle];
+ [actionButton setBezelStyle:NSBezelStyleShadowlessSquare];
[actionButton setFocusRingType:NSFocusRingTypeNone];
[[actionButton cell] setArrowPosition:NSPopUpArrowAtCenter];
[[self class] addCommonActionItems:[actionButton menu]];
@@ -139,10 +140,10 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
return nil;
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 320, 240)
- styleMask:(NSTitledWindowMask |
- NSClosableWindowMask |
- NSMiniaturizableWindowMask |
- NSResizableWindowMask)
+ styleMask:(NSWindowStyleMaskTitled |
+ NSWindowStyleMaskClosable |
+ NSWindowStyleMaskMiniaturizable |
+ NSWindowStyleMaskResizable)
backing:NSBackingStoreBuffered
defer:YES];
[window setReleasedWhenClosed:NO];
@@ -189,12 +190,12 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
- (IBAction)debugBreak:(id)sender {
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
- machine->debugger().cpu().get_visible_cpu()->debug()->halt_on_next_instruction("User-initiated break\n");
+ machine->debugger().console().get_visible_cpu()->debug()->halt_on_next_instruction("User-initiated break\n");
}
- (IBAction)debugRun:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->go();
+ machine->debugger().console().get_visible_cpu()->debug()->go();
}
@@ -203,43 +204,43 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
object:self
userInfo:[NSDictionary dictionaryWithObject:[NSValue valueWithPointer:machine]
forKey:@"MAMEDebugMachine"]];
- machine->debugger().cpu().get_visible_cpu()->debug()->go();
+ machine->debugger().console().get_visible_cpu()->debug()->go();
}
- (IBAction)debugRunToNextCPU:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->go_next_device();
+ machine->debugger().console().get_visible_cpu()->debug()->go_next_device();
}
- (IBAction)debugRunToNextInterrupt:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->go_interrupt();
+ machine->debugger().console().get_visible_cpu()->debug()->go_interrupt();
}
- (IBAction)debugRunToNextVBLANK:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->go_vblank();
+ machine->debugger().console().get_visible_cpu()->debug()->go_vblank();
}
- (IBAction)debugStepInto:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
+ machine->debugger().console().get_visible_cpu()->debug()->single_step();
}
- (IBAction)debugStepOver:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->single_step_over();
+ machine->debugger().console().get_visible_cpu()->debug()->single_step_over();
}
- (IBAction)debugStepOut:(id)sender {
- machine->debugger().cpu().get_visible_cpu()->debug()->single_step_out();
+ machine->debugger().console().get_visible_cpu()->debug()->single_step_out();
}
- (IBAction)debugSoftReset:(id)sender {
machine->schedule_soft_reset();
- machine->debugger().cpu().get_visible_cpu()->debug()->go();
+ machine->debugger().console().get_visible_cpu()->debug()->go();
}
@@ -275,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];
}
@@ -284,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);
@@ -492,15 +493,17 @@ NSString *const MAMESaveDebuggerConfigurationNotification = @"MAMESaveDebuggerCo
- (void)saveConfigurationToNode:(util::xml::data_node *)node {
[super saveConfigurationToNode:node];
- node->add_child("expression", util::xml::normalize_string([[self expression] UTF8String]));
+ node->add_child(osd::debugger::NODE_WINDOW_EXPRESSION, [[self expression] UTF8String]);
+ [history saveConfigurationToNode:node];
}
- (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()]];
+ [history restoreConfigurationFromNode:node];
}
@end
diff --git a/src/osd/modules/debugger/osx/deviceinfoviewer.mm b/src/osd/modules/debugger/osx/deviceinfoviewer.mm
index 61fdd8c8613..12f1ea1957a 100644
--- a/src/osd/modules/debugger/osx/deviceinfoviewer.mm
+++ b/src/osd/modules/debugger/osx/deviceinfoviewer.mm
@@ -54,14 +54,14 @@
- (NSTextField *)makeLabel:(NSString *)text {
NSTextField *const result = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 14)];
[result setAutoresizingMask:(NSViewMaxYMargin | NSViewMaxXMargin)];
- [[result cell] setControlSize:NSSmallControlSize];
+ [[result cell] setControlSize:NSControlSizeSmall];
[result setEditable:NO];
[result setSelectable:NO];
[result setBezeled:NO];
[result setBordered:NO];
[result setDrawsBackground:NO];
- [result setAlignment:NSRightTextAlignment];
- [result setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
+ [result setAlignment:NSTextAlignmentRight];
+ [result setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSControlSizeSmall]]];
[result setStringValue:text];
[result sizeToFit];
return result;
@@ -71,14 +71,14 @@
- (NSTextField *)makeField:(NSString *)text {
NSTextField *const result = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 14)];
[result setAutoresizingMask:(NSViewWidthSizable | NSViewMaxYMargin)];
- [[result cell] setControlSize:NSSmallControlSize];
+ [[result cell] setControlSize:NSControlSizeSmall];
[result setEditable:NO];
[result setSelectable:YES];
[result setBezeled:NO];
[result setBordered:NO];
[result setDrawsBackground:NO];
- [result setAlignment:NSLeftTextAlignment];
- [result setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
+ [result setAlignment:NSTextAlignmentLeft];
+ [result setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSControlSizeSmall]]];
[result setStringValue:text];
[result sizeToFit];
return result;
@@ -210,9 +210,11 @@
// create a scroll view for holding everything
NSSize desired = [NSScrollView frameSizeForContentSize:[contentView frame].size
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:NSNoBorder];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:NSNoBorder
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
[window setContentSize:desired];
contentScroll = [[NSScrollView alloc] initWithFrame:[[window contentView] bounds]];
[contentScroll setDrawsBackground:NO];
@@ -237,7 +239,8 @@
- (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);
+ node->set_attribute(osd::debugger::ATTR_WINDOW_DEVICE_TAG, device->tag());
}
@end
diff --git a/src/osd/modules/debugger/osx/devicesviewer.mm b/src/osd/modules/debugger/osx/devicesviewer.mm
index 23dba724b9d..02f63a41a6b 100644
--- a/src/osd/modules/debugger/osx/devicesviewer.mm
+++ b/src/osd/modules/debugger/osx/devicesviewer.mm
@@ -161,9 +161,11 @@
// calculate the optimal size for everything
NSSize const desired = [NSScrollView frameSizeForContentSize:NSMakeSize(480, 320)
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[devicesScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[devicesScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
[self cascadeWindowWithDesiredSize:desired forView:devicesScroll];
// don't forget the result
@@ -185,7 +187,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 99bdc485147..c501d17230a 100644
--- a/src/osd/modules/debugger/osx/disassemblyview.mm
+++ b/src/osd/modules/debugger/osx/disassemblyview.mm
@@ -46,7 +46,7 @@
- (NSSize)maximumFrameSize {
debug_view_xy max(0, 0);
debug_view_source const *source = view->source();
- for (debug_view_source const *source = view->first_source(); source != nullptr; source = source->next())
+ for (auto &source : view->source_list())
{
view->set_source(*source);
debug_view_xy const current = view->total_size();
@@ -75,7 +75,7 @@
item = [menu addItemWithTitle:@"Disable Breakpoint"
action:@selector(debugToggleBreakpointEnable:)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]];
- [item setKeyEquivalentModifierMask:NSShiftKeyMask];
+ [item setKeyEquivalentModifierMask:NSEventModifierFlagShift];
[menu addItem:[NSMenuItem separatorItem]];
@@ -118,18 +118,23 @@
- (int)selectedSubviewIndex {
const debug_view_source *source = view->source();
if (source != nullptr)
- return view->source_list().indexof(*source);
+ return view->source_index(*source);
else
return -1;
}
- (void)selectSubviewAtIndex:(int)index {
- const int selected = view->source_list().indexof(*view->source());
- if (selected != index) {
- view->set_source(*view->source_list().find(index));
- if ([[self window] firstResponder] != self)
- view->set_cursor_visible(false);
+ const int selected = [self selectedSubviewIndex];
+ if (selected != index)
+ {
+ const debug_view_source *source = view->source(index);
+ if (source != nullptr)
+ {
+ view->set_source(*source);
+ if ([[self window] firstResponder] != self)
+ view->set_cursor_visible(false);
+ }
}
}
@@ -155,23 +160,21 @@
- (BOOL)selectSubviewForSpace:(address_space *)space {
if (space == nullptr) return NO;
- debug_view_disasm_source const *source = downcast<debug_view_disasm_source const *>(view->first_source());
- while ((source != nullptr) && (&source->space() != space))
- source = downcast<debug_view_disasm_source *>(source->next());
- if (source != nullptr)
+ for (auto &ptr : view->source_list())
{
- if (view->source() != source)
+ debug_view_disasm_source const *const source = downcast<debug_view_disasm_source const *>(ptr.get());
+ if (&source->space() == space)
{
- view->set_source(*source);
- if ([[self window] firstResponder] != self)
- view->set_cursor_visible(false);
+ if (view->source() != source)
+ {
+ view->set_source(*source);
+ if ([[self window] firstResponder] != self)
+ view->set_cursor_visible(false);
+ }
+ return YES;
}
- return YES;
- }
- else
- {
- return NO;
}
+ return NO;
}
@@ -211,7 +214,7 @@
action:@selector(debugToggleBreakpointEnable:)
keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF9FunctionKey]
atIndex:index++];
- [disableItem setKeyEquivalentModifierMask:NSShiftKeyMask];
+ [disableItem setKeyEquivalentModifierMask:NSEventModifierFlagShift];
NSMenu *runMenu = [[menu itemWithTitle:@"Run"] submenu];
NSMenuItem *runItem;
@@ -256,12 +259,12 @@
- (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index {
- for (const debug_view_source *source = view->source_list().first(); source != nullptr; source = source->next())
+ for (auto &source : view->source_list())
{
[[menu insertItemWithTitle:[NSString stringWithUTF8String:source->name()]
action:NULL
keyEquivalent:@""
- atIndex:index++] setTag:view->source_list().indexof(*source)];
+ atIndex:index++] setTag:view->source_index(*source)];
}
if (index < [menu numberOfItems])
[menu insertItem:[NSMenuItem separatorItem] atIndex:index++];
@@ -271,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 eb039f4ca17..a0659c00cfc 100644
--- a/src/osd/modules/debugger/osx/disassemblyviewer.mm
+++ b/src/osd/modules/debugger/osx/disassemblyviewer.mm
@@ -16,6 +16,7 @@
#include "debugger.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
+#include "debug/points.h"
#include "util/xmlfile.h"
@@ -44,11 +45,9 @@
[expressionField sizeToFit];
// create the subview popup
- subviewButton = [[NSPopUpButton alloc] initWithFrame:NSOffsetRect(expressionFrame,
- expressionFrame.size.width,
- 0)];
+ subviewButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 19)];
[subviewButton setAutoresizingMask:(NSViewWidthSizable | NSViewMinXMargin | NSViewMinYMargin)];
- [subviewButton setBezelStyle:NSShadowlessSquareBezelStyle];
+ [subviewButton setBezelStyle:NSBezelStyleShadowlessSquare];
[subviewButton setFocusRingType:NSFocusRingTypeNone];
[subviewButton setFont:defaultFont];
[subviewButton setTarget:self];
@@ -109,7 +108,7 @@
[actionButton release];
// set default state
- [dasmView selectSubviewForDevice:machine->debugger().cpu().get_visible_cpu()];
+ [dasmView selectSubviewForDevice:machine->debugger().console().get_visible_cpu()];
[dasmView setExpression:@"curpc"];
[expressionField setStringValue:@"curpc"];
[expressionField selectText:self];
@@ -119,9 +118,11 @@
// calculate the optimal size for everything
NSSize const desired = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[dasmScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[dasmScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
[self cascadeWindowWithDesiredSize:desired forView:dasmScroll];
// don't forget the result
@@ -176,12 +177,12 @@
{
device_t &device = *[dasmView source]->device();
offs_t const address = [dasmView selectedAddress];
- const device_debug::breakpoint *bp = device.debug()->breakpoint_find(address);
+ const debug_breakpoint *bp = device.debug()->breakpoint_find(address);
// if it doesn't exist, add a new one
if (bp == nullptr)
{
- uint32_t const bpnum = device.debug()->breakpoint_set(address, nullptr, nullptr);
+ uint32_t const bpnum = device.debug()->breakpoint_set(address);
machine->debugger().console().printf("Breakpoint %X set\n", bpnum);
}
else
@@ -203,7 +204,7 @@
{
device_t &device = *[dasmView source]->device();
offs_t const address = [dasmView selectedAddress];
- const device_debug::breakpoint *bp = device.debug()->breakpoint_find(address);
+ const debug_breakpoint *bp = device.debug()->breakpoint_find(address);
if (bp != nullptr)
{
device.debug()->breakpoint_enable(bp->index(), !bp->enabled());
@@ -231,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]]];
@@ -252,7 +253,7 @@
BOOL const inContextMenu = ([item menu] == [dasmView menu]);
BOOL const haveCursor = [dasmView cursorVisible];
- const device_debug::breakpoint *breakpoint = nullptr;
+ const debug_breakpoint *breakpoint = nullptr;
if (haveCursor)
{
breakpoint = [dasmView source]->device()->debug()->breakpoint_find([dasmView selectedAddress]);
diff --git a/src/osd/modules/debugger/osx/errorlogviewer.mm b/src/osd/modules/debugger/osx/errorlogviewer.mm
index 1fd12c9c9c1..68d6f312b7c 100644
--- a/src/osd/modules/debugger/osx/errorlogviewer.mm
+++ b/src/osd/modules/debugger/osx/errorlogviewer.mm
@@ -43,11 +43,13 @@
// calculate the optimal size for everything
{
NSSize desired = [NSScrollView frameSizeForContentSize:[logView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[logScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[logScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
- // this thing starts with no content, so its prefered height may be very small
+ // this thing starts with no content, so its preferred height may be very small
desired.height = std::max(desired.height, CGFloat(240));
[self cascadeWindowWithDesiredSize:desired forView:logScroll];
}
@@ -64,7 +66,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/exceptionpointsview.h b/src/osd/modules/debugger/osx/exceptionpointsview.h
new file mode 100644
index 00000000000..73e3958c9b8
--- /dev/null
+++ b/src/osd/modules/debugger/osx/exceptionpointsview.h
@@ -0,0 +1,23 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+//============================================================
+//
+// exceptionpointsview.h - MacOS X Cocoa debug window handling
+//
+//============================================================
+
+#import "debugosx.h"
+
+#import "debugview.h"
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface MAMEExceptionpointsView : MAMEDebugView
+{
+}
+
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
+
+@end
diff --git a/src/osd/modules/debugger/osx/exceptionpointsview.mm b/src/osd/modules/debugger/osx/exceptionpointsview.mm
new file mode 100644
index 00000000000..c15f9c56f4f
--- /dev/null
+++ b/src/osd/modules/debugger/osx/exceptionpointsview.mm
@@ -0,0 +1,27 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+//============================================================
+//
+// exceptionpointsview.m - MacOS X Cocoa debug window handling
+//
+//============================================================
+
+#import "exceptionpointsview.h"
+
+#include "debug/debugvw.h"
+
+
+@implementation MAMEExceptionpointsView
+
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
+ if (!(self = [super initWithFrame:f type:DVT_EXCEPTION_POINTS machine:m wholeLineScroll:YES]))
+ return nil;
+ return self;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+@end
diff --git a/src/osd/modules/debugger/osx/memoryview.mm b/src/osd/modules/debugger/osx/memoryview.mm
index b2c512d094b..24521e81ba4 100644
--- a/src/osd/modules/debugger/osx/memoryview.mm
+++ b/src/osd/modules/debugger/osx/memoryview.mm
@@ -9,7 +9,6 @@
#include "emu.h"
#import "memoryview.h"
-#include "debug/debugcpu.h"
#include "debug/debugvw.h"
#include "util/xmlfile.h"
@@ -36,7 +35,7 @@
if (action == @selector(showChunkSize:))
{
- [item setState:((tag == memview->get_data_format()) ? NSOnState : NSOffState)];
+ [item setState:((tag == int(memview->get_data_format())) ? NSOnState : NSOffState)];
return YES;
}
else if (action == @selector(showPhysicalAddresses:))
@@ -58,6 +57,11 @@
{
return (memview->chunks_per_row() + [item tag]) > 0;
}
+ else if (action == @selector(showAddressRadix:))
+ {
+ [item setState:((memview->address_radix() == [item tag]) ? NSOnState : NSOffState)];
+ return YES;
+ }
else
{
return [super validateMenuItem:item];
@@ -68,7 +72,7 @@
- (NSSize)maximumFrameSize {
debug_view_xy max(0, 0);
debug_view_source const *source = view->source();
- for (debug_view_source const *source = view->first_source(); source != nullptr; source = source->next())
+ for (auto &source : view->source_list())
{
view->set_source(*source);
debug_view_xy const current = view->total_size();
@@ -101,19 +105,23 @@
- (int)selectedSubviewIndex {
debug_view_source const *source = view->source();
if (source != nullptr)
- return view->source_list().indexof(*source);
+ return view->source_index(*source);
else
return -1;
}
- (void)selectSubviewAtIndex:(int)index {
- int const selected = view->source_list().indexof(*view->source());
+ int const selected = [self selectedSubviewIndex];
if (selected != index)
{
- view->set_source(*view->source_list().find(index));
- if ([[self window] firstResponder] != self)
- view->set_cursor_visible(false);
+ const debug_view_source *source = view->source(index);
+ if (source != nullptr)
+ {
+ view->set_source(*source);
+ if ([[self window] firstResponder] != self)
+ view->set_cursor_visible(false);
+ }
}
}
@@ -139,23 +147,21 @@
- (BOOL)selectSubviewForSpace:(address_space *)space {
if (space == nullptr) return NO;
- debug_view_memory_source const *source = downcast<debug_view_memory_source const *>(view->first_source());
- while ((source != nullptr) && (source->space() != space))
- source = downcast<debug_view_memory_source *>(source->next());
- if (source != nullptr)
+ for (auto &ptr : view->source_list())
{
- if (view->source() != source)
+ debug_view_memory_source const *const source = downcast<debug_view_memory_source const *>(ptr.get());
+ if (source->space() == space)
{
- view->set_source(*source);
- if ([[self window] firstResponder] != self)
- view->set_cursor_visible(false);
+ if (view->source() != source)
+ {
+ view->set_source(*source);
+ if ([[self window] firstResponder] != self)
+ view->set_cursor_visible(false);
+ }
+ return YES;
}
- return YES;
- }
- else
- {
- return NO;
}
+ return NO;
}
@@ -175,7 +181,7 @@
- (IBAction)showChunkSize:(id)sender {
- downcast<debug_view_memory *>(view)->set_data_format([sender tag]);
+ downcast<debug_view_memory *>(view)->set_data_format(debug_view_memory::data_format([sender tag]));
}
@@ -183,6 +189,9 @@
downcast<debug_view_memory *>(view)->set_physical([sender tag]);
}
+- (IBAction)showAddressRadix:(id)sender {
+ downcast<debug_view_memory *>(view)->set_address_radix([sender tag]);
+}
- (IBAction)showReverseView:(id)sender {
downcast<debug_view_memory *>(view)->set_reverse([sender tag]);
@@ -203,55 +212,125 @@
- (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", 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(node->get_attribute_int("dataformat", 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()));
}
- (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index {
- NSInteger tag;
- for (tag = 1; tag <= 8; tag <<= 1) {
- NSString *title = [NSString stringWithFormat:@"%ld-byte Chunks", (long)tag];
- NSMenuItem *chunkItem = [menu insertItemWithTitle:title
- action:@selector(showChunkSize:)
- keyEquivalent:[NSString stringWithFormat:@"%ld", (long)tag]
- atIndex:index++];
- [chunkItem setTarget:self];
- [chunkItem setTag:tag];
- }
+ NSMenuItem *chunkItem1 = [menu insertItemWithTitle:@"1-byte Chunks (Hex)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"1"
+ atIndex:index++];
+ [chunkItem1 setTarget:self];
+ [chunkItem1 setTag:int(debug_view_memory::data_format::HEX_8BIT)];
- NSMenuItem *chunkItem = [menu insertItemWithTitle:@"32-bit floats"
- action:@selector(showChunkSize:)
- keyEquivalent:@"F"
- atIndex:index++];
- [chunkItem setTarget:self];
- [chunkItem setTag:9];
-
- NSMenuItem *chunkItem2 = [menu insertItemWithTitle:@"64-bit floats"
- action:@selector(showChunkSize:)
- keyEquivalent:@"D"
- atIndex:index++];
+ NSMenuItem *chunkItem2 = [menu insertItemWithTitle:@"2-byte Chunks (Hex)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"2"
+ atIndex:index++];
[chunkItem2 setTarget:self];
- [chunkItem2 setTag:10];
+ [chunkItem2 setTag:int(debug_view_memory::data_format::HEX_16BIT)];
+
+ NSMenuItem *chunkItem4 = [menu insertItemWithTitle:@"4-byte Chunks (Hex)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"4"
+ atIndex:index++];
+ [chunkItem4 setTarget:self];
+ [chunkItem4 setTag:int(debug_view_memory::data_format::HEX_32BIT)];
+
+ NSMenuItem *chunkItem8 = [menu insertItemWithTitle:@"8-byte Chunks (Hex)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"8"
+ atIndex:index++];
+ [chunkItem8 setTarget:self];
+ [chunkItem8 setTag:int(debug_view_memory::data_format::HEX_64BIT)];
+
+ NSMenuItem *chunkItem12 = [menu insertItemWithTitle:@"1-byte Chunks (Octal)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"3"
+ atIndex:index++];
+ [chunkItem12 setTarget:self];
+ [chunkItem12 setTag:int(debug_view_memory::data_format::OCTAL_8BIT)];
+
+ NSMenuItem *chunkItem13 = [menu insertItemWithTitle:@"2-byte Chunks (Octal)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"5"
+ atIndex:index++];
+ [chunkItem13 setTarget:self];
+ [chunkItem13 setTag:int(debug_view_memory::data_format::OCTAL_16BIT)];
+
+ NSMenuItem *chunkItem14 = [menu insertItemWithTitle:@"4-byte Chunks (Octal)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"7"
+ atIndex:index++];
+ [chunkItem14 setTarget:self];
+ [chunkItem14 setTag:int(debug_view_memory::data_format::OCTAL_32BIT)];
+
+ NSMenuItem *chunkItem15 = [menu insertItemWithTitle:@"8-byte Chunks (Octal)"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"9"
+ atIndex:index++];
+ [chunkItem15 setTarget:self];
+ [chunkItem15 setTag:int(debug_view_memory::data_format::OCTAL_64BIT)];
+
+ NSMenuItem *chunkItem9 = [menu insertItemWithTitle:@"32-bit Floating Point"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"F"
+ atIndex:index++];
+ [chunkItem9 setTarget:self];
+ [chunkItem9 setTag:int(debug_view_memory::data_format::FLOAT_32BIT)];
+
+ NSMenuItem *chunkItem10 = [menu insertItemWithTitle:@"64-bit Floating Point"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"D"
+ atIndex:index++];
+ [chunkItem10 setTarget:self];
+ [chunkItem10 setTag:int(debug_view_memory::data_format::FLOAT_64BIT)];
+
+ NSMenuItem *chunkItem11 = [menu insertItemWithTitle:@"80-bit Floating Point"
+ action:@selector(showChunkSize:)
+ keyEquivalent:@"E"
+ atIndex:index++];
+ [chunkItem11 setTarget:self];
+ [chunkItem11 setTag:int(debug_view_memory::data_format::FLOAT_80BIT)];
+
+ [menu insertItem:[NSMenuItem separatorItem] atIndex:index++];
+
+ NSMenuItem *hexadecimalItem = [menu insertItemWithTitle:@"Hexadecimal Addresses"
+ action:@selector(showAddressRadix:)
+ keyEquivalent:@"H"
+ atIndex:index++];
+ [hexadecimalItem setTarget:self];
+ [hexadecimalItem setTag:16];
+
+ NSMenuItem *decimalItem = [menu insertItemWithTitle:@"Decimal Addresses"
+ action:@selector(showAddressRadix:)
+ keyEquivalent:@""
+ atIndex:index++];
+ [decimalItem setTarget:self];
+ [decimalItem setTag:10];
- NSMenuItem *chunkItem3 = [menu insertItemWithTitle:@"80-bit floats"
- action:@selector(showChunkSize:)
- keyEquivalent:@"E"
- atIndex:index++];
- [chunkItem3 setTarget:self];
- [chunkItem3 setTag:11];
+ NSMenuItem *octalItem = [menu insertItemWithTitle:@"Octal Addresses"
+ action:@selector(showAddressRadix:)
+ keyEquivalent:@"O"
+ atIndex:index++];
+ [octalItem setTarget:self];
+ [octalItem setTag:8];
[menu insertItem:[NSMenuItem separatorItem] atIndex:index++];
@@ -299,12 +378,12 @@
- (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index {
- for (const debug_view_source *source = view->source_list().first(); source != nullptr; source = source->next())
+ for (auto &source : view->source_list())
{
[[menu insertItemWithTitle:[NSString stringWithUTF8String:source->name()]
action:NULL
keyEquivalent:@""
- atIndex:index++] setTag:view->source_list().indexof(*source)];
+ atIndex:index++] setTag:view->source_index(*source)];
}
if (index < [menu numberOfItems])
[menu insertItem:[NSMenuItem separatorItem] atIndex:index++];
diff --git a/src/osd/modules/debugger/osx/memoryviewer.mm b/src/osd/modules/debugger/osx/memoryviewer.mm
index 80d5434a826..1d45650dcbb 100644
--- a/src/osd/modules/debugger/osx/memoryviewer.mm
+++ b/src/osd/modules/debugger/osx/memoryviewer.mm
@@ -14,7 +14,7 @@
#import "memoryview.h"
#include "debugger.h"
-#include "debug/debugcpu.h"
+#include "debug/debugcon.h"
#include "debug/dvmemory.h"
#include "util/xmlfile.h"
@@ -46,7 +46,7 @@
// create the subview popup
subviewButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 19)];
[subviewButton setAutoresizingMask:(NSViewWidthSizable | NSViewMinXMargin | NSViewMinYMargin)];
- [subviewButton setBezelStyle:NSShadowlessSquareBezelStyle];
+ [subviewButton setBezelStyle:NSBezelStyleShadowlessSquare];
[subviewButton setFocusRingType:NSFocusRingTypeNone];
[subviewButton setFont:defaultFont];
[subviewButton setTarget:self];
@@ -108,7 +108,7 @@
[actionButton release];
// set default state
- [memoryView selectSubviewForDevice:machine->debugger().cpu().get_visible_cpu()];
+ [memoryView selectSubviewForDevice:machine->debugger().console().get_visible_cpu()];
[memoryView setExpression:@"0"];
[expressionField setStringValue:@"0"];
[expressionField selectText:self];
@@ -118,9 +118,11 @@
// calculate the optimal size for everything
NSSize const desired = [NSScrollView frameSizeForContentSize:[memoryView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[memoryScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[memoryScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
[self cascadeWindowWithDesiredSize:desired forView:memoryScroll];
// don't forget the result
@@ -178,15 +180,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 8bd4dad3a1b..0fafe35a799 100644
--- a/src/osd/modules/debugger/osx/pointsviewer.mm
+++ b/src/osd/modules/debugger/osx/pointsviewer.mm
@@ -10,6 +10,8 @@
#import "pointsviewer.h"
#import "breakpointsview.h"
+#import "exceptionpointsview.h"
+#import "registerpointsview.h"
#import "watchpointsview.h"
#include "util/xmlfile.h"
@@ -18,9 +20,9 @@
@implementation MAMEPointsViewer
- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c {
- MAMEDebugView *breakView, *watchView;
- NSScrollView *breakScroll, *watchScroll;
- NSTabViewItem *breakTab, *watchTab;
+ MAMEDebugView *breakView, *watchView, *registerView, *exceptionView;
+ NSScrollView *breakScroll, *watchScroll, *registerScroll, *exceptionScroll;
+ NSTabViewItem *breakTab, *watchTab, *registerTab, *exceptionTab;
NSPopUpButton *actionButton;
NSRect subviewFrame;
@@ -32,7 +34,7 @@
// create the subview popup
subviewButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 19)];
[subviewButton setAutoresizingMask:(NSViewWidthSizable | NSViewMinYMargin)];
- [subviewButton setBezelStyle:NSShadowlessSquareBezelStyle];
+ [subviewButton setBezelStyle:NSBezelStyleShadowlessSquare];
[subviewButton setFocusRingType:NSFocusRingTypeNone];
[subviewButton setFont:defaultFont];
[subviewButton setTarget:self];
@@ -44,6 +46,12 @@
[[[subviewButton menu] addItemWithTitle:@"All Watchpoints"
action:NULL
keyEquivalent:@""] setTag:1];
+ [[[subviewButton menu] addItemWithTitle:@"All Registerpoints"
+ action:NULL
+ keyEquivalent:@""] setTag:2];
+ [[[subviewButton menu] addItemWithTitle:@"All Exceptionpoints"
+ action:NULL
+ keyEquivalent:@""] setTag:3];
[subviewButton sizeToFit];
subviewFrame = [subviewButton frame];
subviewFrame.origin.x = subviewFrame.size.height;
@@ -82,7 +90,7 @@
[breakTab setView:breakScroll];
[breakScroll release];
- // create the breakpoints view
+ // create the watchpoints view
watchView = [[MAMEWatchpointsView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
machine:*machine];
watchScroll = [[NSScrollView alloc] initWithFrame:[breakScroll frame]];
@@ -98,7 +106,39 @@
[watchTab setView:watchScroll];
[watchScroll release];
- // create a tabless tabview for the two subviews
+ // create the registerpoints view
+ registerView = [[MAMERegisterpointsView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
+ machine:*machine];
+ registerScroll = [[NSScrollView alloc] initWithFrame:[breakScroll frame]];
+ [registerScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+ [registerScroll setHasHorizontalScroller:YES];
+ [registerScroll setHasVerticalScroller:YES];
+ [registerScroll setAutohidesScrollers:YES];
+ [registerScroll setBorderType:NSNoBorder];
+ [registerScroll setDrawsBackground:NO];
+ [registerScroll setDocumentView:registerView];
+ [registerView release];
+ registerTab = [[NSTabViewItem alloc] initWithIdentifier:@""];
+ [registerTab setView:registerScroll];
+ [registerScroll release];
+
+ // create the exceptionpoints view
+ exceptionView = [[MAMEExceptionpointsView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
+ machine:*machine];
+ exceptionScroll = [[NSScrollView alloc] initWithFrame:[breakScroll frame]];
+ [exceptionScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+ [exceptionScroll setHasHorizontalScroller:YES];
+ [exceptionScroll setHasVerticalScroller:YES];
+ [exceptionScroll setAutohidesScrollers:YES];
+ [exceptionScroll setBorderType:NSNoBorder];
+ [exceptionScroll setDrawsBackground:NO];
+ [exceptionScroll setDocumentView:exceptionView];
+ [exceptionView release];
+ exceptionTab = [[NSTabViewItem alloc] initWithIdentifier:@""];
+ [exceptionTab setView:exceptionScroll];
+ [exceptionScroll release];
+
+ // create a tabless tabview for the four subviews
tabs = [[NSTabView alloc] initWithFrame:[breakScroll frame]];
[tabs setTabViewType:NSNoTabsNoBorder];
[tabs setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
@@ -106,6 +146,10 @@
[breakTab release];
[tabs addTabViewItem:watchTab];
[watchTab release];
+ [tabs addTabViewItem:registerTab];
+ [registerTab release];
+ [tabs addTabViewItem:exceptionTab];
+ [exceptionTab release];
[[window contentView] addSubview:tabs];
[tabs release];
@@ -117,15 +161,31 @@
// calculate the optimal size for everything
NSSize const breakDesired = [NSScrollView frameSizeForContentSize:[breakView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[breakScroll borderType]];
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[breakScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
NSSize const watchDesired = [NSScrollView frameSizeForContentSize:[watchView maximumFrameSize]
- hasHorizontalScroller:YES
- hasVerticalScroller:YES
- borderType:[watchScroll borderType]];
- NSSize const desired = NSMakeSize(std::max(breakDesired.width, watchDesired.width),
- std::max(breakDesired.height, watchDesired.height));
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[watchScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
+ NSSize const registerDesired = [NSScrollView frameSizeForContentSize:[registerView maximumFrameSize]
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[registerScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
+ NSSize const exceptionDesired = [NSScrollView frameSizeForContentSize:[exceptionView maximumFrameSize]
+ horizontalScrollerClass:[NSScroller class]
+ verticalScrollerClass:[NSScroller class]
+ borderType:[exceptionScroll borderType]
+ controlSize:NSControlSizeRegular
+ scrollerStyle:NSScrollerStyleOverlay];
+ NSSize const desired = NSMakeSize(std::max({ breakDesired.width, watchDesired.width, registerDesired.width, exceptionDesired.width }),
+ std::max({ breakDesired.height, watchDesired.height, registerDesired.height, exceptionDesired.height }));
[self cascadeWindowWithDesiredSize:desired forView:tabs];
// don't forget the result
@@ -146,14 +206,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/osx/registerpointsview.h b/src/osd/modules/debugger/osx/registerpointsview.h
new file mode 100644
index 00000000000..58faf954416
--- /dev/null
+++ b/src/osd/modules/debugger/osx/registerpointsview.h
@@ -0,0 +1,23 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+//============================================================
+//
+// registerpointsview.h - MacOS X Cocoa debug window handling
+//
+//============================================================
+
+#import "debugosx.h"
+
+#import "debugview.h"
+
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface MAMERegisterpointsView : MAMEDebugView
+{
+}
+
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
+
+@end
diff --git a/src/osd/modules/debugger/osx/registerpointsview.mm b/src/osd/modules/debugger/osx/registerpointsview.mm
new file mode 100644
index 00000000000..a701fe733ce
--- /dev/null
+++ b/src/osd/modules/debugger/osx/registerpointsview.mm
@@ -0,0 +1,27 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb
+//============================================================
+//
+// registerpointsview.m - MacOS X Cocoa debug window handling
+//
+//============================================================
+
+#import "registerpointsview.h"
+
+#include "debug/debugvw.h"
+
+
+@implementation MAMERegisterpointsView
+
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
+ if (!(self = [super initWithFrame:f type:DVT_REGISTER_POINTS machine:m wholeLineScroll:YES]))
+ return nil;
+ return self;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+@end
diff --git a/src/osd/modules/debugger/osx/registersview.mm b/src/osd/modules/debugger/osx/registersview.mm
index 5c3e00a2b89..c710179c5bd 100644
--- a/src/osd/modules/debugger/osx/registersview.mm
+++ b/src/osd/modules/debugger/osx/registersview.mm
@@ -10,7 +10,7 @@
#include "emu.h"
#include "debugger.h"
-#include "debug/debugcpu.h"
+#include "debug/debugcon.h"
#include "debug/debugvw.h"
@@ -30,11 +30,11 @@
- (NSSize)maximumFrameSize {
debug_view_xy max;
- device_t *curcpu = machine->debugger().cpu().get_visible_cpu();
+ device_t *curcpu = machine->debugger().console().get_visible_cpu();
const debug_view_source *source = view->source_for_device(curcpu);
max.x = max.y = 0;
- for (const debug_view_source *source = view->source_list().first(); source != nullptr; source = source->next())
+ for (auto &source : view->source_list())
{
debug_view_xy current;
view->set_source(*source);