addrmap.c: Only install the default device address map if the owner didn't provide one [Alex Jackson]

This commit is contained in:
Alex W. Jackson 2014-09-19 07:44:48 +00:00
parent ec7f4a5246
commit 1e0edb788b

View File

@ -334,21 +334,23 @@ address_map::address_map(device_t &device, address_spacenum spacenum)
if (!device.interface(memintf)) if (!device.interface(memintf))
throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum); throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum);
// append the internal device map (first so it takes priority) */ // construct the internal device map (first so it takes priority)
if (spaceconfig->m_internal_map != NULL) if (spaceconfig->m_internal_map != NULL)
(*spaceconfig->m_internal_map)(*this, device); (*spaceconfig->m_internal_map)(*this, device);
if (!spaceconfig->m_internal_map_delegate.isnull()) if (!spaceconfig->m_internal_map_delegate.isnull())
spaceconfig->m_internal_map_delegate(*this, device); spaceconfig->m_internal_map_delegate(*this, device);
// construct the standard map */ // append the map provided by the owner
if (memintf->address_map(spacenum) != NULL) if (memintf->address_map(spacenum) != NULL)
(*memintf->address_map(spacenum))(*this, *device.owner()); (*memintf->address_map(spacenum))(*this, *device.owner());
else
// append the default device map (last so it can be overridden) */ {
if (spaceconfig->m_default_map != NULL) // if the owner didn't provide a map, use the default device map
(*spaceconfig->m_default_map)(*this, device); if (spaceconfig->m_default_map != NULL)
if (!spaceconfig->m_default_map_delegate.isnull()) (*spaceconfig->m_default_map)(*this, device);
spaceconfig->m_default_map_delegate(*this, device); if (!spaceconfig->m_default_map_delegate.isnull())
spaceconfig->m_default_map_delegate(*this, device);
}
} }