diff options
Diffstat (limited to 'src/emu/addrmap.cpp')
-rw-r--r-- | src/emu/addrmap.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp index 0403008b110..2ae44142ac1 100644 --- a/src/emu/addrmap.cpp +++ b/src/emu/addrmap.cpp @@ -36,6 +36,8 @@ address_map_entry::address_map_entry(device_t &device, address_map &map, offs_t m_addrend((map.m_globalmask == 0) ? end : end & map.m_globalmask), m_addrmirror(0), m_addrmask(0), + m_share(nullptr), + m_region(nullptr), m_rgnoffs(0), m_submap_bits(0), m_memory(nullptr), @@ -64,7 +66,7 @@ void address_map_entry::set_mask(offs_t _mask) // retrieve a submap from a device //------------------------------------------------- -void address_map_entry::set_submap(std::string tag, address_map_delegate func, int bits, UINT64 mask) +void address_map_entry::set_submap(const char *tag, address_map_delegate func, int bits, UINT64 mask) { if(!bits) bits = m_map.m_databits; @@ -335,12 +337,12 @@ address_map::address_map(device_t &device, address_spacenum spacenum) // get our memory interface const device_memory_interface *memintf; if (!device.interface(memintf)) - throw emu_fatalerror("No memory interface defined for device '%s'\n", device.tag().c_str()); + throw emu_fatalerror("No memory interface defined for device '%s'\n", device.tag()); // and then the configuration for the current address space const address_space_config *spaceconfig = memintf->space_config(spacenum); if (spaceconfig == nullptr) - throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag().c_str(), spacenum); + throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum); // construct the internal device map (first so it takes priority) if (spaceconfig->m_internal_map != nullptr) @@ -676,14 +678,14 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de osd_printf_error("Wrong %s memory read handler start = %08x, end = %08x ALIGN = %d\n", spaceconfig.m_name, entry->m_addrstart, entry->m_addrend, alignunit); // if this is a program space, auto-assign implicit ROM entries - if (entry->m_read.m_type == AMH_ROM && entry->m_region.empty()) + if (entry->m_read.m_type == AMH_ROM && entry->m_region == nullptr) { entry->m_region = device.tag(); entry->m_rgnoffs = entry->m_addrstart; } // if this entry references a memory region, validate it - if (!entry->m_region.empty() && entry->m_share.empty()) + if (entry->m_region != nullptr && entry->m_share == nullptr) { // make sure we can resolve the full path to the region bool found = false; @@ -699,21 +701,21 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de // verify the address range is within the region's bounds offs_t length = ROMREGION_GETLENGTH(romp); if (entry->m_rgnoffs + (byteend - bytestart + 1) > length) - osd_printf_error("%s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", spaceconfig.m_name, entry->m_addrstart, entry->m_addrend, entry->m_region.c_str(), length); + osd_printf_error("%s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", spaceconfig.m_name, entry->m_addrstart, entry->m_addrend, entry->m_region, length); found = true; } } // error if not found if (!found) - osd_printf_error("%s space memory map entry %X-%X references non-existant region '%s'\n", spaceconfig.m_name, entry->m_addrstart, entry->m_addrend, entry->m_region.c_str()); + osd_printf_error("%s space memory map entry %X-%X references non-existant region '%s'\n", spaceconfig.m_name, entry->m_addrstart, entry->m_addrend, entry->m_region); } // make sure all devices exist if (entry->m_read.m_type == AMH_DEVICE_DELEGATE) { // extract the device tag from the proto-delegate - std::string devtag; + const char *devtag = nullptr; switch (entry->m_read.m_bits) { case 8: devtag = entry->m_rproto8.device_name(); break; @@ -723,12 +725,12 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de } if (entry->m_devbase.subdevice(devtag) == nullptr) osd_printf_error("%s space memory map entry reads from nonexistant device '%s'\n", spaceconfig.m_name, - !devtag.empty() ? devtag.c_str() : "<unspecified>"); + devtag != nullptr ? devtag : "<unspecified>"); } if (entry->m_write.m_type == AMH_DEVICE_DELEGATE) { // extract the device tag from the proto-delegate - std::string devtag; + const char *devtag = nullptr; switch (entry->m_write.m_bits) { case 8: devtag = entry->m_wproto8.device_name(); break; @@ -738,15 +740,15 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de } if (entry->m_devbase.subdevice(devtag) == nullptr) osd_printf_error("%s space memory map entry writes to nonexistant device '%s'\n", spaceconfig.m_name, - !devtag.empty() ? devtag.c_str() : "<unspecified>"); + devtag != nullptr ? devtag : "<unspecified>"); } if (entry->m_setoffsethd.m_type == AMH_DEVICE_DELEGATE) { // extract the device tag from the proto-delegate - std::string devtag = entry->m_soproto.device_name(); + const char *devtag = entry->m_soproto.device_name(); if (entry->m_devbase.subdevice(devtag) == nullptr) osd_printf_error("%s space memory map entry references nonexistant device '%s'\n", spaceconfig.m_name, - !devtag.empty() ? devtag.c_str() : "<unspecified>"); + devtag != nullptr ? devtag : "<unspecified>"); } // make sure ports exist @@ -756,10 +758,10 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de // validate bank and share tags if (entry->m_read.m_type == AMH_BANK) - valid.validate_tag(entry->m_read.m_tag.c_str()); + valid.validate_tag(entry->m_read.m_tag); if (entry->m_write.m_type == AMH_BANK) - valid.validate_tag(entry->m_write.m_tag.c_str()); - if (!entry->m_share.empty()) - valid.validate_tag(entry->m_share.c_str()); + valid.validate_tag(entry->m_write.m_tag); + if (entry->m_share != nullptr) + valid.validate_tag(entry->m_share); } } |