summaryrefslogtreecommitdiffstats
path: root/src/emu/mconfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/mconfig.cpp')
-rw-r--r--src/emu/mconfig.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp
index 9e86e2206ad..6c052d7ce23 100644
--- a/src/emu/mconfig.cpp
+++ b/src/emu/mconfig.cpp
@@ -40,9 +40,9 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
{
device_t &owner = slot->device();
std::string selval;
- bool isdefault = (options.priority(owner.tag().c_str()+1)==OPTION_PRIORITY_DEFAULT);
- if (is_selected_driver && options.exists(owner.tag().c_str()+1))
- selval = options.main_value(owner.tag().c_str()+1);
+ bool isdefault = (options.priority(owner.tag()+1)==OPTION_PRIORITY_DEFAULT);
+ if (is_selected_driver && options.exists(owner.tag()+1))
+ selval = options.main_value(owner.tag()+1);
else if (slot->default_option() != nullptr)
selval.assign(slot->default_option());
@@ -67,7 +67,7 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
device_t::static_set_input_default(*new_dev, input_device_defaults);
}
else
- throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval.c_str(), owner.tag().c_str()+1);
+ throw emu_fatalerror("Unknown slot option '%s' in slot '%s'", selval.c_str(), owner.tag()+1);
}
}
@@ -108,10 +108,9 @@ screen_device *machine_config::first_screen() const
// new device
//-------------------------------------------------
-device_t *machine_config::device_add(device_t *owner, std::string _tag, device_type type, UINT32 clock)
+device_t *machine_config::device_add(device_t *owner, const char *tag, device_type type, UINT32 clock)
{
- const char *orig_tag = _tag.c_str();
- const char *tag = _tag.c_str();
+ const char *orig_tag = tag;
// if the device path is absolute, start from the root
if (tag[0] == ':')
@@ -159,14 +158,14 @@ device_t *machine_config::device_add(device_t *owner, std::string _tag, device_t
// replace one device with a new device
//-------------------------------------------------
-device_t *machine_config::device_replace(device_t *owner, std::string tag, device_type type, UINT32 clock)
+device_t *machine_config::device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock)
{
// find the original device by this name (must exist)
assert(owner != nullptr);
device_t *device = owner->subdevice(tag);
if (device == nullptr)
{
- osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag.c_str());
+ osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag);
return device_add(owner, tag, type, clock);
}
@@ -180,14 +179,14 @@ device_t *machine_config::device_replace(device_t *owner, std::string tag, devic
// remove a device
//-------------------------------------------------
-device_t *machine_config::device_remove(device_t *owner, std::string tag)
+device_t *machine_config::device_remove(device_t *owner, const char *tag)
{
// find the original device by this name (must exist)
assert(owner != nullptr);
device_t *device = owner->subdevice(tag);
if (device == nullptr)
{
- osd_printf_warning("Warning: attempting to remove non-existent device '%s'\n", tag.c_str());
+ osd_printf_warning("Warning: attempting to remove non-existent device '%s'\n", tag);
return nullptr;
}
@@ -202,14 +201,14 @@ device_t *machine_config::device_remove(device_t *owner, std::string tag)
// locate a device
//-------------------------------------------------
-device_t *machine_config::device_find(device_t *owner, std::string tag)
+device_t *machine_config::device_find(device_t *owner, const char *tag)
{
// find the original device by this name (must exist)
assert(owner != nullptr);
device_t *device = owner->subdevice(tag);
assert(device != nullptr);
if (device == nullptr)
- throw emu_fatalerror("Unable to find device '%s'\n", tag.c_str());
+ throw emu_fatalerror("Unable to find device '%s'\n", tag);
// return the device
return device;