src/emu/ioport.c
| r15091 | r15092 | |
| 2596 | 2596 | { |
| 2597 | 2597 | // add an exit callback and a frame callback |
| 2598 | 2598 | machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ioport_manager::exit), this)); |
| 2599 | | machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update), this)); |
| 2599 | machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(ioport_manager::frame_update_callback), this)); |
| 2600 | 2600 | |
| 2601 | 2601 | // initialize the default port info from the OSD |
| 2602 | 2602 | init_port_types(); |
| r15091 | r15092 | |
| 2939 | 2939 | |
| 2940 | 2940 | |
| 2941 | 2941 | //------------------------------------------------- |
| 2942 | | // frame_update - core logic for per-frame input |
| 2943 | | // port updating |
| 2942 | // frame_update - callback for once/frame updating |
| 2944 | 2943 | //------------------------------------------------- |
| 2945 | 2944 | |
| 2946 | | void ioport_manager::frame_update() |
| 2945 | void ioport_manager::frame_update_callback() |
| 2947 | 2946 | { |
| 2948 | 2947 | // if we're paused, don't do anything |
| 2949 | | if (machine().paused()) |
| 2950 | | return; |
| 2948 | if (!machine().paused()) |
| 2949 | frame_update(); |
| 2950 | } |
| 2951 | 2951 | |
| 2952 | |
| 2953 | //------------------------------------------------- |
| 2954 | // frame_update_internal - core logic for |
| 2955 | // per-frame input port updating |
| 2956 | //------------------------------------------------- |
| 2957 | |
| 2958 | void ioport_manager::frame_update() |
| 2959 | { |
| 2952 | 2960 | g_profiler.start(PROFILER_INPUT); |
| 2953 | 2961 | |
| 2954 | 2962 | // record/playback information about the current frame |
src/emu/ioport.h
| r15091 | r15092 | |
| 1258 | 1258 | ioport_value frame_interpolate(ioport_value oldval, ioport_value newval); |
| 1259 | 1259 | ioport_type token_to_input_type(const char *string, int &player) const; |
| 1260 | 1260 | const char *input_type_to_token(astring &string, ioport_type type, int player); |
| 1261 | | void frame_update(); |
| 1262 | 1261 | |
| 1263 | 1262 | private: |
| 1264 | 1263 | // internal helpers |
| 1265 | 1264 | void init_port_types(); |
| 1266 | 1265 | void init_autoselect_devices(int type1, int type2, int type3, const char *option, const char *ananame); |
| 1267 | 1266 | |
| 1267 | void frame_update_callback(); |
| 1268 | void frame_update(); |
| 1269 | |
| 1268 | 1270 | ioport_port *port(const char *tag) const { return m_portlist.find(tag); } |
| 1269 | 1271 | void exit(); |
| 1270 | 1272 | input_seq_type token_to_seq_type(const char *string); |