diff options
author | Vas Crabb <vas@vastheman.com> | 2021-07-15 04:09:18 +1000 |
---|---|---|
committer | Vas Crabb <cuavas@users.noreply.github.com> | 2021-07-15 13:54:40 +1000 |
commit | 37157461313b13a691722b83c87df8d2315457da (patch) | |
tree | 8034c6f33776f5a8bfc8f6c69af879975061bd0a /src/frontend/mame/ui | |
parent | 66554d3b84f5fec60dcf5d896283a1a04487c0e0 (diff) |
API cleanups and miscellaneous fixes.
emu/ioport.cpp: Allow controller files to override input sequences for
inputs that don't use defaults, and to override the toggle setting for
digital inputs.
emu/config.cpp: Expose configuration level (mostly matters for
controller files), improved verbose diagnostic messages, and moved a few
things out of the global and preprocessor namespaces.
docs: Added documentation for some controller configuration file
features. The device mapping feature documentation will be merged in at
some point.
util/unicode.cpp, emu/input.cpp: API cleanups.
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r-- | src/frontend/mame/ui/devopt.cpp | 4 | ||||
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 10 | ||||
-rw-r--r-- | src/frontend/mame/ui/ui.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp index f5e73f290e0..178f0af8d96 100644 --- a/src/frontend/mame/ui/devopt.cpp +++ b/src/frontend/mame/ui/devopt.cpp @@ -221,7 +221,7 @@ void menu_device_config::populate(float &customtop, float &custombottom) { dips++; bool def(false); - for (ioport_setting &setting : field.settings()) + for (ioport_setting const &setting : field.settings()) { if (setting.value() == field.defvalue()) { @@ -237,7 +237,7 @@ void menu_device_config::populate(float &customtop, float &custombottom) { confs++; bool def(false); - for (ioport_setting &setting : field.settings()) + for (ioport_setting const &setting : field.settings()) { if (setting.value() == field.defvalue()) { diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index bbc9c1aa6cd..9f176cca141 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -218,8 +218,8 @@ void mame_ui_manager::init() machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&mame_ui_manager::exit, this)); machine().configuration().config_register( "ui_warnings", - config_load_delegate(&mame_ui_manager::config_load, this), - config_save_delegate(&mame_ui_manager::config_save, this)); + configuration_manager::load_delegate(&mame_ui_manager::config_load, this), + configuration_manager::save_delegate(&mame_ui_manager::config_save, this)); // create mouse bitmap uint32_t *dst = &m_mouse_bitmap.pix(0); @@ -258,10 +258,10 @@ void mame_ui_manager::exit() // config_load - load configuration data //------------------------------------------------- -void mame_ui_manager::config_load(config_type cfg_type, util::xml::data_node const *parentnode) +void mame_ui_manager::config_load(config_type cfg_type, config_level cfg_level, util::xml::data_node const *parentnode) { // make sure it's relevant and there's data available - if (config_type::GAME == cfg_type) + if (config_type::SYSTEM == cfg_type) { m_unemulated_features.clear(); m_imperfect_features.clear(); @@ -302,7 +302,7 @@ void mame_ui_manager::config_load(config_type cfg_type, util::xml::data_node con void mame_ui_manager::config_save(config_type cfg_type, util::xml::data_node *parentnode) { // only save system-level configuration when times are valid - if ((config_type::GAME == cfg_type) && (std::time_t(-1) != m_last_launch_time) && (std::time_t(-1) != m_last_warning_time)) + if ((config_type::SYSTEM == cfg_type) && (std::time_t(-1) != m_last_launch_time) && (std::time_t(-1) != m_last_warning_time)) { parentnode->set_attribute_int("launched", static_cast<long long>(m_last_launch_time)); parentnode->set_attribute_int("warned", static_cast<long long>(m_last_warning_time)); diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index aa169df9fd7..e9df57b3b2d 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -257,7 +257,7 @@ private: // private methods void exit(); - void config_load(config_type cfg_type, util::xml::data_node const *parentnode); + void config_load(config_type cfg_type, config_level cfg_level, util::xml::data_node const *parentnode); void config_save(config_type cfg_type, util::xml::data_node *parentnode); template <typename... Params> void slider_alloc(Params &&...args) { m_sliders.push_back(std::make_unique<slider_state>(std::forward<Params>(args)...)); } |