trunk/src/osd/sdl/debugosx.m
r18029 | r18030 | |
887 | 887 | |
888 | 888 | @implementation MAMEDisassemblyView |
889 | 889 | |
890 | | - (device_debug::breakpoint *)findBreakpointAtAddress:(offs_t)address inAddressSpace:(address_space *)space { |
891 | | device_debug *cpuinfo = space->device().debug(); |
| 890 | - (device_debug::breakpoint *)findBreakpointAtAddress:(offs_t)address inAddressSpace:(address_space &)space { |
| 891 | device_debug *cpuinfo = space.device().debug(); |
892 | 892 | device_debug::breakpoint *bp; |
893 | 893 | for (bp = cpuinfo->breakpoint_first(); (bp != NULL) && (address != bp->address()); bp = bp->next()) {} |
894 | 894 | return bp; |
r18029 | r18030 | |
1090 | 1090 | |
1091 | 1091 | - (IBAction)debugToggleBreakpoint:(id)sender { |
1092 | 1092 | if (view->cursor_visible()) { |
1093 | | address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
1094 | | if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space->device())) { |
| 1093 | address_space &space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
| 1094 | if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space.device())) { |
1095 | 1095 | offs_t address = downcast<debug_view_disasm *>(view)->selected_address(); |
1096 | 1096 | device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space]; |
1097 | 1097 | |
r18029 | r18030 | |
1105 | 1105 | debug_console_execute_command(*machine, [command UTF8String], 1); |
1106 | 1106 | } else { |
1107 | 1107 | if (bp == NULL) |
1108 | | space->device().debug()->breakpoint_set(address, NULL, NULL); |
| 1108 | space.device().debug()->breakpoint_set(address, NULL, NULL); |
1109 | 1109 | else |
1110 | | space->device().debug()->breakpoint_clear(bp->index()); |
| 1110 | space.device().debug()->breakpoint_clear(bp->index()); |
1111 | 1111 | } |
1112 | 1112 | } |
1113 | 1113 | } |
r18029 | r18030 | |
1116 | 1116 | |
1117 | 1117 | - (IBAction)debugToggleBreakpointEnable:(id)sender { |
1118 | 1118 | if (view->cursor_visible()) { |
1119 | | address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
1120 | | if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space->device())) { |
| 1119 | address_space &space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
| 1120 | if (!useConsole || (debug_cpu_get_visible_cpu(*machine) == &space.device())) { |
1121 | 1121 | offs_t address = downcast<debug_view_disasm *>(view)->selected_address(); |
1122 | 1122 | device_debug::breakpoint *bp = [self findBreakpointAtAddress:address inAddressSpace:space]; |
1123 | 1123 | |
r18029 | r18030 | |
1130 | 1130 | command = [NSString stringWithFormat:@"bpenable %X", (unsigned)bp->index()]; |
1131 | 1131 | debug_console_execute_command(*machine, [command UTF8String], 1); |
1132 | 1132 | } else { |
1133 | | space->device().debug()->breakpoint_enable(bp->index(), !bp->enabled()); |
| 1133 | space.device().debug()->breakpoint_enable(bp->index(), !bp->enabled()); |
1134 | 1134 | } |
1135 | 1135 | } |
1136 | 1136 | } |
r18029 | r18030 | |
1140 | 1140 | |
1141 | 1141 | - (IBAction)debugRunToCursor:(id)sender { |
1142 | 1142 | if (view->cursor_visible()) { |
1143 | | address_space *space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
1144 | | if (debug_cpu_get_visible_cpu(*machine) == &space->device()) { |
| 1143 | address_space &space = downcast<const debug_view_disasm_source *>(view->source())->space(); |
| 1144 | if (debug_cpu_get_visible_cpu(*machine) == &space.device()) { |
1145 | 1145 | offs_t address = downcast<debug_view_disasm *>(view)->selected_address(); |
1146 | 1146 | if (useConsole) { |
1147 | 1147 | NSString *command = [NSString stringWithFormat:@"go 0x%lX", (unsigned long)address]; |