src/mess/tapectrl.c
| r2653 | r2654 | |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | 15 | #include "deprecat.h" |
| 16 | 16 | |
| 17 | |
| 18 | |
| 19 | /*************************************************************************** |
| 20 | IMPLEMENTATION |
| 21 | ***************************************************************************/ |
| 22 | |
| 17 | 23 | void tapecontrol_gettime(char *timepos, size_t timepos_size, const device_config *img, int *curpos, int *endpos) |
| 18 | 24 | { |
| 19 | 25 | double t0, t1; |
| r2653 | r2654 | |
| 34 | 40 | |
| 35 | 41 | int tapecontrol(int selected) |
| 36 | 42 | { |
| 43 | running_machine *machine = Machine; |
| 37 | 44 | static int id = 0; |
| 38 | 45 | char timepos[32]; |
| 39 | 46 | ui_menu_item menu_item[40]; |
| r2653 | r2654 | |
| 151 | 158 | { |
| 152 | 159 | case 0: |
| 153 | 160 | id--; |
| 154 | | if (id < 0) id = device_count(Machine, IO_CASSETTE)-1; |
| 161 | if (id < 0) id = device_count(machine, IO_CASSETTE)-1; |
| 155 | 162 | break; |
| 156 | 163 | } |
| 157 | 164 | } |
| r2653 | r2654 | |
| 162 | 169 | { |
| 163 | 170 | case 0: |
| 164 | 171 | id++; |
| 165 | | if (id > device_count(Machine, IO_CASSETTE)-1) id = 0; |
| 172 | if (id > device_count(machine, IO_CASSETTE)-1) id = 0; |
| 166 | 173 | break; |
| 167 | 174 | } |
| 168 | 175 | } |
| r2653 | r2654 | |
| 177 | 184 | switch (sel) |
| 178 | 185 | { |
| 179 | 186 | case 0: |
| 180 | | id = (id + 1) % device_count(Machine, IO_CASSETTE); |
| 187 | id = (id + 1) % device_count(machine, IO_CASSETTE); |
| 181 | 188 | break; |
| 182 | 189 | case 2: |
| 183 | 190 | /* Pause/stop */ |
src/mess/filemngr.c
| r2653 | r2654 | |
| 14 | 14 | #include "uimenu.h" |
| 15 | 15 | #include "mslegacy.h" |
| 16 | 16 | |
| 17 | |
| 18 | |
| 19 | /*************************************************************************** |
| 20 | PARAMETERS |
| 21 | ***************************************************************************/ |
| 22 | |
| 17 | 23 | #define SEL_BITS 12 |
| 18 | 24 | #define SEL_MASK ((1<<SEL_BITS)-1) |
| 19 | 25 | |
| 26 | |
| 27 | |
| 28 | /*************************************************************************** |
| 29 | LOCAL VARIABLES |
| 30 | ***************************************************************************/ |
| 31 | |
| 20 | 32 | static int count_chars_entered; |
| 21 | 33 | static char *enter_string; |
| 22 | 34 | static int enter_string_size; |
| r2653 | r2654 | |
| 25 | 37 | |
| 26 | 38 | static char entered_filename[512]; |
| 27 | 39 | |
| 40 | |
| 41 | |
| 42 | /*************************************************************************** |
| 43 | IMPLEMENTATION |
| 44 | ***************************************************************************/ |
| 45 | |
| 28 | 46 | static void start_enter_string(char *string_buffer, int max_string_size, int filename_mode) |
| 29 | 47 | { |
| 30 | 48 | enter_string = string_buffer; |
| r2653 | r2654 | |
| 435 | 453 | { |
| 436 | 454 | int sel, total, arrowize; |
| 437 | 455 | int visible; |
| 456 | running_machine *machine = Machine; |
| 438 | 457 | |
| 439 | 458 | sel = selected - 1; |
| 440 | 459 | |
| r2653 | r2654 | |
| 551 | 570 | |
| 552 | 571 | /* pause enables/disables pause */ |
| 553 | 572 | if (input_ui_pressed(IPT_UI_PAUSE)) |
| 554 | | mame_pause(Machine, !mame_is_paused(Machine)); |
| 573 | mame_pause(machine, !mame_is_paused(machine)); |
| 555 | 574 | |
| 556 | 575 | if (input_ui_pressed(IPT_UI_SELECT)) |
| 557 | 576 | { |
| r2653 | r2654 | |
| 648 | 667 | |
| 649 | 668 | int filemanager(int selected) |
| 650 | 669 | { |
| 670 | running_machine *machine = Machine; |
| 651 | 671 | static int previous_sel; |
| 652 | 672 | const char *name; |
| 653 | 673 | ui_menu_item menu_items[40]; |
| 654 | 674 | const device_config *devices[40]; |
| 655 | 675 | char names[40][64]; |
| 656 | | int sel, total, visible, arrowize; |
| 676 | UINT32 sel, total, visible, arrowize; |
| 657 | 677 | const device_config *image; |
| 658 | 678 | |
| 659 | 679 | sel = selected - 1; |
| 660 | 680 | total = 0; |
| 661 | 681 | |
| 662 | 682 | /* Cycle through all devices for this system */ |
| 663 | | for (image = image_device_first(Machine->config); image != NULL; image = image_device_next(image)) |
| 683 | for (image = image_device_first(machine->config); image != NULL; image = image_device_next(image)) |
| 664 | 684 | { |
| 665 | 685 | strcpy( names[total], image_typename_id(image) ); |
| 666 | 686 | name = image_filename(image); |
| r2653 | r2654 | |
| 737 | 757 | |
| 738 | 758 | visible = ui_menu_draw(menu_items, total, sel, NULL); |
| 739 | 759 | |
| 740 | | /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */ |
| 741 | | |
| 742 | | /* up backs up by one item */ |
| 743 | | if (input_ui_pressed_repeat(IPT_UI_UP, 6)) |
| 744 | | sel = (sel + total - 1) % total; |
| 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 | | |
| 779 | 760 | if (input_ui_pressed(IPT_UI_SELECT)) |
| 780 | 761 | { |
| 781 | 762 | int os_sel; |
| r2653 | r2654 | |
| 826 | 807 | sel |= 1 << SEL_BITS; /* we'll ask for a key */ |
| 827 | 808 | } |
| 828 | 809 | } |
| 829 | | |
| 830 | | if (input_ui_pressed(IPT_UI_CANCEL)) |
| 810 | else if (input_ui_pressed(IPT_UI_CANCEL)) |
| 811 | { |
| 831 | 812 | sel = -1; |
| 813 | } |
| 814 | else |
| 815 | { |
| 816 | ui_menu_generic_keys(&sel, total, visible); |
| 817 | } |
| 832 | 818 | |
| 833 | 819 | if (input_ui_pressed(IPT_UI_CONFIGURE)) |
| 834 | 820 | sel = -2; |