summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/ioport.c20
-rw-r--r--src/emu/ioport.h4
2 files changed, 17 insertions, 7 deletions
diff --git a/src/emu/ioport.c b/src/emu/ioport.c
index 2341aa9a51c..9ebc0fe9d25 100644
--- a/src/emu/ioport.c
+++ b/src/emu/ioport.c
@@ -2596,7 +2596,7 @@ time_t ioport_manager::initialize()
{
// add an exit callback and a frame callback
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ioport_manager::exit), this));
- machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update), this));
+ machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update_callback), this));
// initialize the default port info from the OSD
init_port_types();
@@ -2939,16 +2939,24 @@ digital_joystick &ioport_manager::digjoystick(int player, int number)
//-------------------------------------------------
-// frame_update - core logic for per-frame input
-// port updating
+// frame_update - callback for once/frame updating
//-------------------------------------------------
-void ioport_manager::frame_update()
+void ioport_manager::frame_update_callback()
{
// if we're paused, don't do anything
- if (machine().paused())
- return;
+ if (!machine().paused())
+ frame_update();
+}
+
+//-------------------------------------------------
+// frame_update_internal - core logic for
+// per-frame input port updating
+//-------------------------------------------------
+
+void ioport_manager::frame_update()
+{
g_profiler.start(PROFILER_INPUT);
// record/playback information about the current frame
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index 21050a6fb57..0254970e6f8 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -1258,13 +1258,15 @@ public:
ioport_value frame_interpolate(ioport_value oldval, ioport_value newval);
ioport_type token_to_input_type(const char *string, int &player) const;
const char *input_type_to_token(astring &string, ioport_type type, int player);
- void frame_update();
private:
// internal helpers
void init_port_types();
void init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame);
+ void frame_update_callback();
+ void frame_update();
+
ioport_port *port(const char *tag) const { return m_portlist.find(tag); }
void exit();
input_seq_type token_to_seq_type(const char *string);