Kludge some absolute tag lookups in the core that can't really be helped (nw)

This commit is contained in:
AJR 2018-05-21 01:10:24 -04:00
parent 3ac6d70be0
commit 49f354d544
4 changed files with 8 additions and 10 deletions

View File

@ -441,7 +441,7 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t *&res
}
/* first look for a tag match */
result = m_machine.device(param);
result = m_machine.root_device().subdevice(param);
if (result)
return true;

View File

@ -296,7 +296,7 @@ bool debugger_cpu::comment_load(bool is_inline)
for (util::xml::data_node const *cpunode = systemnode->get_child("cpu"); cpunode; cpunode = cpunode->get_next_sibling("cpu"))
{
const char *cputag_name = cpunode->get_attribute_string("tag", "");
device_t *device = m_machine.device(cputag_name);
device_t *device = m_machine.root_device().subdevice(cputag_name);
if (device != nullptr)
{
if(is_inline == false)
@ -692,7 +692,7 @@ device_t* debugger_cpu::expression_get_device(const char *tag)
// convert to lowercase then lookup the name (tags are enforced to be all lower case)
std::string fullname(tag);
strmakelower(fullname);
return m_machine.device(fullname.c_str());
return m_machine.root_device().subdevice(fullname.c_str());
}

View File

@ -1241,9 +1241,9 @@ void rom_load_manager::process_disk_entries(const char *regiontag, const rom_ent
void rom_load_manager::normalize_flags_for_device(running_machine &machine, const char *rgntag, u8 &width, endianness_t &endian)
{
device_t *device = machine.device(rgntag);
device_t *device = machine.root_device().subdevice(rgntag);
device_memory_interface *memory;
if (device->interface(memory))
if (device != nullptr && device->interface(memory))
{
const address_space_config *spaceconfig = memory->space_config();
if (spaceconfig != nullptr)
@ -1341,8 +1341,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list
memory_region *memregion = machine().root_device().memregion(regiontag.c_str());
if (memregion != nullptr)
{
if (machine().device(regiontag.c_str()) != nullptr)
normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness);
normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness);
/* clear old region (todo: should be moved to an image unload function) */
machine().memory().region_free(memregion->name());
@ -1418,8 +1417,7 @@ void rom_load_manager::process_region_list()
/* if this is a device region, override with the device width and endianness */
u8 width = ROMREGION_GETWIDTH(region) / 8;
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
if (machine().device(regiontag.c_str()) != nullptr)
normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness);
normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness);
/* remember the base and length */
m_region = machine().memory().region_alloc(regiontag.c_str(), regionlength, width, endianness);

View File

@ -762,7 +762,7 @@ void device_scheduler::rebuild_execute_list()
// if the configuration specifies a device to make perfect, pick that as the minimum
if (!machine().config().m_perfect_cpu_quantum.empty())
{
device_t *device = machine().device(machine().config().m_perfect_cpu_quantum.c_str());
device_t *device = machine().root_device().subdevice(machine().config().m_perfect_cpu_quantum.c_str());
if (device == nullptr)
fatalerror("Device '%s' specified for perfect interleave is not present!\n", machine().config().m_perfect_cpu_quantum.c_str());