diff options
Diffstat (limited to 'src/osd/modules/debugger/osx/debugwindowhandler.mm')
-rw-r--r-- | src/osd/modules/debugger/osx/debugwindowhandler.mm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/osd/modules/debugger/osx/debugwindowhandler.mm b/src/osd/modules/debugger/osx/debugwindowhandler.mm index d99a9ec9961..fd11fa89152 100644 --- a/src/osd/modules/debugger/osx/debugwindowhandler.mm +++ b/src/osd/modules/debugger/osx/debugwindowhandler.mm @@ -29,6 +29,10 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD @implementation MAMEDebugWindowHandler + (void)addCommonActionItems:(NSMenu *)menu { + [menu addItemWithTitle:@"Break" + action:@selector(debugBreak:) + keyEquivalent:@""]; + NSMenuItem *runParentItem = [menu addItemWithTitle:@"Run" action:@selector(debugRun:) keyEquivalent:[NSString stringWithFormat:@"%C", (short)NSF5FunctionKey]]; @@ -181,13 +185,22 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD } +- (IBAction)debugBreak:(id)sender { + if (machine->debug_flags & DEBUG_FLAG_ENABLED) + debug_cpu_get_visible_cpu(*machine)->debug()->halt_on_next_instruction("User-initiated break\n"); +} + + - (IBAction)debugRun:(id)sender { debug_cpu_get_visible_cpu(*machine)->debug()->go(); } - (IBAction)debugRunAndHide:(id)sender { - [[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:MAMEHideDebuggerNotification + object:self + userInfo:[NSDictionary dictionaryWithObject:[NSValue valueWithPointer:machine] + forKey:@"MAMEDebugMachine"]]; debug_cpu_get_visible_cpu(*machine)->debug()->go(); } |