~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/osd/sdl/debugosx.h

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//============================================================
2
2
//
3
 
//  debugwin.h - Win32 debug window handling
 
3
//  debugosx.h - MacOS X Cocoa debug window handling
4
4
//
5
5
//  Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
6
6
//  Visit http://mamedev.org for licensing and usage restrictions.
7
7
//
8
8
//============================================================
9
9
 
10
 
#ifndef __WIN_DEBUGWIN__
11
 
#define __WIN_DEBUGWIN__
12
 
 
13
 
 
14
 
//============================================================
15
 
//  GLOBAL VARIABLES
16
 
//============================================================
17
 
 
18
 
// windows
 
10
#ifndef __SDL_DEBUGOSX__
 
11
#define __SDL_DEBUGOSX__
 
12
 
 
13
// make sure this comes first
 
14
#include <AvailabilityMacros.h>
 
15
 
 
16
// MAME headers
 
17
#include "driver.h"
 
18
#include "debug/debugvw.h"
 
19
 
 
20
 
 
21
#ifdef __OBJC__
 
22
 
 
23
// standard Cocoa headers
 
24
#import <Cocoa/Cocoa.h>
 
25
 
 
26
// workarounds for 10.6 warnings
 
27
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
 
28
 
 
29
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
 
30
 
 
31
typedef int NSInteger;
 
32
typedef unsigned NSUInteger;
 
33
typedef float CGFloat;
 
34
 
 
35
#endif // MAC_OS_X_VERSION_MAX_ALLOWED < 1050
 
36
 
 
37
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
 
38
 
 
39
@protocol NSWindowDelegate <NSObject>
 
40
@end
 
41
 
 
42
@protocol NSSplitViewDelegate <NSObject>
 
43
@end
 
44
 
 
45
@protocol NSControlTextEditingDelegate <NSObject>
 
46
@end
 
47
 
 
48
@protocol NSTextFieldDelegate <NSControlTextEditingDelegate>
 
49
@end
 
50
 
 
51
#endif // MAC_OS_X_VERSION_MAX_ALLOWED < 1060
 
52
 
 
53
#endif // MAC_OS_X_VERSION_MAX_ALLOWED
 
54
 
 
55
 
 
56
//============================================================
 
57
//  PROTOCOLS
 
58
//============================================================
 
59
 
 
60
@protocol MAMEDebugViewSubviewSupport <NSObject>
 
61
 
 
62
- (NSString *)selectedSubviewName;
 
63
- (int)selectedSubviewIndex;
 
64
- (void)selectSubviewAtIndex:(int)index;
 
65
- (void)selectSubviewForCPU:(const device_config *)device;
 
66
 
 
67
@end
 
68
 
 
69
 
 
70
@protocol MAMEDebugViewExpressionSupport <NSObject>
 
71
 
 
72
- (NSString *)expression;
 
73
- (void)setExpression:(NSString *)exp;
 
74
 
 
75
@end
 
76
 
 
77
 
 
78
 
 
79
//============================================================
 
80
//  CLASSES
 
81
//============================================================
 
82
 
 
83
@interface MAMEDebugCommandHistory : NSObject
 
84
{
 
85
        NSInteger               length, position;
 
86
        NSString                *current;
 
87
        NSMutableArray  *history;
 
88
}
 
89
 
 
90
+ (NSInteger)defaultLength;
 
91
 
 
92
- (id)init;
 
93
 
 
94
- (NSInteger)length;
 
95
- (void)setLength:(NSInteger)l;
 
96
 
 
97
- (void)add:(NSString *)entry;
 
98
- (NSString *)previous:(NSString *)cur;
 
99
- (NSString *)next:(NSString *)cur;
 
100
- (void)reset;
 
101
- (void)clear;
 
102
 
 
103
@end
 
104
 
 
105
 
 
106
@interface MAMEDebugView : NSView
 
107
{
 
108
        int                             type;
 
109
        running_machine *machine;
 
110
        debug_view              *view;
 
111
 
 
112
        debug_view_xy   totalSize, topLeft;
 
113
 
 
114
        NSFont                  *font;
 
115
        CGFloat                 fontWidth, fontHeight, fontAscent;
 
116
}
 
117
 
 
118
+ (NSFont *)defaultFont;
 
119
 
 
120
- (id)initWithFrame:(NSRect)f type:(int)t machine:(running_machine *)m;
 
121
 
 
122
- (void)update;
 
123
 
 
124
- (NSSize)maximumFrameSize;
 
125
 
 
126
- (NSFont *)font;
 
127
- (void)setFont:(NSFont *)f;
 
128
 
 
129
- (void)windowDidBecomeKey:(NSNotification *)notification;
 
130
- (void)windowDidResignKey:(NSNotification *)notification;
 
131
 
 
132
@end
 
133
 
 
134
 
 
135
@interface MAMEMemoryView : MAMEDebugView <MAMEDebugViewSubviewSupport, MAMEDebugViewExpressionSupport>
 
136
{
 
137
}
 
138
 
 
139
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
 
140
 
 
141
- (NSSize)maximumFrameSize;
 
142
 
 
143
- (NSString *)selectedSubviewName;
 
144
- (int)selectedSubviewIndex;
 
145
- (void)selectSubviewAtIndex:(int)index;
 
146
- (void)selectSubviewForCPU:(const device_config *)device;
 
147
 
 
148
- (NSString *)expression;
 
149
- (void)setExpression:(NSString *)exp;
 
150
 
 
151
- (IBAction)showChunkSize:(id)sender;
 
152
- (IBAction)showPhysicalAddresses:(id)sender;
 
153
- (IBAction)showReverseView:(id)sender;
 
154
- (IBAction)showReverseViewToggle:(id)sender;
 
155
 
 
156
- (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;
 
157
- (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;
 
158
 
 
159
@end
 
160
 
 
161
 
 
162
@interface MAMEDisassemblyView : MAMEDebugView <MAMEDebugViewSubviewSupport, MAMEDebugViewExpressionSupport>
 
163
{
 
164
        BOOL    useConsole;
 
165
}
 
166
 
 
167
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m useConsole:(BOOL)uc;
 
168
 
 
169
- (NSSize)maximumFrameSize;
 
170
 
 
171
- (NSString *)selectedSubviewName;
 
172
- (int)selectedSubviewIndex;
 
173
- (void)selectSubviewAtIndex:(int)index;
 
174
- (void)selectSubviewForCPU:(const device_config *)device;
 
175
 
 
176
- (NSString *)expression;
 
177
- (void)setExpression:(NSString *)exp;
 
178
 
 
179
- (IBAction)debugToggleBreakpoint:(id)sender;
 
180
- (IBAction)debugToggleBreakpointEnable:(id)sender;
 
181
- (IBAction)debugRunToCursor:(id)sender;
 
182
 
 
183
- (IBAction)showRightColumn:(id)sender;
 
184
 
 
185
- (void)insertActionItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;
 
186
- (void)insertSubviewItemsInMenu:(NSMenu *)menu atIndex:(NSInteger)index;
 
187
 
 
188
@end
 
189
 
 
190
 
 
191
@interface MAMERegistersView : MAMEDebugView <MAMEDebugViewSubviewSupport>
 
192
{
 
193
}
 
194
 
 
195
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
 
196
 
 
197
- (NSSize)maximumFrameSize;
 
198
 
 
199
- (NSString *)selectedSubviewName;
 
200
- (int)selectedSubviewIndex;
 
201
- (void)selectSubviewAtIndex:(int)index;
 
202
- (void)selectSubviewForCPU:(const device_config *)device;
 
203
 
 
204
@end
 
205
 
 
206
 
 
207
@interface MAMEConsoleView : MAMEDebugView
 
208
{
 
209
}
 
210
 
 
211
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
 
212
 
 
213
@end
 
214
 
 
215
 
 
216
@interface MAMEErrorLogView : MAMEDebugView
 
217
{
 
218
}
 
219
 
 
220
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
 
221
 
 
222
@end
 
223
 
 
224
 
 
225
@interface MAMEDebugWindowHandler : NSObject <NSWindowDelegate>
 
226
{
 
227
        NSWindow                *window;
 
228
        running_machine *machine;
 
229
}
 
230
 
 
231
+ (void)addCommonActionItems:(NSMenu *)menu;
 
232
+ (NSPopUpButton *)newActionButtonWithFrame:(NSRect)frame;
 
233
 
 
234
- (id)initWithMachine:(running_machine *)m title:(NSString *)t;
 
235
 
 
236
- (void)activate;
 
237
 
 
238
- (IBAction)debugRun:(id)sender;
 
239
- (IBAction)debugRunAndHide:(id)sender;
 
240
- (IBAction)debugRunToNextCPU:(id)sender;
 
241
- (IBAction)debugRunToNextInterrupt:(id)sender;
 
242
- (IBAction)debugRunToNextVBLANK:(id)sender;
 
243
 
 
244
- (IBAction)debugStepInto:(id)sender;
 
245
- (IBAction)debugStepOver:(id)sender;
 
246
- (IBAction)debugStepOut:(id)sender;
 
247
 
 
248
- (IBAction)debugSoftReset:(id)sender;
 
249
- (IBAction)debugHardReset:(id)sender;
 
250
 
 
251
- (IBAction)debugExit:(id)sender;
 
252
 
 
253
- (void)showDebugger:(NSNotification *)notification;
 
254
- (void)hideDebugger:(NSNotification *)notification;
 
255
 
 
256
@end
 
257
 
 
258
 
 
259
@interface MAMEDebugConsole : MAMEDebugWindowHandler <NSTextFieldDelegate, NSSplitViewDelegate>
 
260
{
 
261
        MAMEDebugCommandHistory *history;
 
262
        NSMutableArray                  *auxiliaryWindows;
 
263
 
 
264
        MAMERegistersView               *regView;
 
265
        MAMEDisassemblyView             *dasmView;
 
266
        MAMEDebugView                   *consoleView;
 
267
        NSTextField                             *commandField;
 
268
}
 
269
 
 
270
- (id)initWithMachine:(running_machine *)m;
 
271
 
 
272
- (void)setCPU:(const device_config *)device;
 
273
 
 
274
- (IBAction)doCommand:(id)sender;
 
275
 
 
276
- (IBAction)debugNewMemoryWindow:(id)sender;
 
277
- (IBAction)debugNewDisassemblyWindow:(id)sender;
 
278
- (IBAction)debugNewErrorLogWindow:(id)sender;
 
279
 
 
280
- (void)showDebugger:(NSNotification *)notification;
 
281
- (void)auxiliaryWindowWillClose:(NSNotification *)notification;
 
282
 
 
283
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command;
 
284
 
 
285
- (void)windowWillClose:(NSNotification *)notification;
 
286
 
 
287
- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)min ofSubviewAt:(NSInteger)offs;
 
288
- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)max ofSubviewAt:(NSInteger)offs;
 
289
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview;
 
290
- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize;
 
291
 
 
292
@end
 
293
 
 
294
 
 
295
@interface MAMEAuxiliaryDebugWindowHandler : MAMEDebugWindowHandler
 
296
{
 
297
        MAMEDebugConsole        *console;
 
298
}
 
299
 
 
300
+ (void)cascadeWindow:(NSWindow *)window;
 
301
 
 
302
- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c;
 
303
 
 
304
- (IBAction)debugNewMemoryWindow:(id)sender;
 
305
- (IBAction)debugNewDisassemblyWindow:(id)sender;
 
306
- (IBAction)debugNewErrorLogWindow:(id)sender;
 
307
 
 
308
- (void)windowWillClose:(NSNotification *)notification;
 
309
 
 
310
- (void)cascadeWindowWithDesiredSize:(NSSize)desired forView:(NSView *)view;
 
311
 
 
312
@end
 
313
 
 
314
 
 
315
@interface MAMEExpressionAuxiliaryDebugWindowHandler : MAMEAuxiliaryDebugWindowHandler <NSTextFieldDelegate>
 
316
{
 
317
        MAMEDebugCommandHistory *history;
 
318
        NSTextField                             *expressionField;
 
319
}
 
320
 
 
321
- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c;
 
322
 
 
323
- (id <MAMEDebugViewExpressionSupport>)documentView;
 
324
 
 
325
- (IBAction)doExpression:(id)sender;
 
326
 
 
327
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command;
 
328
 
 
329
@end
 
330
 
 
331
 
 
332
@interface MAMEMemoryViewer : MAMEExpressionAuxiliaryDebugWindowHandler
 
333
{
 
334
        MAMEMemoryView  *memoryView;
 
335
}
 
336
 
 
337
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
 
338
 
 
339
- (IBAction)changeSubview:(id)sender;
 
340
 
 
341
@end
 
342
 
 
343
 
 
344
@interface MAMEDisassemblyViewer : MAMEExpressionAuxiliaryDebugWindowHandler
 
345
{
 
346
        MAMEDisassemblyView     *dasmView;
 
347
}
 
348
 
 
349
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
 
350
 
 
351
- (IBAction)changeSubview:(id)sender;
 
352
 
 
353
@end
 
354
 
 
355
 
 
356
@interface MAMEErrorLogViewer : MAMEAuxiliaryDebugWindowHandler
 
357
{
 
358
        MAMEErrorLogView        *logView;
 
359
}
 
360
 
 
361
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
 
362
 
 
363
@end
 
364
 
 
365
#endif // __OBJC__
19
366
 
20
367
 
21
368
 
23
370
//  PROTOTYPES
24
371
//============================================================
25
372
 
26
 
void debugwin_update_during_game(void);
27
 
 
28
 
#endif
 
373
void debugwin_update_during_game(running_machine *machine);
 
374
 
 
375
 
 
376
#endif // __SDL_DEBUGOSX__