| Previous | 199869 Revisions | Next |
| r31690 Monday 18th August, 2014 at 07:59:13 UTC by Fabio Priuli |
|---|
| (MESS) ui.c: added shortcut commands for Tape Start and Tape Stop, by default mapped to F2 and Shift+F2, respectively. This is not meant as a replacement for the internal Tape Control menu, but it shall make simpler the usage of game tapes in home computers. Notice that REC/RWD/FWD have still to be pressed from the internal UI and that if you mount multiple cassettes in a driver with multiple tape drives only the first one will be controllable with these shortcuts. [Fabio Priuli] The idea is that more complex actions (e.g. save you own BASIC program or copy programs from a tape to another, etc.) should be performed through the internal menu, while people just aiming to play games can use the shortcut. This commit requires probably a clean build. |
| [src/emu] | inpttype.h ioport.h |
| [src/emu/ui] | ui.c |
| r31689 | r31690 | |
|---|---|---|
| 367 | 367 | IPT_UI_PASTE, |
| 368 | 368 | IPT_UI_SAVE_STATE, |
| 369 | 369 | IPT_UI_LOAD_STATE, |
| 370 | IPT_UI_TAPE_START, | |
| 371 | IPT_UI_TAPE_STOP, | |
| 370 | 372 | |
| 371 | 373 | // additional OSD-specified UI port types (up to 16) |
| 372 | 374 | IPT_OSD_1, |
| r31689 | r31690 | |
|---|---|---|
| 749 | 749 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_TOGGLE_DEBUG, "Toggle Debugger", input_seq(KEYCODE_F5) ) |
| 750 | 750 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SAVE_STATE, "Save State", input_seq(KEYCODE_F7, KEYCODE_LSHIFT) ) |
| 751 | 751 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_LOAD_STATE, "Load State", input_seq(KEYCODE_F7, input_seq::not_code, KEYCODE_LSHIFT) ) |
| 752 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_TAPE_START, "UI (First) Tape Start", input_seq(KEYCODE_F2, input_seq::not_code, KEYCODE_LSHIFT) ) | |
| 753 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_TAPE_STOP, "UI (First) Tape Stop", input_seq(KEYCODE_F2, KEYCODE_LSHIFT) ) | |
| 752 | 754 | } |
| 753 | 755 | |
| 754 | 756 | void construct_core_types_OSD(simple_list<input_type_entry> &typelist) |
| r31689 | r31690 | |
|---|---|---|
| 21 | 21 | #include "ui/mainmenu.h" |
| 22 | 22 | #include "ui/miscmenu.h" |
| 23 | 23 | #include "ui/viewgfx.h" |
| 24 | #include "imagedev/cassette.h" | |
| 24 | 25 | #include <ctype.h> |
| 25 | 26 | |
| 26 | 27 | |
| r31689 | r31690 | |
| 1550 | 1551 | machine.pause(); |
| 1551 | 1552 | return machine.ui().set_handler(ui_gfx_ui_handler, is_paused); |
| 1552 | 1553 | } |
| 1553 | ||
| 1554 | ||
| 1555 | // handle a tape control key | |
| 1556 | if (ui_input_pressed(machine, IPT_UI_TAPE_START)) | |
| 1557 | { | |
| 1558 | cassette_device_iterator cassiter(machine.root_device()); | |
| 1559 | for (cassette_image_device *cass = cassiter.first(); cass != NULL; cass = cassiter.next()) | |
| 1560 | { | |
| 1561 | cass->change_state(CASSETTE_PLAY, CASSETTE_MASK_UISTATE); | |
| 1562 | return 0; | |
| 1563 | } | |
| 1564 | } | |
| 1565 | if (ui_input_pressed(machine, IPT_UI_TAPE_STOP)) | |
| 1566 | { | |
| 1567 | cassette_device_iterator cassiter(machine.root_device()); | |
| 1568 | for (cassette_image_device *cass = cassiter.first(); cass != NULL; cass = cassiter.next()) | |
| 1569 | { | |
| 1570 | cass->change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE); | |
| 1571 | return 0; | |
| 1572 | } | |
| 1573 | } | |
| 1574 | ||
| 1554 | 1575 | // handle a save state request |
| 1555 | 1576 | if (ui_input_pressed(machine, IPT_UI_SAVE_STATE)) |
| 1556 | 1577 | { |
| Previous | 199869 Revisions | Next |