Previous 199869 Revisions Next

r35087 Tuesday 17th February, 2015 at 06:32:25 UTC by Vasantha Crabb
Add devices window to cocoa debugger
[src/osd/modules/debugger]debugosx.m
[src/osd/modules/debugger/osx]breakpointsview.h breakpointsview.m consoleview.h consoleview.m debugcommandhistory.h debugcommandhistory.m debugconsole.h debugconsole.m debugosx.h debugview.h debugview.m debugwindowhandler.h debugwindowhandler.m devicesviewer.h* devicesviewer.m* disassemblyview.h disassemblyview.m disassemblyviewer.h disassemblyviewer.m errorlogview.h errorlogview.m errorlogviewer.h errorlogviewer.m memoryview.h memoryview.m memoryviewer.h memoryviewer.m pointsviewer.h pointsviewer.m registersview.h registersview.m watchpointsview.h watchpointsview.m
[src/osd/sdl]sdl.mak

trunk/src/osd/modules/debugger/debugosx.m
r243598r243599
1212
1313// TODO:
1414//  * Automatic scrolling for console and log views
15//  * Keyboard shortcuts in error log windows
15//  * Keyboard shortcuts in error log and devices windows
1616//  * Don't accept keyboard input while the game is running
1717//  * Interior focus rings - standard/exterior focus rings look really ugly here
1818//  * Improve automatic window sizing - it isn't working all that well
trunk/src/osd/modules/debugger/osx/breakpointsview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxbreakpointsview.h - MacOS X Cocoa debug window handling
5//  breakpointsview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/breakpointsview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxbreakpointsview.m - MacOS X Cocoa debug window handling
5//  breakpointsview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/consoleview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxconsoleview.h - MacOS X Cocoa debug window handling
5//  consoleview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/consoleview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxconsoleview.m - MacOS X Cocoa debug window handling
5//  consoleview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/debugcommandhistory.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugcommandhistory.h - MacOS X Cocoa debug window handling
5//  debugcommandhistory.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/debugcommandhistory.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugcommandhistory.m - MacOS X Cocoa debug window handling
5//  debugcommandhistory.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/debugconsole.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugconsole.h - MacOS X Cocoa debug window handling
5//  debugconsole.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
r243598r243599
4141- (IBAction)debugNewDisassemblyWindow:(id)sender;
4242- (IBAction)debugNewErrorLogWindow:(id)sender;
4343- (IBAction)debugNewPointsWindow:(id)sender;
44- (IBAction)debugNewDevicesWindow:(id)sender;
4445
4546- (void)debugNewMemoryWindowForSpace:(address_space *)space device:(device_t *)device expression:(NSString *)expression;
4647- (void)debugNewDisassemblyWindowForSpace:(address_space *)space device:(device_t *)device expression:(NSString *)expression;
trunk/src/osd/modules/debugger/osx/debugconsole.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugconsole.m - MacOS X Cocoa debug window handling
5//  debugconsole.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
r243598r243599
1414#import "debugcommandhistory.h"
1515#import "consoleview.h"
1616#import "debugview.h"
17#import "devicesviewer.h"
1718#import "disassemblyview.h"
1819#import "disassemblyviewer.h"
1920#import "errorlogviewer.h"
r243598r243599
258259}
259260
260261
262- (IBAction)debugNewDevicesWindow:(id)sender {
263   MAMEDevicesViewer *win = [[MAMEDevicesViewer alloc] initWithMachine:*machine console:self];
264   [auxiliaryWindows addObject:win];
265   [win release];
266   [win activate];
267}
268
269
261270- (void)debugNewMemoryWindowForSpace:(address_space *)space device:(device_t *)device expression:(NSString *)expression {
262271   MAMEMemoryViewer *win = [[MAMEMemoryViewer alloc] initWithMachine:*machine console:self];
263272   [auxiliaryWindows addObject:win];
trunk/src/osd/modules/debugger/osx/debugosx.h
r243598r243599
4646@protocol NSTextFieldDelegate <NSControlTextEditingDelegate>
4747@end
4848
49@protocol NSOutlineViewDataSource <NSObject>
50@end
51
4952#endif // MAC_OS_X_VERSION_MAX_ALLOWED < 1060
5053
5154#endif // MAC_OS_X_VERSION_MAX_ALLOWED
trunk/src/osd/modules/debugger/osx/debugview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugview.h - MacOS X Cocoa debug window handling
5//  debugview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/debugview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugview.h - MacOS X Cocoa debug window handling
5//  debugview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/debugwindowhandler.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugwindowhandler.h - MacOS X Cocoa debug window handling
5//  debugwindowhandler.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
r243598r243599
7272- (IBAction)debugNewDisassemblyWindow:(id)sender;
7373- (IBAction)debugNewErrorLogWindow:(id)sender;
7474- (IBAction)debugNewPointsWindow:(id)sender;
75- (IBAction)debugNewDevicesWindow:(id)sender;
7576
7677- (void)windowWillClose:(NSNotification *)notification;
7778
trunk/src/osd/modules/debugger/osx/debugwindowhandler.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdebugwindowhandler.m - MacOS X Cocoa debug window handling
5//  debugwindowhandler.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
r243598r243599
3333@implementation MAMEDebugWindowHandler
3434
3535+ (void)addCommonActionItems:(NSMenu *)menu {
36   {
37      NSMenuItem *runParentItem = [menu addItemWithTitle:@"Run"
38                                       action:@selector(debugRun:)
39                                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF5FunctionKey]];
40      NSMenu *runMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Run"];
41      [runParentItem setSubmenu:runMenu];
42      [runMenu release];
43      [runParentItem setKeyEquivalentModifierMask:0];
44      [[runMenu addItemWithTitle:@"and Hide Debugger"
45                     action:@selector(debugRunAndHide:)
46                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF12FunctionKey]]
47       setKeyEquivalentModifierMask:0];
48      [[runMenu addItemWithTitle:@"to Next CPU"
49                     action:@selector(debugRunToNextCPU:)
50                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF6FunctionKey]]
51       setKeyEquivalentModifierMask:0];
52      [[runMenu addItemWithTitle:@"until Next Interrupt on Current CPU"
53                     action:@selector(debugRunToNextInterrupt:)
54                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF7FunctionKey]]
55       setKeyEquivalentModifierMask:0];
56      [[runMenu addItemWithTitle:@"until Next VBLANK"
57                     action:@selector(debugRunToNextVBLANK:)
58                keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF8FunctionKey]]
59       setKeyEquivalentModifierMask:0];
60   }
61   {
62      NSMenuItem *stepParentItem = [menu addItemWithTitle:@"Step" action:NULL keyEquivalent:@""];
63      NSMenu *stepMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Step"];
64      [stepParentItem setSubmenu:stepMenu];
65      [stepMenu release];
66      [[stepMenu addItemWithTitle:@"Into"
67                      action:@selector(debugStepInto:)
68                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF11FunctionKey]]
69       setKeyEquivalentModifierMask:0];
70      [[stepMenu addItemWithTitle:@"Over"
71                      action:@selector(debugStepOver:)
72                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
73       setKeyEquivalentModifierMask:0];
74      [[stepMenu addItemWithTitle:@"Out"
75                      action:@selector(debugStepOut:)
76                 keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
77       setKeyEquivalentModifierMask:NSShiftKeyMask];
78   }
79   {
80      NSMenuItem *resetParentItem = [menu addItemWithTitle:@"Reset" action:NULL keyEquivalent:@""];
81      NSMenu *resetMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Reset"];
82      [resetParentItem setSubmenu:resetMenu];
83      [resetMenu release];
84      [[resetMenu addItemWithTitle:@"Soft"
85                       action:@selector(debugSoftReset:)
86                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
87       setKeyEquivalentModifierMask:0];
88      [[resetMenu addItemWithTitle:@"Hard"
89                       action:@selector(debugHardReset:)
90                  keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
91       setKeyEquivalentModifierMask:NSShiftKeyMask];
92   }
36   NSMenuItem *runParentItem = [menu addItemWithTitle:@"Run"
37                                    action:@selector(debugRun:)
38                               keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF5FunctionKey]];
39   NSMenu *runMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Run"];
40   [runParentItem setSubmenu:runMenu];
41   [runMenu release];
42   [runParentItem setKeyEquivalentModifierMask:0];
43   [[runMenu addItemWithTitle:@"and Hide Debugger"
44                  action:@selector(debugRunAndHide:)
45             keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF12FunctionKey]]
46    setKeyEquivalentModifierMask:0];
47   [[runMenu addItemWithTitle:@"to Next CPU"
48                  action:@selector(debugRunToNextCPU:)
49             keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF6FunctionKey]]
50    setKeyEquivalentModifierMask:0];
51   [[runMenu addItemWithTitle:@"until Next Interrupt on Current CPU"
52                  action:@selector(debugRunToNextInterrupt:)
53             keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF7FunctionKey]]
54    setKeyEquivalentModifierMask:0];
55   [[runMenu addItemWithTitle:@"until Next VBLANK"
56                  action:@selector(debugRunToNextVBLANK:)
57             keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF8FunctionKey]]
58    setKeyEquivalentModifierMask:0];
59
60   NSMenuItem *stepParentItem = [menu addItemWithTitle:@"Step" action:NULL keyEquivalent:@""];
61   NSMenu *stepMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Step"];
62   [stepParentItem setSubmenu:stepMenu];
63   [stepMenu release];
64   [[stepMenu addItemWithTitle:@"Into"
65                   action:@selector(debugStepInto:)
66              keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF11FunctionKey]]
67    setKeyEquivalentModifierMask:0];
68   [[stepMenu addItemWithTitle:@"Over"
69                   action:@selector(debugStepOver:)
70              keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
71    setKeyEquivalentModifierMask:0];
72   [[stepMenu addItemWithTitle:@"Out"
73                   action:@selector(debugStepOut:)
74              keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF10FunctionKey]]
75    setKeyEquivalentModifierMask:NSShiftKeyMask];
76
77   NSMenuItem *resetParentItem = [menu addItemWithTitle:@"Reset" action:NULL keyEquivalent:@""];
78   NSMenu *resetMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Reset"];
79   [resetParentItem setSubmenu:resetMenu];
80   [resetMenu release];
81   [[resetMenu addItemWithTitle:@"Soft"
82                    action:@selector(debugSoftReset:)
83               keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
84    setKeyEquivalentModifierMask:0];
85   [[resetMenu addItemWithTitle:@"Hard"
86                    action:@selector(debugHardReset:)
87               keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF3FunctionKey]]
88    setKeyEquivalentModifierMask:NSShiftKeyMask];
89
9390   [menu addItem:[NSMenuItem separatorItem]];
94   {
95      NSMenuItem *newParentItem = [menu addItemWithTitle:@"New" action:NULL keyEquivalent:@""];
96      NSMenu *newMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"New"];
97      [newParentItem setSubmenu:newMenu];
98      [newMenu release];
99      [newMenu addItemWithTitle:@"Memory Window"
100                     action:@selector(debugNewMemoryWindow:)
101               keyEquivalent:@"d"];
102      [newMenu addItemWithTitle:@"Disassembly Window"
103                     action:@selector(debugNewDisassemblyWindow:)
104               keyEquivalent:@"a"];
105      [newMenu addItemWithTitle:@"Error Log Window"
106                     action:@selector(debugNewErrorLogWindow:)
107               keyEquivalent:@"l"];
108      [newMenu addItemWithTitle:@"(Break|Watch)points Window"
109                     action:@selector(debugNewPointsWindow:)
110               keyEquivalent:@"b"];
111   }
91
92   NSMenuItem *newParentItem = [menu addItemWithTitle:@"New" action:NULL keyEquivalent:@""];
93   NSMenu *newMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"New"];
94   [newParentItem setSubmenu:newMenu];
95   [newMenu release];
96   [newMenu addItemWithTitle:@"Memory Window"
97                  action:@selector(debugNewMemoryWindow:)
98            keyEquivalent:@"d"];
99   [newMenu addItemWithTitle:@"Disassembly Window"
100                  action:@selector(debugNewDisassemblyWindow:)
101            keyEquivalent:@"a"];
102   [newMenu addItemWithTitle:@"Error Log Window"
103                  action:@selector(debugNewErrorLogWindow:)
104            keyEquivalent:@"l"];
105   [newMenu addItemWithTitle:@"(Break|Watch)points Window"
106                  action:@selector(debugNewPointsWindow:)
107            keyEquivalent:@"b"];
108   [newMenu addItemWithTitle:@"Devices Window"
109                  action:@selector(debugNewDevicesWindow:)
110            keyEquivalent:@"D"];
111
112112   [menu addItem:[NSMenuItem separatorItem]];
113
113114   [menu addItemWithTitle:@"Close Window" action:@selector(performClose:) keyEquivalent:@"w"];
114   [menu addItemWithTitle:@"Exit" action:@selector(debugExit:) keyEquivalent:@""];
115   [menu addItemWithTitle:@"Quit" action:@selector(debugExit:) keyEquivalent:@"q"];
115116}
116117
117118
r243598r243599
298299}
299300
300301
302- (IBAction)debugNewDevicesWindow:(id)sender {
303   [console debugNewDevicesWindow:sender];
304}
305
306
301307- (void)windowWillClose:(NSNotification *)notification {
302308   [[NSNotificationCenter defaultCenter] postNotificationName:MAMEAuxiliaryDebugWindowWillCloseNotification
303309                                          object:self];
r243598r243599
314320   windowFrame.size.width += desired.width;
315321   windowFrame.size.width = MIN(windowFrame.size.width, available.size.width);
316322   windowFrame.size.height += desired.height;
317   windowFrame.size.height = MIN(MIN(windowFrame.size.height, 240), available.size.height);
323   windowFrame.size.height = MIN(MIN(windowFrame.size.height, 320), available.size.height);
318324   windowFrame.origin.x = available.origin.x + available.size.width - windowFrame.size.width;
319325   windowFrame.origin.y = available.origin.y;
320326   [window setFrame:windowFrame display:YES];
trunk/src/osd/modules/debugger/osx/devicesviewer.h
r0r243599
1// license:BSD-3-Clause
2// copyright-holders:Vas Crabb
3//============================================================
4//
5//  devicesviewer.h - MacOS X Cocoa debug window handling
6//
7//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
8//  Visit http://mamedev.org for licensing and usage restrictions.
9//
10//============================================================
11
12#import "debugosx.h"
13
14#import "debugwindowhandler.h"
15
16#include "emu.h"
17
18#import <Cocoa/Cocoa.h>
19
20
21@class MAMEDebugConsole, MAMEDeviceWrapper;
22
23@interface MAMEDevicesViewer : MAMEAuxiliaryDebugWindowHandler <NSOutlineViewDataSource>
24{
25   MAMEDeviceWrapper   *root;
26   NSOutlineView      *devicesView;
27}
28
29- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c;
30
31@end
trunk/src/osd/modules/debugger/osx/devicesviewer.m
r0r243599
1// license:BSD-3-Clause
2// copyright-holders:Vas Crabb
3//============================================================
4//
5//  devicesviewer.m - MacOS X Cocoa debug window handling
6//
7//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
8//  Visit http://mamedev.org for licensing and usage restrictions.
9//
10//============================================================
11
12#import "devicesviewer.h"
13
14
15@interface MAMEDeviceWrapper : NSObject
16{
17   running_machine   *machine;
18   device_t      *device;
19   NSArray         *children;
20}
21
22- (id)initWithMachine:(running_machine &)m device:(device_t &)d;
23
24- (running_machine &)machine;
25- (device_t &)device;
26- (NSString *)tag;
27- (NSString *)name;
28- (NSUInteger)children;
29- (MAMEDeviceWrapper *)childAtIndex:(NSUInteger)index;
30
31@end
32
33
34@implementation MAMEDeviceWrapper
35
36- (void)wrapChildren {
37   NSMutableArray *const tmp = [[NSMutableArray alloc] init];
38   for (device_t *child = device->first_subdevice(); child != NULL; child = child->next())
39   {
40      MAMEDeviceWrapper *const wrap = [[MAMEDeviceWrapper alloc] initWithMachine:*machine
41                                                         device:*child];
42      [tmp addObject:wrap];
43      [wrap release];
44   }
45   children = [[NSArray alloc] initWithArray:tmp];
46   [tmp release];
47}
48
49
50- (id)initWithMachine:(running_machine &)m device:(device_t &)d {
51   if (!(self = [super init]))
52      return nil;
53   machine = &m;
54   device = &d;
55   children = nil;
56   return self;
57}
58
59
60- (void)dealloc {
61   if (children != nil)
62      [children release];
63   [super dealloc];
64}
65
66
67- (running_machine &)machine {
68   return *machine;
69}
70
71
72- (device_t &)device {
73   return *device;
74}
75
76
77- (NSString *)tag {
78   return (device == &machine->root_device()) ? @"<root>"
79                                    : [NSString stringWithUTF8String:device->basetag()];
80}
81
82
83- (NSString *)name {
84   return [NSString stringWithUTF8String:device->name()];
85}
86
87
88- (NSUInteger)children {
89   if (children == nil)
90      [self wrapChildren];
91   return [children count];
92}
93
94
95- (MAMEDeviceWrapper *)childAtIndex:(NSUInteger)index {
96   if (children == nil)
97      [self wrapChildren];
98   return (index < [children count]) ? [children objectAtIndex:index] : nil;
99}
100
101@end
102
103
104@implementation MAMEDevicesViewer
105
106- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c {
107   NSScrollView   *devicesScroll;
108   NSTableColumn   *tagColumn, *nameColumn;
109
110   if (!(self = [super initWithMachine:m title:@"All Devices" console:c]))
111      return nil;
112   root = [[MAMEDeviceWrapper alloc] initWithMachine:m device:m.root_device()];
113
114   // create the devices view
115   devicesView = [[NSOutlineView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
116   [devicesView setUsesAlternatingRowBackgroundColors:YES];
117   [devicesView setAllowsColumnReordering:YES];
118   [devicesView setAllowsColumnResizing:YES];
119   [devicesView setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle];
120   [devicesView setAllowsEmptySelection:YES];
121   [devicesView setAllowsMultipleSelection:NO];
122   [devicesView setAllowsColumnSelection:NO];
123   tagColumn = [[NSTableColumn alloc] initWithIdentifier:@"tag"];
124   [[tagColumn headerCell] setStringValue:@"Tag"];
125   [tagColumn setEditable:NO];
126   [tagColumn setMinWidth:100];
127   [tagColumn setWidth:120];
128   [tagColumn setResizingMask:(NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask)];
129   [devicesView addTableColumn:tagColumn];
130   [tagColumn release];
131   nameColumn = [[NSTableColumn alloc] initWithIdentifier:@"name"];
132   [[nameColumn headerCell] setStringValue:@"Name"];
133   [nameColumn setEditable:NO];
134   [nameColumn setMinWidth:100];
135   [nameColumn setMinWidth:360];
136   [nameColumn setResizingMask:(NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask)];
137   [devicesView addTableColumn:nameColumn];
138   [nameColumn release];
139   [devicesView setOutlineTableColumn:tagColumn];
140   [devicesView setAutoresizesOutlineColumn:YES];
141   [devicesView setDataSource:self];
142   devicesScroll = [[NSScrollView alloc] initWithFrame:[[window contentView] bounds]];
143   [devicesScroll setDrawsBackground:YES];
144   [devicesScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
145   [devicesScroll setHasHorizontalScroller:YES];
146   [devicesScroll setHasVerticalScroller:YES];
147   [devicesScroll setAutohidesScrollers:YES];
148   [devicesScroll setBorderType:NSNoBorder];
149   [devicesScroll setDocumentView:devicesView];
150   [devicesView release];
151   [[window contentView] addSubview:devicesScroll];
152   [devicesScroll release];
153
154   // set default state
155   [devicesView expandItem:root expandChildren:YES];
156   [window makeFirstResponder:devicesView];
157   [window setTitle:[NSString stringWithFormat:@"All Devices"]];
158
159   // calculate the optimal size for everything
160   NSSize const desired = [NSScrollView frameSizeForContentSize:NSMakeSize(480, 320)
161                                 hasHorizontalScroller:YES
162                                  hasVerticalScroller:YES
163                                         borderType:[devicesScroll borderType]];
164   [self cascadeWindowWithDesiredSize:desired forView:devicesScroll];
165
166   // don't forget the result
167   return self;
168}
169
170
171- (void)dealloc {
172   if (root != nil)
173      [root release];
174   [super dealloc];
175}
176
177
178- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
179   return [(MAMEDeviceWrapper *)item children] > 0;
180}
181
182
183- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
184   if (item != nil)
185      return [(MAMEDeviceWrapper *)item children];
186   else
187      return 1;
188}
189
190
191- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
192   if (item != nil)
193      return [(MAMEDeviceWrapper *)item childAtIndex:index];
194   else if (index == 0)
195      return root;
196   else
197      return nil;
198}
199
200
201- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
202   if ([[tableColumn identifier] isEqualToString:@"tag"])
203      return [(MAMEDeviceWrapper *)item tag];
204   else if ([[tableColumn identifier] isEqualToString:@"name"])
205      return [(MAMEDeviceWrapper *)item name];
206   else
207      return nil;
208}
209
210@end
trunk/src/osd/modules/debugger/osx/disassemblyview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdisassemblyview.h - MacOS X Cocoa debug window handling
5//  disassemblyview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/disassemblyview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdisassemblyview.m - MacOS X Cocoa debug window handling
5//  disassemblyview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/disassemblyviewer.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdisassemblyviewer.h - MacOS X Cocoa debug window handling
5//  disassemblyviewer.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/disassemblyviewer.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxdisassemblyviewer.m - MacOS X Cocoa debug window handling
5//  disassemblyviewer.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
r243598r243599
2424   NSScrollView   *dasmScroll;
2525   NSView         *expressionContainer;
2626   NSPopUpButton   *actionButton;
27   NSRect         contentBounds, expressionFrame;
27   NSRect         expressionFrame;
2828
2929   if (!(self = [super initWithMachine:m title:@"Disassembly" console:c]))
3030      return nil;
31   contentBounds = [[window contentView] bounds];
31   NSRect const contentBounds = [[window contentView] bounds];
3232
3333   // create the expression field
3434   expressionField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 19)];
r243598r243599
108108   [window setTitle:[NSString stringWithFormat:@"Disassembly: %@", [dasmView selectedSubviewName]]];
109109
110110   // calculate the optimal size for everything
111   {
112      NSSize   desired = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
113                                hasHorizontalScroller:YES
114                                 hasVerticalScroller:YES
115                                        borderType:[dasmScroll borderType]];
116      [self cascadeWindowWithDesiredSize:desired forView:dasmScroll];
117   }
111   NSSize const desired = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
112                                 hasHorizontalScroller:YES
113                                  hasVerticalScroller:YES
114                                         borderType:[dasmScroll borderType]];
115   [self cascadeWindowWithDesiredSize:desired forView:dasmScroll];
118116
119117   // don't forget the result
120118   return self;
trunk/src/osd/modules/debugger/osx/errorlogview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxerrorlogview.h - MacOS X Cocoa debug window handling
5//  errorlogview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/errorlogview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxerrorlogview.m - MacOS X Cocoa debug window handling
5//  errorlogview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/errorlogviewer.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxerrorlogviewer.h - MacOS X Cocoa debug window handling
5//  errorlogviewer.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/errorlogviewer.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxerrorlogviewer.m - MacOS X Cocoa debug window handling
5//  errorlogviewer.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/memoryview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxmemoryview.h - MacOS X Cocoa debug window handling
5//  memoryview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/memoryview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxmemoryview.m - MacOS X Cocoa debug window handling
5//  memoryview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/memoryviewer.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxmemoryviewer.h - MacOS X Cocoa debug window handling
5//  memoryviewer.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/memoryviewer.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxmemoryviewer.m - MacOS X Cocoa debug window handling
5//  memoryviewer.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/pointsviewer.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxpointsviewer.h - MacOS X Cocoa debug window handling
5//  pointsviewer.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/pointsviewer.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxpointsviewer.m - MacOS X Cocoa debug window handling
5//  pointsviewer.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/registersview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxregistersview.h - MacOS X Cocoa debug window handling
5//  registersview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/registersview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxregistersview.m - MacOS X Cocoa debug window handling
5//  registersview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/watchpointsview.h
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxwatchpointsview.h - MacOS X Cocoa debug window handling
5//  watchpointsview.h - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/modules/debugger/osx/watchpointsview.m
r243598r243599
22// copyright-holders:Vas Crabb
33//============================================================
44//
5//  debugosxwatchpointsview.m - MacOS X Cocoa debug window handling
5//  watchpointsview.m - MacOS X Cocoa debug window handling
66//
77//  Copyright (c) 1996-2015, Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
trunk/src/osd/sdl/sdl.mak
r243598r243599
295295   $(OSDOBJ)/modules/debugger/osx/debugconsole.o \
296296   $(OSDOBJ)/modules/debugger/osx/debugview.o \
297297   $(OSDOBJ)/modules/debugger/osx/debugwindowhandler.o \
298   $(OSDOBJ)/modules/debugger/osx/devicesviewer.o \
298299   $(OSDOBJ)/modules/debugger/osx/disassemblyview.o \
299300   $(OSDOBJ)/modules/debugger/osx/disassemblyviewer.o \
300301   $(OSDOBJ)/modules/debugger/osx/errorlogview.o \


Previous 199869 Revisions Next


© 1997-2024 The MAME Team