summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-06-24 23:53:38 +1000
committer Vas Crabb <vas@vastheman.com>2016-06-24 23:53:38 +1000
commit20a95045e16ab69cfb13c6d3cf520e63aa553102 (patch)
tree3a4b4bab3ed8afaedc6a9c499c5737dc6df5d91e /src/frontend/mame/ui/ui.cpp
parent83a9cf42056efe9c78d39b89e4ba394a07c79dce (diff)
parent7509a56dc0cf8a380eada014167b8075fbcbcdc9 (diff)
Load save state preparations [Nathan Woods]
* A number of changes and refactorings in preparation for a new load/save state menu. Most notably, I am C++-ifying osd_directory (now osd::directory) and changing osd_stat() to return std::unique_ptrosd::directory::entry * Take note that this change completely omits POSIX support, simply because I lack a development environment to support it. This will have to be done by someone else.
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;
}