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/osd/modules | |
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/osd/modules')
-rw-r--r-- | src/osd/modules/debugger/debugosx.mm | 12 | ||||
-rw-r--r-- | src/osd/modules/debugger/debugqt.cpp | 20 |
2 files changed, 14 insertions, 18 deletions
diff --git a/src/osd/modules/debugger/debugosx.mm b/src/osd/modules/debugger/debugosx.mm index 629f3e15707..66797e38453 100644 --- a/src/osd/modules/debugger/debugosx.mm +++ b/src/osd/modules/debugger/debugosx.mm @@ -71,7 +71,7 @@ public: private: void create_console(); void build_menus(); - void config_load(config_type cfgtype, util::xml::data_node const *parentnode); + void config_load(config_type cfgtype, config_level cfglevel, util::xml::data_node const *parentnode); void config_save(config_type cfgtype, util::xml::data_node *parentnode); running_machine *m_machine; @@ -129,8 +129,8 @@ void debugger_osx::init_debugger(running_machine &machine) m_machine = &machine; machine.configuration().config_register( "debugger", - config_load_delegate(&debugger_osx::config_load, this), - config_save_delegate(&debugger_osx::config_save, this)); + configuration_manager::load_delegate(&debugger_osx::config_load, this), + configuration_manager::save_delegate(&debugger_osx::config_save, this)); } @@ -305,9 +305,9 @@ void debugger_osx::build_menus() // restore state based on configuration XML //============================================================ -void debugger_osx::config_load(config_type cfgtype, util::xml::data_node const *parentnode) +void debugger_osx::config_load(config_type cfgtype, config_level cfglevel, util::xml::data_node const *parentnode) { - if ((config_type::GAME == cfgtype) && parentnode) + if ((config_type::SYSTEM == cfgtype) && parentnode) { if (m_console) { @@ -331,7 +331,7 @@ void debugger_osx::config_load(config_type cfgtype, util::xml::data_node const * void debugger_osx::config_save(config_type cfgtype, util::xml::data_node *parentnode) { - if ((config_type::GAME == cfgtype) && m_console) + if ((config_type::SYSTEM == cfgtype) && m_console) { NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init]; NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithPointer:m_machine], diff --git a/src/osd/modules/debugger/debugqt.cpp b/src/osd/modules/debugger/debugqt.cpp index c8845d42448..6731dc63e21 100644 --- a/src/osd/modules/debugger/debugqt.cpp +++ b/src/osd/modules/debugger/debugqt.cpp @@ -79,21 +79,17 @@ MainWindow *mainQtWindow = nullptr; std::vector<std::unique_ptr<WindowQtConfig> > xmlConfigurations; -void xml_configuration_load(running_machine &machine, config_type cfg_type, util::xml::data_node const *parentnode) +void xml_configuration_load(running_machine &machine, config_type cfg_type, config_level cfg_level, util::xml::data_node const *parentnode) { - // We only care about game files - if (cfg_type != config_type::GAME) - return; - - // Might not have any data - if (!parentnode) + // We only care about system configuration files + if ((cfg_type != config_type::SYSTEM) || !parentnode) return; xmlConfigurations.clear(); // Configuration load util::xml::data_node const *wnode = nullptr; - for (wnode = parentnode->get_child("window"); wnode != nullptr; wnode = wnode->get_next_sibling("window")) + for (wnode = parentnode->get_child("window"); wnode; wnode = wnode->get_next_sibling("window")) { WindowQtConfig::WindowType type = (WindowQtConfig::WindowType)wnode->get_attribute_int("type", WindowQtConfig::WIN_TYPE_UNKNOWN); switch (type) @@ -114,8 +110,8 @@ void xml_configuration_load(running_machine &machine, config_type cfg_type, util void xml_configuration_save(running_machine &machine, config_type cfg_type, util::xml::data_node *parentnode) { - // We only write to game configurations - if (cfg_type != config_type::GAME) + // We only save system configuration + if (cfg_type != config_type::SYSTEM) return; for (int i = 0; i < xmlConfigurations.size(); i++) @@ -269,8 +265,8 @@ void debug_qt::init_debugger(running_machine &machine) m_machine = &machine; // Setup the configuration XML saving and loading machine.configuration().config_register("debugger", - config_load_delegate(&xml_configuration_load, &machine), - config_save_delegate(&xml_configuration_save, &machine)); + configuration_manager::load_delegate(&xml_configuration_load, &machine), + configuration_manager::save_delegate(&xml_configuration_save, &machine)); } |