summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/addrmap.c
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2012-10-10 15:33:36 +0000
committer Olivier Galibert <galibert@pobox.com>2012-10-10 15:33:36 +0000
commit5a2289ab254f01147c43a9ec9380dfa152ddf8e2 (patch)
tree1514cfd9d054f8eb95f4e79406fdc9dab6371b37 /src/emu/addrmap.c
parent6323d3af120035756299a47a98656b61b7e60517 (diff)
memory: Fix dynamic recursive device mapping [O. Galibert]
Situation: - you have a device (pc-fdc) with a memory map on it - you map it dynamically into a cpu (maincpu) address space with install_device (isa-fdc does that) - the device pc-fdc has a subdevice (upd765) - the subdevice upd765 has its own memory map - the pc-fdc memory map includes the upd765 memory map through AM_DEVICE("upd765", ...) Before the fix, the code would search for upd765 as a subdevice of maincpu and not of pc-fdc.
Diffstat (limited to 'src/emu/addrmap.c')
-rw-r--r--src/emu/addrmap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/emu/addrmap.c b/src/emu/addrmap.c
index 122e9d9b37e..3a1626bba94 100644
--- a/src/emu/addrmap.c
+++ b/src/emu/addrmap.c
@@ -716,7 +716,7 @@ address_map_entry64 *address_map::add(offs_t start, offs_t end, address_map_entr
// uplift_submaps - propagate in the device submaps
//-------------------------------------------------
-void address_map::uplift_submaps(running_machine &machine, device_t &device, endianness_t endian)
+void address_map::uplift_submaps(running_machine &machine, device_t &device, device_t &owner, endianness_t endian)
{
address_map_entry *prev = 0;
address_map_entry *entry = m_entrylist.first();
@@ -724,15 +724,17 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, end
{
if (entry->m_read.m_type == AMH_DEVICE_SUBMAP)
{
- const char *tag = entry->m_read.m_tag;
+ astring tag;
+ owner.subtag(tag, entry->m_read.m_tag);
device_t *mapdevice = machine.device(tag);
- if (mapdevice == NULL)
- throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag, m_spacenum, device.tag());
+ if (mapdevice == NULL) {
+ throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", tag.cstr(), m_spacenum, device.basetag());
+ }
// Grab the submap
address_map submap(*mapdevice, entry);
// Recursively uplift it if needed
- submap.uplift_submaps(machine, *mapdevice, endian);
+ submap.uplift_submaps(machine, device, *mapdevice, endian);
// Compute the unit repartition characteristics
int entry_bits = entry->m_submap_bits;