src/mess/filemngr.c
| r2581 | r2582 | |
| 489 | 489 | fs_item[sel & SEL_MASK].subtext = current_filespecification; |
| 490 | 490 | |
| 491 | 491 | /* display the menu */ |
| 492 | | ui_menu_draw(fs_item, fs_total, sel & SEL_MASK, NULL); |
| 492 | visible = ui_menu_draw(fs_item, fs_total, sel & SEL_MASK, NULL); |
| 493 | 493 | |
| 494 | 494 | /* update string with any keys that are pressed */ |
| 495 | 495 | name = update_entered_string(); |
| r2581 | r2582 | |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | |
| 515 | | ui_menu_draw(fs_item, fs_total, sel, NULL); |
| 515 | visible = ui_menu_draw(fs_item, fs_total, sel, NULL); |
| 516 | 516 | |
| 517 | | visible = 0; |
| 517 | /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */ |
| 518 | 518 | |
| 519 | /* up backs up by one item */ |
| 520 | if (input_ui_pressed_repeat(IPT_UI_UP, 6)) |
| 521 | sel = (sel + total - 1) % total; |
| 522 | |
| 519 | 523 | /* down advances by one item */ |
| 520 | 524 | if (input_ui_pressed_repeat(IPT_UI_DOWN, 6)) |
| 521 | | { |
| 522 | | sel++; |
| 523 | | sel = MIN(sel,total); |
| 524 | | } |
| 525 | sel = (sel + 1) % total; |
| 525 | 526 | |
| 526 | | /* end goes to the last */ |
| 527 | | if (input_ui_pressed_repeat(IPT_UI_END, 6)) |
| 527 | /* page up backs up by visible_items */ |
| 528 | if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6)) |
| 528 | 529 | { |
| 529 | | sel = total - 1; |
| 530 | if (sel >= visible - 1) |
| 531 | sel -= visible - 1; |
| 532 | else |
| 533 | sel = 0; |
| 530 | 534 | } |
| 531 | 535 | |
| 532 | 536 | /* page down advances by visible_items */ |
| 533 | 537 | if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6)) |
| 534 | 538 | { |
| 535 | | sel = (sel + visible - 1); |
| 536 | | sel = MIN(sel,total); |
| 539 | sel += visible - 1; |
| 540 | if (sel >= total) |
| 541 | sel = total - 1; |
| 537 | 542 | } |
| 538 | 543 | |
| 539 | | /* up backs up by one item */ |
| 540 | | if (input_ui_pressed_repeat(IPT_UI_UP, 6)) |
| 541 | | { |
| 542 | | sel--; |
| 543 | | sel = MAX(0,sel); |
| 544 | | } |
| 545 | | |
| 546 | 544 | /* home goes to the start */ |
| 547 | | if (input_ui_pressed_repeat(IPT_UI_HOME, 6)) |
| 548 | | { |
| 549 | | sel = 1; |
| 550 | | } |
| 545 | if (input_ui_pressed(IPT_UI_HOME)) |
| 546 | sel = 0; |
| 551 | 547 | |
| 552 | | /* page up backs up by visible_items */ |
| 553 | | if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6)) |
| 554 | | { |
| 555 | | sel = (sel - visible + 1); |
| 556 | | sel = MAX(0,sel); |
| 557 | | } |
| 548 | /* end goes to the last */ |
| 549 | if (input_ui_pressed(IPT_UI_END)) |
| 550 | sel = total - 1; |
| 558 | 551 | |
| 552 | /* pause enables/disables pause */ |
| 553 | if (input_ui_pressed(IPT_UI_PAUSE)) |
| 554 | mame_pause(Machine, !mame_is_paused(Machine)); |
| 555 | |
| 559 | 556 | if (input_ui_pressed(IPT_UI_SELECT)) |
| 560 | 557 | { |
| 561 | 558 | if (sel < SEL_MASK) |
| r2581 | r2582 | |
| 656 | 653 | ui_menu_item menu_items[40]; |
| 657 | 654 | const device_config *devices[40]; |
| 658 | 655 | char names[40][64]; |
| 659 | | int sel, total, arrowize; |
| 656 | int sel, total, visible, arrowize; |
| 660 | 657 | const device_config *image; |
| 661 | 658 | |
| 662 | 659 | sel = selected - 1; |
| r2581 | r2582 | |
| 708 | 705 | } |
| 709 | 706 | |
| 710 | 707 | memset(&menu_items[total], 0, sizeof(menu_items[total])); |
| 711 | | menu_items[total].text = ui_getstring(UI_returntomain); |
| 708 | menu_items[total].text = "Return to Prior Menu"; |
| 712 | 709 | total++; |
| 713 | 710 | |
| 714 | 711 | arrowize = 0; |
| r2581 | r2582 | |
| 721 | 718 | menu_items[sel & SEL_MASK].subtext = entered_filename; |
| 722 | 719 | |
| 723 | 720 | /* display the menu */ |
| 724 | | ui_menu_draw(menu_items, total, sel & SEL_MASK, NULL); |
| 721 | visible = ui_menu_draw(menu_items, total, sel & SEL_MASK, NULL); |
| 725 | 722 | |
| 726 | 723 | /* update string with any keys that are pressed */ |
| 727 | 724 | name = update_entered_string(); |
| r2581 | r2582 | |
| 738 | 735 | return sel + 1; |
| 739 | 736 | } |
| 740 | 737 | |
| 741 | | ui_menu_draw(menu_items, total, sel, NULL); |
| 738 | visible = ui_menu_draw(menu_items, total, sel, NULL); |
| 742 | 739 | |
| 743 | | if (input_ui_pressed_repeat(IPT_UI_DOWN, 8)) |
| 744 | | sel = (sel + 1) % total; |
| 740 | /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */ |
| 745 | 741 | |
| 746 | | if (input_ui_pressed_repeat(IPT_UI_UP, 8)) |
| 742 | /* up backs up by one item */ |
| 743 | if (input_ui_pressed_repeat(IPT_UI_UP, 6)) |
| 747 | 744 | sel = (sel + total - 1) % total; |
| 748 | 745 | |
| 746 | /* down advances by one item */ |
| 747 | if (input_ui_pressed_repeat(IPT_UI_DOWN, 6)) |
| 748 | sel = (sel + 1) % total; |
| 749 | |
| 750 | /* page up backs up by visible_items */ |
| 751 | if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6)) |
| 752 | { |
| 753 | if (sel >= visible - 1) |
| 754 | sel -= visible - 1; |
| 755 | else |
| 756 | sel = 0; |
| 757 | } |
| 758 | |
| 759 | /* page down advances by visible_items */ |
| 760 | if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6)) |
| 761 | { |
| 762 | sel += visible - 1; |
| 763 | if (sel >= total) |
| 764 | sel = total - 1; |
| 765 | } |
| 766 | |
| 767 | /* home goes to the start */ |
| 768 | if (input_ui_pressed(IPT_UI_HOME)) |
| 769 | sel = 0; |
| 770 | |
| 771 | /* end goes to the last */ |
| 772 | if (input_ui_pressed(IPT_UI_END)) |
| 773 | sel = total - 1; |
| 774 | |
| 775 | /* pause enables/disables pause */ |
| 776 | if (input_ui_pressed(IPT_UI_PAUSE)) |
| 777 | mame_pause(Machine, !mame_is_paused(Machine)); |
| 778 | |
| 749 | 779 | if (input_ui_pressed(IPT_UI_SELECT)) |
| 750 | 780 | { |
| 751 | 781 | int os_sel; |