src/osd/sdl/debugosx.m
| r8417 | r8418 | |
| 272 | 272 | position.y = lround(floor(location.y / fontHeight)); |
| 273 | 273 | if (position.x < 0) |
| 274 | 274 | position.x = 0; |
| 275 | | else if (position.x >= totalSize.x) |
| 276 | | position.x = totalSize.x - 1; |
| 275 | else if (position.x >= totalSize->x) |
| 276 | position.x = totalSize->x - 1; |
| 277 | 277 | if (position.y < 0) |
| 278 | 278 | position.y = 0; |
| 279 | | else if (position.y >= totalSize.y) |
| 280 | | position.y = totalSize.y - 1; |
| 279 | else if (position.y >= totalSize->y) |
| 280 | position.y = totalSize->y - 1; |
| 281 | 281 | return position; |
| 282 | 282 | } |
| 283 | 283 | |
| r8417 | r8418 | |
| 299 | 299 | |
| 300 | 300 | // need to render entire lines or we get screwed up characters when widening views |
| 301 | 301 | origin.x = 0; |
| 302 | | size.x = totalSize.x; |
| 302 | size.x = totalSize->x; |
| 303 | 303 | |
| 304 | 304 | // tell them what we think |
| 305 | 305 | view->set_visible_size(size); |
| 306 | 306 | view->set_visible_position(origin); |
| 307 | | topLeft = origin; |
| 307 | topLeft->x = origin.x; |
| 308 | topLeft->y = origin.y; |
| 308 | 309 | } |
| 309 | 310 | } |
| 310 | 311 | |
| r8417 | r8418 | |
| 344 | 345 | [self release]; |
| 345 | 346 | return nil; |
| 346 | 347 | } |
| 347 | | totalSize.x = totalSize.y = 0; |
| 348 | | topLeft.x = topLeft.y = 0; |
| 348 | totalSize = global_alloc(debug_view_xy()); |
| 349 | topLeft = global_alloc(debug_view_xy()); |
| 350 | totalSize->x = totalSize->y = 0; |
| 351 | topLeft->x = topLeft->y = 0; |
| 349 | 352 | [self setFont:[[self class] defaultFont]]; |
| 350 | 353 | return self; |
| 351 | 354 | } |
| r8417 | r8418 | |
| 355 | 358 | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 356 | 359 | if (font != nil) |
| 357 | 360 | [font release]; |
| 361 | global_free(totalSize); |
| 362 | global_free(topLeft); |
| 358 | 363 | [super dealloc]; |
| 359 | 364 | } |
| 360 | 365 | |
| r8417 | r8418 | |
| 364 | 369 | |
| 365 | 370 | // resize our frame if the total size has changed |
| 366 | 371 | newSize = view->total_size(); |
| 367 | | if ((newSize.x != totalSize.x) || (newSize.y != totalSize.y)) { |
| 372 | if ((newSize.x != totalSize->x) || (newSize.y != totalSize->y)) { |
| 368 | 373 | [self setFrameSize:NSMakeSize(fontWidth * newSize.x, fontHeight * newSize.y)]; |
| 369 | | totalSize = newSize; |
| 374 | totalSize->x = newSize.x; |
| 375 | totalSize->y = newSize.y; |
| 370 | 376 | } |
| 371 | 377 | |
| 372 | 378 | // scroll the view if we're being told to |
| 373 | 379 | newOrigin = view->visible_position(); |
| 374 | | if (newOrigin.y != topLeft.y) { |
| 380 | if (newOrigin.y != topLeft->y) { |
| 375 | 381 | [self scrollPoint:NSMakePoint([self visibleRect].origin.x, newOrigin.y * fontHeight)]; |
| 376 | | topLeft.y = newOrigin.y; |
| 382 | topLeft->y = newOrigin.y; |
| 377 | 383 | } |
| 378 | 384 | |
| 379 | 385 | // recompute the visible area and mark as dirty |
| r8417 | r8418 | |
| 400 | 406 | fontHeight = ceil([font ascender] - [font descender]); |
| 401 | 407 | fontAscent = [font ascender]; |
| 402 | 408 | [[self enclosingScrollView] setLineScroll:fontHeight]; |
| 403 | | totalSize.x = totalSize.y = 0; |
| 409 | totalSize->x = totalSize->y = 0; |
| 404 | 410 | [self update]; |
| 405 | 411 | } |
| 406 | 412 | |
src/emu/debug/debugcmd.c
| r8417 | r8418 | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | /* if we got a valid one, return */ |
| 537 | | device_execute_interface *exec; |
| 537 | device_execute_interface *exec = NULL; |
| 538 | 538 | for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 539 | 539 | if (cpunum-- == 0) |
| 540 | 540 | { |
| r8417 | r8418 | |
| 972 | 972 | cpu->debug()->ignore(false); |
| 973 | 973 | |
| 974 | 974 | /* then loop over CPUs and set the ignore flags on all other CPUs */ |
| 975 | | device_execute_interface *exec; |
| 975 | device_execute_interface *exec = NULL; |
| 976 | 976 | for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 977 | 977 | if (&exec->device() != cpu) |
| 978 | 978 | exec->device().debug()->ignore(true); |
| r8417 | r8418 | |
| 992 | 992 | astring buffer; |
| 993 | 993 | |
| 994 | 994 | /* loop over all executable devices */ |
| 995 | | device_execute_interface *exec; |
| 995 | device_execute_interface *exec = NULL; |
| 996 | 996 | for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 997 | 997 | |
| 998 | 998 | /* build up a comma-separated list */ |
| r8417 | r8418 | |
| 1024 | 1024 | for (int paramnum = 0; paramnum < params; paramnum++) |
| 1025 | 1025 | { |
| 1026 | 1026 | /* make sure this isn't the last live CPU */ |
| 1027 | | device_execute_interface *exec; |
| 1027 | device_execute_interface *exec = NULL; |
| 1028 | 1028 | bool gotone; |
| 1029 | 1029 | for (gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 1030 | 1030 | if (&exec->device() != devicelist[paramnum] && exec->device().debug()->observing()) |
| r8417 | r8418 | |
| 1054 | 1054 | astring buffer; |
| 1055 | 1055 | |
| 1056 | 1056 | /* loop over all executable devices */ |
| 1057 | | device_execute_interface *exec; |
| 1057 | device_execute_interface *exec = NULL; |
| 1058 | 1058 | for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 1059 | 1059 | |
| 1060 | 1060 | /* build up a comma-separated list */ |
src/emu/ui.c
| r8417 | r8418 | |
| 1004 | 1004 | string.printf("%s\n%s %s\n\nCPU:\n", machine->gamedrv->description, machine->gamedrv->year, machine->gamedrv->manufacturer); |
| 1005 | 1005 | |
| 1006 | 1006 | /* loop over all CPUs */ |
| 1007 | | device_execute_interface *exec; |
| 1007 | device_execute_interface *exec = NULL; |
| 1008 | 1008 | for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec)) |
| 1009 | 1009 | { |
| 1010 | 1010 | /* get cpu specific clock that takes internal multiplier/dividers into account */ |
| r8417 | r8418 | |
| 1012 | 1012 | |
| 1013 | 1013 | /* count how many identical CPUs we have */ |
| 1014 | 1014 | int count = 1; |
| 1015 | | device_execute_interface *scan; |
| 1015 | device_execute_interface *scan = NULL; |
| 1016 | 1016 | for (bool gotone = exec->next(scan); gotone; gotone = scan->next(scan)) |
| 1017 | 1017 | { |
| 1018 | 1018 | if (exec->device().type() != scan->device().type() || exec->device().clock() != scan->device().clock()) |
| r8417 | r8418 | |
| 1044 | 1044 | |
| 1045 | 1045 | /* count how many identical sound chips we have */ |
| 1046 | 1046 | int count = 1; |
| 1047 | | device_sound_interface *scan; |
| 1047 | device_sound_interface *scan = NULL; |
| 1048 | 1048 | for (bool gotanother = sound->next(scan); gotanother; gotanother = scan->next(scan)) |
| 1049 | 1049 | { |
| 1050 | 1050 | if (sound->device().type() != scan->device().type() || sound->device().clock() != scan->device().clock()) |
| r8417 | r8418 | |
| 1645 | 1645 | /* add CPU overclocking (cheat only) */ |
| 1646 | 1646 | if (options_get_bool(machine->options(), OPTION_CHEAT)) |
| 1647 | 1647 | { |
| 1648 | | device_execute_interface *exec; |
| 1648 | device_execute_interface *exec = NULL; |
| 1649 | 1649 | for (bool gotone = machine->m_devicelist.first(exec); exec != NULL; gotone = exec->next(exec)) |
| 1650 | 1650 | { |
| 1651 | 1651 | void *param = (void *)&exec->device(); |