summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/device.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2018-08-26 10:35:15 +0200
committer Olivier Galibert <galibert@pobox.com>2018-08-26 10:36:30 +0200
commitdd64cdceee66f5b3f5b92eb8e62348f8c4a786cf (patch)
tree75bf0e751222849ae0a58a16438efa4bd1cb45d1 /src/emu/device.cpp
parent03adeab064e844d8cb26dbb2c7ce56f2b1fb72f9 (diff)
emumem: Fix ioports/membanks in internal maps [O. Galibert]
PS: That may break things, we'll see.
Diffstat (limited to 'src/emu/device.cpp')
-rw-r--r--src/emu/device.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/emu/device.cpp b/src/emu/device.cpp
index 058ac84d7c4..aa6e2342411 100644
--- a/src/emu/device.cpp
+++ b/src/emu/device.cpp
@@ -127,10 +127,10 @@ device_t::~device_t()
// info for a given region
//-------------------------------------------------
-memory_region *device_t::memregion(const char *_tag) const
+memory_region *device_t::memregion(std::string _tag) const
{
// build a fully-qualified name and look it up
- if (_tag)
+ if (_tag != "")
{
auto search = machine().memory().regions().find(subtag(_tag).c_str());
if (search != machine().memory().regions().end())
@@ -148,10 +148,10 @@ memory_region *device_t::memregion(const char *_tag) const
// info for a given share
//-------------------------------------------------
-memory_share *device_t::memshare(const char *_tag) const
+memory_share *device_t::memshare(std::string _tag) const
{
// build a fully-qualified name and look it up
- if (_tag)
+ if (_tag != "")
{
auto search = machine().memory().shares().find(subtag(_tag).c_str());
if (search != machine().memory().shares().end())
@@ -169,9 +169,9 @@ memory_share *device_t::memshare(const char *_tag) const
// bank info for a given bank
//-------------------------------------------------
-memory_bank *device_t::membank(const char *_tag) const
+memory_bank *device_t::membank(std::string _tag) const
{
- if (_tag)
+ if (_tag != "")
{
auto search = machine().memory().banks().find(subtag(_tag).c_str());
if (search != machine().memory().banks().end())
@@ -189,7 +189,7 @@ memory_bank *device_t::membank(const char *_tag) const
// object for a given port name
//-------------------------------------------------
-ioport_port *device_t::ioport(const char *tag) const
+ioport_port *device_t::ioport(std::string tag) const
{
// build a fully-qualified name and look it up
return machine().ioport().port(subtag(tag).c_str());
@@ -890,8 +890,9 @@ device_t *device_t::subdevice_slow(const char *tag) const
// to our device based on the provided tag
//-------------------------------------------------
-std::string device_t::subtag(const char *tag) const
+std::string device_t::subtag(std::string _tag) const
{
+ const char *tag = _tag.c_str();
std::string result;
// if the tag begins with a colon, ignore our path and start from the root
if (*tag == ':')