path: root/src/frontend/mame/ui/devopt.cpp
diff options
author Vas Crabb <>2020-11-25 19:18:26 +1100
committer Vas Crabb <>2020-11-25 19:18:26 +1100
commitec8042864703f9ce6cc9b0cf528e6a8528104b89 (patch)
tree427556c7d86c7cab5f136aff7f0675adc443144b /src/frontend/mame/ui/devopt.cpp
parent8ea35743e40bd6dc01e50a0a21524db7b0ad203e (diff)
Fairly significant overhaul of Lua engine and some cleanup.
The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
Diffstat (limited to 'src/frontend/mame/ui/devopt.cpp')
1 files changed, 7 insertions, 7 deletions
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index 8688c513c6f..0172a65b3de 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -32,7 +32,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
machine_config &mconfig(const_cast<machine_config &>(machine().config()));
machine_config::token const tok(mconfig.begin_configuration(mconfig.root_device()));
device_t *const dev = mconfig.device_add(m_option->name(), m_option->devtype(), 0);
- for (device_t &d : device_iterator(*dev))
+ for (device_t &d : device_enumerator(*dev))
if (!d.configured())
@@ -46,7 +46,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
// loop over all CPUs
- execute_interface_iterator execiter(*dev);
+ execute_interface_enumerator execiter(*dev);
if (execiter.count() > 0)
str << _("* CPU:\n");
@@ -90,7 +90,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
// display screen information
- screen_device_iterator scriter(*dev);
+ screen_device_enumerator scriter(*dev);
if (scriter.count() > 0)
str << _("* Video:\n");
@@ -122,7 +122,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
// loop over all sound chips
- sound_interface_iterator snditer(*dev);
+ sound_interface_enumerator snditer(*dev);
if (snditer.count() > 0)
str << _("* Sound:\n");
@@ -192,7 +192,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
std::string errors;
std::ostringstream dips_opt, confs_opt;
ioport_list portlist;
- for (device_t &iptdev : device_iterator(*dev))
+ for (device_t &iptdev : device_enumerator(*dev))
portlist.append(iptdev, errors);
// check if the device adds inputs to the system
@@ -272,7 +272,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
if (input_keyboard)
util::stream_format(str, _(" Keyboard inputs [%1$d inputs]\n"), input_keyboard);
- image_interface_iterator imgiter(*dev);
+ image_interface_enumerator imgiter(*dev);
if (imgiter.count() > 0)
str << _("* Media Options:\n");
@@ -280,7 +280,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
util::stream_format(str, _(" %1$s [tag: %2$s]\n"), imagedev.image_type_name(), imagedev.device().tag());
- slot_interface_iterator slotiter(*dev);
+ slot_interface_enumerator slotiter(*dev);
if (slotiter.count() > 0)
str << _("* Slot Options:\n");