summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r--src/frontend/mame/ui/ui.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 24d7b61fd2e..df941f3ceb7 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -1210,6 +1210,30 @@ void mame_ui_manager::draw_profiler(render_container *container)
//-------------------------------------------------
+// start_save_state
+//-------------------------------------------------
+
+void mame_ui_manager::start_save_state()
+{
+ machine().pause();
+ m_load_save_hold = true;
+ set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_SAVE);
+}
+
+
+//-------------------------------------------------
+// start_load_state
+//-------------------------------------------------
+
+void mame_ui_manager::start_load_state()
+{
+ machine().pause();
+ m_load_save_hold = true;
+ set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_LOAD);
+}
+
+
+//-------------------------------------------------
// image_handler_ingame - execute display
// callback function for each image device
//-------------------------------------------------
@@ -1386,18 +1410,14 @@ UINT32 mame_ui_manager::handler_ingame(render_container *container)
// handle a save state request
if (machine().ui_input().pressed(IPT_UI_SAVE_STATE))
{
- machine().pause();
- m_load_save_hold = true;
- set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_SAVE);
+ start_save_state();
return LOADSAVE_SAVE;
}
// handle a load state request
if (machine().ui_input().pressed(IPT_UI_LOAD_STATE))
{
- machine().pause();
- m_load_save_hold = true;
- set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_LOAD);
+ start_load_state();
return LOADSAVE_LOAD;
}