summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-05-03 09:00:08 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-05-03 09:00:08 +0000
commit2a88e54278acc526c11dba7961204f234f1f6e05 (patch)
tree1d78e932e47bb535e7e56ddac05232cdf551c3a1 /src/osd
parent605a48921b48e0127ff0330f1e895dcf16d084fb (diff)
ioport.c C++ conversion. Mostly internal changes, with no
intended differences from previous behavior. For drivers, the main change is that input_port_read() no longer exists. Instead, the port must be fetched from the appropriate device, and then read() is called. For member functions, this is actually simpler/cleaner: value = ioport("tag")->read() For legacy functions which have a driver_data state, it goes: value = state->ioport("tag")->read() For other legacy functions, they need to fetch the root device: value = machine.root_device().ioport("tag")->read() The other big change for drivers is that IPT_VBLANK is gone. Instead, it has been replaced by a device line callback on the screen device. There's a new macro PORT_VBLANK("tag") which automatically points things to the right spot. Here's a set of imperfect search & replace strings to convert the input_port_read calls and fix up IPT_VBLANK: input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\)) ioport\1\3->read\(\) input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\)) \2\.root_device\(\)\.ioport\1\3->read\(\) (state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\. \1state-> (state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\. \1state-> input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\)) ioport\1\3->read_safe\(\4\) IPT_VBLANK( *\)) IPT_CUSTOM\1 PORT_VBLANK("screen")
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/sdl/input.c58
-rw-r--r--src/osd/windows/debugwin.c2
-rw-r--r--src/osd/windows/input.c23
3 files changed, 40 insertions, 43 deletions
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 1434f1392e7..7dbbab91a37 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -1651,7 +1651,7 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
{
- switch (entry->type)
+ switch (entry->type())
{
// configurable UI mode switch
case IPT_UI_TOGGLE_UI:
@@ -1670,26 +1670,23 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
mameid_code = lookup_mame_code(fullmode);
}
ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
- entry->defseq[SEQ_TYPE_STANDARD].set(ui_code);
+ entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
- entry->token = "TOGGLE_FULLSCREEN";
- entry->name = "Toggle Fullscreen";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, KEYCODE_LALT);
+ entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, KEYCODE_LALT);
break;
// disable UI_SELECT when LALT is down, this stops selecting
// things in the menu when toggling fullscreen with LALT+ENTER
/* case IPT_UI_SELECT:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
break;*/
// page down for fastforward (must be OSD_3 as per src/emu/ui.c)
case IPT_UI_FAST_FORWARD:
- entry->token = "FAST_FORWARD";
- entry->name = "Fast Forward";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_PGDN);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_PGDN);
break;
// OSD hotkeys use LCTRL and start at F3, they start at
@@ -1699,68 +1696,67 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
// LCTRL-F3 to toggle fullstretch
case IPT_OSD_2:
- entry->token = "TOGGLE_FULLSTRETCH";
- entry->name = "Toggle Uneven stretch";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_FULLSTRETCH", "Toggle Uneven stretch");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the reset key
case IPT_UI_SOFT_RESET:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// LCTRL-F4 to toggle keep aspect
case IPT_OSD_4:
- entry->token = "TOGGLE_KEEP_ASPECT";
- entry->name = "Toggle Keepaspect";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_KEEP_ASPECT", "Toggle Keepaspect");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the show gfx key
case IPT_UI_SHOW_GFX:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F5 to toggle OpenGL filtering
case IPT_OSD_5:
- entry->token = "TOGGLE_FILTER";
- entry->name = "Toggle Filter";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, KEYCODE_LCONTROL);
+ entry->configure_osd("TOGGLE_FILTER", "Toggle Filter");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle debug key
case IPT_UI_TOGGLE_DEBUG:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F6 to decrease OpenGL prescaling
case IPT_OSD_6:
- entry->token = "DECREASE_PRESCALE";
- entry->name = "Decrease Prescaling";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, KEYCODE_LCONTROL);
+ entry->configure_osd("DECREASE_PRESCALE", "Decrease Prescaling");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle cheat key
case IPT_UI_TOGGLE_CHEAT:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F7 to increase OpenGL prescaling
case IPT_OSD_7:
- entry->token = "INCREASE_PRESCALE";
- entry->name = "Increase Prescaling";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, KEYCODE_LCONTROL);
+ entry->configure_osd("INCREASE_PRESCALE", "Increase Prescaling");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the load state key
case IPT_UI_LOAD_STATE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// add a Not lcrtl condition to the throttle key
case IPT_UI_THROTTLE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
break;
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between apps)
case IPT_UI_CONFIGURE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ break;
+
+ // leave everything else alone
+ default:
break;
}
}
diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c
index 1c308aa9de0..ad0143e7329 100644
--- a/src/osd/windows/debugwin.c
+++ b/src/osd/windows/debugwin.c
@@ -335,7 +335,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
static int debugwin_seq_pressed(running_machine &machine)
{
- const input_seq &seq = input_type_seq(machine, IPT_UI_DEBUG_BREAK, 0, SEQ_TYPE_STANDARD);
+ const input_seq &seq = machine.ioport().type_seq(IPT_UI_DEBUG_BREAK);
int result = FALSE;
int invert = FALSE;
int first = TRUE;
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index c94d2c67cb5..d0c9bfd8660 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -767,33 +767,34 @@ void windows_osd_interface::customize_input_type_list(simple_list<input_type_ent
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
- switch (entry->type)
+ switch (entry->type())
{
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between windows apps)
case IPT_UI_CONFIGURE:
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
- entry->token = "TOGGLE_FULLSCREEN";
- entry->name = "Toggle Fullscreen";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_ENTER);
+ entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_ENTER);
break;
// alt-F12 for fullscreen snap
case IPT_OSD_2:
- entry->token = "RENDER_SNAP";
- entry->name = "Take Rendered Snapshot";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F12);
+ entry->configure_osd("RENDER_SNAP", "Take Rendered Snapshot");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F12);
break;
// alt-F11 for fullscreen video
case IPT_OSD_3:
- entry->token = "RENDER_AVI";
- entry->name = "Record Rendered Video";
- entry->defseq[SEQ_TYPE_STANDARD].set(KEYCODE_LALT, KEYCODE_F11);
+ entry->configure_osd("RENDER_AVI", "Record Rendered Video");
+ entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_LALT, KEYCODE_F11);
+ break;
+
+ // leave everything else alone
+ default:
break;
}
}