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

trunk/src/emu/ioport.h
r31689r31690
367367      IPT_UI_PASTE,
368368      IPT_UI_SAVE_STATE,
369369      IPT_UI_LOAD_STATE,
370      IPT_UI_TAPE_START,
371      IPT_UI_TAPE_STOP,
370372
371373      // additional OSD-specified UI port types (up to 16)
372374      IPT_OSD_1,
trunk/src/emu/inpttype.h
r31689r31690
749749   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_TOGGLE_DEBUG,     "Toggle Debugger",        input_seq(KEYCODE_F5) )
750750   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_SAVE_STATE,       "Save State",             input_seq(KEYCODE_F7, KEYCODE_LSHIFT) )
751751   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) )
752754}
753755
754756void construct_core_types_OSD(simple_list<input_type_entry> &typelist)
trunk/src/emu/ui/ui.c
r31689r31690
2121#include "ui/mainmenu.h"
2222#include "ui/miscmenu.h"
2323#include "ui/viewgfx.h"
24#include "imagedev/cassette.h"
2425#include <ctype.h>
2526
2627
r31689r31690
15501551         machine.pause();
15511552      return machine.ui().set_handler(ui_gfx_ui_handler, is_paused);
15521553   }
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   
15541575   // handle a save state request
15551576   if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
15561577   {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team