mirror of
https://github.com/holub/mame
synced 2025-05-16 10:52:43 +03:00
Fix osx compile.
This commit is contained in:
parent
9300bf632c
commit
446be9ae42
@ -60,7 +60,7 @@ static NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification
|
|||||||
|
|
||||||
static void debugwin_view_update(debug_view &view, void *osdprivate);
|
static void debugwin_view_update(debug_view &view, void *osdprivate);
|
||||||
|
|
||||||
static void console_create_window(running_machine *machine);
|
static void console_create_window(running_machine &machine);
|
||||||
|
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
@ -79,7 +79,7 @@ void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
|
|||||||
{
|
{
|
||||||
// create a console window
|
// create a console window
|
||||||
if (main_console == nil)
|
if (main_console == nil)
|
||||||
console_create_window(&machine());
|
console_create_window(machine());
|
||||||
|
|
||||||
// make sure the debug windows are visible
|
// make sure the debug windows are visible
|
||||||
waiting_for_debugger = YES;
|
waiting_for_debugger = YES;
|
||||||
@ -111,7 +111,7 @@ void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
|
|||||||
// debugwin_update_during_game
|
// debugwin_update_during_game
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
void debugwin_update_during_game(running_machine *machine)
|
void debugwin_update_during_game(running_machine &machine)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
|||||||
// console_create_window
|
// console_create_window
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
void console_create_window(running_machine *machine)
|
void console_create_window(running_machine &machine)
|
||||||
{
|
{
|
||||||
main_console = [[MAMEDebugConsole alloc] initWithMachine:machine];
|
main_console = [[MAMEDebugConsole alloc] initWithMachine:machine];
|
||||||
}
|
}
|
||||||
@ -344,11 +344,11 @@ void console_create_window(running_machine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f type:(debug_view_type)t machine:(running_machine *)m {
|
- (id)initWithFrame:(NSRect)f type:(debug_view_type)t machine:(running_machine &)m {
|
||||||
if (!(self = [super initWithFrame:f]))
|
if (!(self = [super initWithFrame:f]))
|
||||||
return nil;
|
return nil;
|
||||||
type = t;
|
type = t;
|
||||||
machine = m;
|
machine = &m;
|
||||||
view = machine->debug_view().alloc_view((debug_view_type)type, debugwin_view_update, self);
|
view = machine->debug_view().alloc_view((debug_view_type)type, debugwin_view_update, self);
|
||||||
if (view == nil) {
|
if (view == nil) {
|
||||||
[self release];
|
[self release];
|
||||||
@ -665,7 +665,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
|
|
||||||
- (void)insertNewline:(id)sender {
|
- (void)insertNewline:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->single_step();
|
debug_cpu_get_visible_cpu(*machine)->debug()->single_step();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -695,7 +695,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEMemoryView
|
@implementation MAMEMemoryView
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m {
|
- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
|
||||||
NSMenu *contextMenu;
|
NSMenu *contextMenu;
|
||||||
|
|
||||||
if (!(self = [super initWithFrame:f type:DVT_MEMORY machine:m]))
|
if (!(self = [super initWithFrame:f type:DVT_MEMORY machine:m]))
|
||||||
@ -735,7 +735,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
- (NSSize)maximumFrameSize {
|
- (NSSize)maximumFrameSize {
|
||||||
debug_view_xy max;
|
debug_view_xy max;
|
||||||
device_t *curcpu = debug_cpu_get_visible_cpu(machine);
|
device_t *curcpu = debug_cpu_get_visible_cpu(*machine);
|
||||||
const debug_view_source *source = view->source_list().match_device(curcpu);
|
const debug_view_source *source = view->source_list().match_device(curcpu);
|
||||||
|
|
||||||
max.x = max.y = 0;
|
max.x = max.y = 0;
|
||||||
@ -888,7 +888,7 @@ void console_create_window(running_machine *machine)
|
|||||||
@implementation MAMEDisassemblyView
|
@implementation MAMEDisassemblyView
|
||||||
|
|
||||||
- (device_debug::breakpoint *)findBreakpointAtAddress:(offs_t)address inAddressSpace:(address_space *)space {
|
- (device_debug::breakpoint *)findBreakpointAtAddress:(offs_t)address inAddressSpace:(address_space *)space {
|
||||||
device_debug *cpuinfo = space->cpu->debug();
|
device_debug *cpuinfo = space->device().debug();
|
||||||
device_debug::breakpoint *bp;
|
device_debug::breakpoint *bp;
|
||||||
for (bp = cpuinfo->breakpoint_first(); (bp != NULL) && (address != bp->address()); bp = bp->next()) {}
|
for (bp = cpuinfo->breakpoint_first(); (bp != NULL) && (address != bp->address()); bp = bp->next()) {}
|
||||||
return bp;
|
return bp;
|
||||||
@ -943,7 +943,7 @@ void console_create_window(running_machine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m useConsole:(BOOL)uc {
|
- (id)initWithFrame:(NSRect)f machine:(running_machine &)m useConsole:(BOOL)uc {
|
||||||
if (!(self = [super initWithFrame:f type:DVT_DISASSEMBLY machine:m]))
|
if (!(self = [super initWithFrame:f type:DVT_DISASSEMBLY machine:m]))
|
||||||
return nil;
|
return nil;
|
||||||
useConsole = uc;
|
useConsole = uc;
|
||||||
@ -964,7 +964,7 @@ void console_create_window(running_machine *machine)
|
|||||||
device_debug::breakpoint *breakpoint = NULL;
|
device_debug::breakpoint *breakpoint = NULL;
|
||||||
|
|
||||||
if (view->cursor_visible()) {
|
if (view->cursor_visible()) {
|
||||||
if (debug_cpu_get_visible_cpu(machine) == view->source()->device()) {
|
if (debug_cpu_get_visible_cpu(*machine) == view->source()->device()) {
|
||||||
isCurrent = YES;
|
isCurrent = YES;
|
||||||
if (!useConsole || isCurrent) {
|
if (!useConsole || isCurrent) {
|
||||||
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
||||||
@ -1020,7 +1020,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
- (NSSize)maximumFrameSize {
|
- (NSSize)maximumFrameSize {
|
||||||
debug_view_xy max;
|
debug_view_xy max;
|
||||||
device_t *curcpu = debug_cpu_get_visible_cpu(machine);
|
device_t *curcpu = debug_cpu_get_visible_cpu(*machine);
|
||||||
const debug_view_source *source = view->source_list().match_device(curcpu);
|
const debug_view_source *source = view->source_list().match_device(curcpu);
|
||||||
|
|
||||||
max.x = max.y = 0;
|
max.x = max.y = 0;
|
||||||
@ -1091,7 +1091,7 @@ void console_create_window(running_machine *machine)
|
|||||||
- (IBAction)debugToggleBreakpoint:(id)sender {
|
- (IBAction)debugToggleBreakpoint:(id)sender {
|
||||||
if (view->cursor_visible()) {
|
if (view->cursor_visible()) {
|
||||||
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
||||||
if (!useConsole || (debug_cpu_get_visible_cpu(machine) == space->cpu)) {
|
if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space->device())) {
|
||||||
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
||||||
device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space];
|
device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space];
|
||||||
|
|
||||||
@ -1102,12 +1102,12 @@ void console_create_window(running_machine *machine)
|
|||||||
command = [NSString stringWithFormat:@"bpset %lX", (unsigned long)address];
|
command = [NSString stringWithFormat:@"bpset %lX", (unsigned long)address];
|
||||||
else
|
else
|
||||||
command = [NSString stringWithFormat:@"bpclear %X", (unsigned)bp->index()];
|
command = [NSString stringWithFormat:@"bpclear %X", (unsigned)bp->index()];
|
||||||
debug_console_execute_command(machine, [command UTF8String], 1);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
} else {
|
} else {
|
||||||
if (bp == NULL)
|
if (bp == NULL)
|
||||||
space->cpu->debug()->breakpoint_set(address, NULL, NULL);
|
space->device().debug()->breakpoint_set(address, NULL, NULL);
|
||||||
else
|
else
|
||||||
space->cpu->debug()->breakpoint_clear(bp->index());
|
space->device().debug()->breakpoint_clear(bp->index());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1117,7 +1117,7 @@ void console_create_window(running_machine *machine)
|
|||||||
- (IBAction)debugToggleBreakpointEnable:(id)sender {
|
- (IBAction)debugToggleBreakpointEnable:(id)sender {
|
||||||
if (view->cursor_visible()) {
|
if (view->cursor_visible()) {
|
||||||
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
||||||
if (!useConsole || (debug_cpu_get_visible_cpu(machine) == space->cpu)) {
|
if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space->device())) {
|
||||||
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
||||||
device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space];
|
device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space];
|
||||||
|
|
||||||
@ -1128,9 +1128,9 @@ void console_create_window(running_machine *machine)
|
|||||||
command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index()];
|
command = [NSString stringWithFormat:@"bpdisable %X", (unsigned)bp->index()];
|
||||||
else
|
else
|
||||||
command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index()];
|
command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index()];
|
||||||
debug_console_execute_command(machine, [command UTF8String], 1);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
} else {
|
} else {
|
||||||
space->cpu->debug()->breakpoint_enable(bp->index(), !bp->enabled());
|
space->device().debug()->breakpoint_enable(bp->index(), !bp->enabled());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1141,13 +1141,13 @@ void console_create_window(running_machine *machine)
|
|||||||
- (IBAction)debugRunToCursor:(id)sender {
|
- (IBAction)debugRunToCursor:(id)sender {
|
||||||
if (view->cursor_visible()) {
|
if (view->cursor_visible()) {
|
||||||
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space();
|
||||||
if (debug_cpu_get_visible_cpu(machine) == space->cpu) {
|
if (debug_cpu_get_visible_cpu(*machine) == &space->device()) {
|
||||||
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
offs_t address = downcast<debug_view_disasm *>(view)->selected_address();
|
||||||
if (useConsole) {
|
if (useConsole) {
|
||||||
NSString *command = [NSString stringWithFormat:@"go 0x%lX", (unsigned long)address];
|
NSString *command = [NSString stringWithFormat:@"go 0x%lX", (unsigned long)address];
|
||||||
debug_console_execute_command(machine, [command UTF8String], 1);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
} else {
|
} else {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go(address);
|
debug_cpu_get_visible_cpu(*machine)->debug()->go(address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1244,7 +1244,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMERegistersView
|
@implementation MAMERegistersView
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m {
|
- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
|
||||||
if (!(self = [super initWithFrame:f type:DVT_STATE machine:m]))
|
if (!(self = [super initWithFrame:f type:DVT_STATE machine:m]))
|
||||||
return nil;
|
return nil;
|
||||||
return self;
|
return self;
|
||||||
@ -1258,7 +1258,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
- (NSSize)maximumFrameSize {
|
- (NSSize)maximumFrameSize {
|
||||||
debug_view_xy max;
|
debug_view_xy max;
|
||||||
device_t *curcpu = debug_cpu_get_visible_cpu(machine);
|
device_t *curcpu = debug_cpu_get_visible_cpu(*machine);
|
||||||
const debug_view_source *source = view->source_list().match_device(curcpu);
|
const debug_view_source *source = view->source_list().match_device(curcpu);
|
||||||
|
|
||||||
|
|
||||||
@ -1306,7 +1306,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEConsoleView
|
@implementation MAMEConsoleView
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m {
|
- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
|
||||||
if (!(self = [super initWithFrame:f type:DVT_CONSOLE machine:m]))
|
if (!(self = [super initWithFrame:f type:DVT_CONSOLE machine:m]))
|
||||||
return nil;
|
return nil;
|
||||||
return self;
|
return self;
|
||||||
@ -1326,7 +1326,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEErrorLogView
|
@implementation MAMEErrorLogView
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)f machine:(running_machine *)m {
|
- (id)initWithFrame:(NSRect)f machine:(running_machine &)m {
|
||||||
if (!(self = [super initWithFrame:f type:DVT_LOG machine:m]))
|
if (!(self = [super initWithFrame:f type:DVT_LOG machine:m]))
|
||||||
return nil;
|
return nil;
|
||||||
return self;
|
return self;
|
||||||
@ -1438,7 +1438,7 @@ void console_create_window(running_machine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m title:(NSString *)t {
|
- (id)initWithMachine:(running_machine &)m title:(NSString *)t {
|
||||||
if (!(self = [super init]))
|
if (!(self = [super init]))
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -1463,7 +1463,7 @@ void console_create_window(running_machine *machine)
|
|||||||
name:MAMEHideDebuggerNotification
|
name:MAMEHideDebuggerNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
machine = m;
|
machine = &m;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@ -1485,49 +1485,49 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
|
|
||||||
- (IBAction)debugRun:(id)sender {
|
- (IBAction)debugRun:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugRunAndHide:(id)sender {
|
- (IBAction)debugRunAndHide:(id)sender {
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugRunToNextCPU:(id)sender {
|
- (IBAction)debugRunToNextCPU:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go_next_device();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go_next_device();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugRunToNextInterrupt:(id)sender {
|
- (IBAction)debugRunToNextInterrupt:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go_interrupt();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go_interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugRunToNextVBLANK:(id)sender {
|
- (IBAction)debugRunToNextVBLANK:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go_vblank();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go_vblank();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugStepInto:(id)sender {
|
- (IBAction)debugStepInto:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->single_step();
|
debug_cpu_get_visible_cpu(*machine)->debug()->single_step();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugStepOver:(id)sender {
|
- (IBAction)debugStepOver:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->single_step_over();
|
debug_cpu_get_visible_cpu(*machine)->debug()->single_step_over();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugStepOut:(id)sender {
|
- (IBAction)debugStepOut:(id)sender {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->single_step_out();
|
debug_cpu_get_visible_cpu(*machine)->debug()->single_step_out();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)debugSoftReset:(id)sender {
|
- (IBAction)debugSoftReset:(id)sender {
|
||||||
machine->schedule_soft_reset();
|
machine->schedule_soft_reset();
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1543,7 +1543,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
- (void)showDebugger:(NSNotification *)notification {
|
- (void)showDebugger:(NSNotification *)notification {
|
||||||
device_t *device = (device_t *) [[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue];
|
device_t *device = (device_t *) [[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue];
|
||||||
if (device->machine == machine) {
|
if (&device->machine() == machine) {
|
||||||
if (![window isVisible] && ![window isMiniaturized])
|
if (![window isVisible] && ![window isMiniaturized])
|
||||||
[window orderFront:self];
|
[window orderFront:self];
|
||||||
}
|
}
|
||||||
@ -1564,7 +1564,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEDebugConsole
|
@implementation MAMEDebugConsole
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m {
|
- (id)initWithMachine:(running_machine &)m {
|
||||||
NSSplitView *regSplit, *dasmSplit;
|
NSSplitView *regSplit, *dasmSplit;
|
||||||
NSScrollView *regScroll, *dasmScroll, *consoleScroll;
|
NSScrollView *regScroll, *dasmScroll, *consoleScroll;
|
||||||
NSView *consoleContainer;
|
NSView *consoleContainer;
|
||||||
@ -1578,7 +1578,7 @@ void console_create_window(running_machine *machine)
|
|||||||
auxiliaryWindows = [[NSMutableArray alloc] init];
|
auxiliaryWindows = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
// create the register view
|
// create the register view
|
||||||
regView = [[MAMERegistersView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:machine];
|
regView = [[MAMERegistersView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:*machine];
|
||||||
regScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
regScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
||||||
[regScroll setDrawsBackground:YES];
|
[regScroll setDrawsBackground:YES];
|
||||||
[regScroll setHasHorizontalScroller:YES];
|
[regScroll setHasHorizontalScroller:YES];
|
||||||
@ -1590,7 +1590,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
// create the disassembly view
|
// create the disassembly view
|
||||||
dasmView = [[MAMEDisassemblyView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
dasmView = [[MAMEDisassemblyView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
||||||
machine:machine
|
machine:*machine
|
||||||
useConsole:YES];
|
useConsole:YES];
|
||||||
[dasmView setExpression:@"curpc"];
|
[dasmView setExpression:@"curpc"];
|
||||||
dasmScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
dasmScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
||||||
@ -1603,7 +1603,7 @@ void console_create_window(running_machine *machine)
|
|||||||
[dasmView release];
|
[dasmView release];
|
||||||
|
|
||||||
// create the console view
|
// create the console view
|
||||||
consoleView = [[MAMEConsoleView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:machine];
|
consoleView = [[MAMEConsoleView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:*machine];
|
||||||
consoleScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
consoleScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
||||||
[consoleScroll setDrawsBackground:YES];
|
[consoleScroll setDrawsBackground:YES];
|
||||||
[consoleScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
[consoleScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
@ -1746,7 +1746,7 @@ void console_create_window(running_machine *machine)
|
|||||||
[regView selectSubviewForCPU:device];
|
[regView selectSubviewForCPU:device];
|
||||||
[dasmView selectSubviewForCPU:device];
|
[dasmView selectSubviewForCPU:device];
|
||||||
[window setTitle:[NSString stringWithFormat:@"Debug: %s - %s '%s'",
|
[window setTitle:[NSString stringWithFormat:@"Debug: %s - %s '%s'",
|
||||||
device->machine->system().name,
|
device->machine().system().name,
|
||||||
device->name(),
|
device->name(),
|
||||||
device->tag()]];
|
device->tag()]];
|
||||||
}
|
}
|
||||||
@ -1755,9 +1755,9 @@ void console_create_window(running_machine *machine)
|
|||||||
- (IBAction)doCommand:(id)sender {
|
- (IBAction)doCommand:(id)sender {
|
||||||
NSString *command = [sender stringValue];
|
NSString *command = [sender stringValue];
|
||||||
if ([command length] == 0) {
|
if ([command length] == 0) {
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->single_step();
|
debug_cpu_get_visible_cpu(*machine)->debug()->single_step();
|
||||||
} else {
|
} else {
|
||||||
debug_console_execute_command(machine, [command UTF8String], 1);
|
debug_console_execute_command(*machine, [command UTF8String], 1);
|
||||||
[history add:command];
|
[history add:command];
|
||||||
}
|
}
|
||||||
[sender setStringValue:@""];
|
[sender setStringValue:@""];
|
||||||
@ -1765,7 +1765,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
|
|
||||||
- (IBAction)debugNewMemoryWindow:(id)sender {
|
- (IBAction)debugNewMemoryWindow:(id)sender {
|
||||||
MAMEMemoryViewer *win = [[MAMEMemoryViewer alloc] initWithMachine:machine console:self];
|
MAMEMemoryViewer *win = [[MAMEMemoryViewer alloc] initWithMachine:*machine console:self];
|
||||||
[auxiliaryWindows addObject:win];
|
[auxiliaryWindows addObject:win];
|
||||||
[win release];
|
[win release];
|
||||||
[win activate];
|
[win activate];
|
||||||
@ -1773,7 +1773,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
|
|
||||||
- (IBAction)debugNewDisassemblyWindow:(id)sender {
|
- (IBAction)debugNewDisassemblyWindow:(id)sender {
|
||||||
MAMEDisassemblyViewer *win = [[MAMEDisassemblyViewer alloc] initWithMachine:machine console:self];
|
MAMEDisassemblyViewer *win = [[MAMEDisassemblyViewer alloc] initWithMachine:*machine console:self];
|
||||||
[auxiliaryWindows addObject:win];
|
[auxiliaryWindows addObject:win];
|
||||||
[win release];
|
[win release];
|
||||||
[win activate];
|
[win activate];
|
||||||
@ -1781,7 +1781,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
|
|
||||||
- (IBAction)debugNewErrorLogWindow:(id)sender {
|
- (IBAction)debugNewErrorLogWindow:(id)sender {
|
||||||
MAMEDisassemblyViewer *win = [[MAMEErrorLogViewer alloc] initWithMachine:machine console:self];
|
MAMEDisassemblyViewer *win = [[MAMEErrorLogViewer alloc] initWithMachine:*machine console:self];
|
||||||
[auxiliaryWindows addObject:win];
|
[auxiliaryWindows addObject:win];
|
||||||
[win release];
|
[win release];
|
||||||
[win activate];
|
[win activate];
|
||||||
@ -1790,7 +1790,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
- (void)showDebugger:(NSNotification *)notification {
|
- (void)showDebugger:(NSNotification *)notification {
|
||||||
device_t *device = (device_t * )[[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue];
|
device_t *device = (device_t * )[[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue];
|
||||||
if (device->machine == machine) {
|
if (&device->machine() == machine) {
|
||||||
[self setCPU:device];
|
[self setCPU:device];
|
||||||
[window makeKeyAndOrderFront:self];
|
[window makeKeyAndOrderFront:self];
|
||||||
}
|
}
|
||||||
@ -1834,7 +1834,7 @@ void console_create_window(running_machine *machine)
|
|||||||
if ([notification object] != window)
|
if ([notification object] != window)
|
||||||
return;
|
return;
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self];
|
||||||
debug_cpu_get_visible_cpu(machine)->debug()->go();
|
debug_cpu_get_visible_cpu(*machine)->debug()->go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1910,7 +1910,7 @@ void console_create_window(running_machine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c {
|
- (id)initWithMachine:(running_machine &)m title:(NSString *)t console:(MAMEDebugConsole *)c {
|
||||||
if (!(self = [super initWithMachine:m title:t]))
|
if (!(self = [super initWithMachine:m title:t]))
|
||||||
return nil;
|
return nil;
|
||||||
console = c;
|
console = c;
|
||||||
@ -1975,7 +1975,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEExpressionAuxiliaryDebugWindowHandler
|
@implementation MAMEExpressionAuxiliaryDebugWindowHandler
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c {
|
- (id)initWithMachine:(running_machine &)m title:(NSString *)t console:(MAMEDebugConsole *)c {
|
||||||
if (!(self = [super initWithMachine:m title:t console:c]))
|
if (!(self = [super initWithMachine:m title:t console:c]))
|
||||||
return nil;
|
return nil;
|
||||||
history = [[MAMEDebugCommandHistory alloc] init];
|
history = [[MAMEDebugCommandHistory alloc] init];
|
||||||
@ -2043,7 +2043,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEMemoryViewer
|
@implementation MAMEMemoryViewer
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c {
|
- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c {
|
||||||
NSScrollView *memoryScroll;
|
NSScrollView *memoryScroll;
|
||||||
NSView *expressionContainer;
|
NSView *expressionContainer;
|
||||||
NSPopUpButton *actionButton, *subviewButton;
|
NSPopUpButton *actionButton, *subviewButton;
|
||||||
@ -2093,7 +2093,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
// create the memory view
|
// create the memory view
|
||||||
memoryView = [[MAMEMemoryView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
memoryView = [[MAMEMemoryView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
||||||
machine:machine];
|
machine:*machine];
|
||||||
[memoryView insertSubviewItemsInMenu:[subviewButton menu] atIndex:0];
|
[memoryView insertSubviewItemsInMenu:[subviewButton menu] atIndex:0];
|
||||||
memoryScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,
|
memoryScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,
|
||||||
0,
|
0,
|
||||||
@ -2121,7 +2121,7 @@ void console_create_window(running_machine *machine)
|
|||||||
[actionButton release];
|
[actionButton release];
|
||||||
|
|
||||||
// set default state
|
// set default state
|
||||||
[memoryView selectSubviewForCPU:debug_cpu_get_visible_cpu(machine)];
|
[memoryView selectSubviewForCPU:debug_cpu_get_visible_cpu(*machine)];
|
||||||
[memoryView setExpression:@"0"];
|
[memoryView setExpression:@"0"];
|
||||||
[expressionField setStringValue:@"0"];
|
[expressionField setStringValue:@"0"];
|
||||||
[expressionField selectText:self];
|
[expressionField selectText:self];
|
||||||
@ -2167,7 +2167,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEDisassemblyViewer
|
@implementation MAMEDisassemblyViewer
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c {
|
- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c {
|
||||||
NSScrollView *dasmScroll;
|
NSScrollView *dasmScroll;
|
||||||
NSView *expressionContainer;
|
NSView *expressionContainer;
|
||||||
NSPopUpButton *actionButton, *subviewButton;
|
NSPopUpButton *actionButton, *subviewButton;
|
||||||
@ -2217,7 +2217,7 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
// create the disassembly view
|
// create the disassembly view
|
||||||
dasmView = [[MAMEDisassemblyView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
dasmView = [[MAMEDisassemblyView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)
|
||||||
machine:machine
|
machine:*machine
|
||||||
useConsole:NO];
|
useConsole:NO];
|
||||||
[dasmView insertSubviewItemsInMenu:[subviewButton menu] atIndex:0];
|
[dasmView insertSubviewItemsInMenu:[subviewButton menu] atIndex:0];
|
||||||
dasmScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,
|
dasmScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0,
|
||||||
@ -2246,7 +2246,7 @@ void console_create_window(running_machine *machine)
|
|||||||
[actionButton release];
|
[actionButton release];
|
||||||
|
|
||||||
// set default state
|
// set default state
|
||||||
[dasmView selectSubviewForCPU:debug_cpu_get_visible_cpu(machine)];
|
[dasmView selectSubviewForCPU:debug_cpu_get_visible_cpu(*machine)];
|
||||||
[dasmView setExpression:@"curpc"];
|
[dasmView setExpression:@"curpc"];
|
||||||
[expressionField setStringValue:@"curpc"];
|
[expressionField setStringValue:@"curpc"];
|
||||||
[expressionField selectText:self];
|
[expressionField selectText:self];
|
||||||
@ -2292,18 +2292,18 @@ void console_create_window(running_machine *machine)
|
|||||||
|
|
||||||
@implementation MAMEErrorLogViewer
|
@implementation MAMEErrorLogViewer
|
||||||
|
|
||||||
- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c {
|
- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c {
|
||||||
NSScrollView *logScroll;
|
NSScrollView *logScroll;
|
||||||
NSString *title;
|
NSString *title;
|
||||||
|
|
||||||
title = [NSString stringWithFormat:@"Error Log: %@ [%@]",
|
title = [NSString stringWithFormat:@"Error Log: %@ [%@]",
|
||||||
[NSString stringWithUTF8String:m->system().description],
|
[NSString stringWithUTF8String:m.system().description],
|
||||||
[NSString stringWithUTF8String:m->system().name]];
|
[NSString stringWithUTF8String:m.system().name]];
|
||||||
if (!(self = [super initWithMachine:m title:title console:c]))
|
if (!(self = [super initWithMachine:m title:title console:c]))
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
// create the error log view
|
// create the error log view
|
||||||
logView = [[MAMEErrorLogView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:machine];
|
logView = [[MAMEErrorLogView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) machine:*machine];
|
||||||
logScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
logScroll = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
|
||||||
[logScroll setDrawsBackground:YES];
|
[logScroll setDrawsBackground:YES];
|
||||||
[logScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
[logScroll setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
Loading…
Reference in New Issue
Block a user