mirror of
https://github.com/holub/mame
synced 2025-05-10 16:21:42 +03:00
Allow region tags starting with a : to mean "absolute" so devices can access the parent base driver's ROM regions [R. Belmont]
This commit is contained in:
parent
cc60a2d683
commit
1d64e14960
@ -318,11 +318,20 @@ bool device_memory_interface::interface_validity_check(emu_options &options, con
|
||||
{
|
||||
astring fulltag;
|
||||
astring regiontag;
|
||||
|
||||
// a leading : on a region name indicates an absolute region, so fix up accordingly
|
||||
if (entry->m_region[0] == ':')
|
||||
{
|
||||
regiontag = &entry->m_region[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strchr(entry->m_region,':')) {
|
||||
regiontag = entry->m_region;
|
||||
} else {
|
||||
device().siblingtag(regiontag, entry->m_region);
|
||||
}
|
||||
}
|
||||
rom_region_name(fulltag, &driver, source, romp);
|
||||
if (fulltag.cmp(regiontag) == 0)
|
||||
{
|
||||
|
@ -617,6 +617,12 @@ inline const input_port_config *running_machine::port(const char *tag)
|
||||
|
||||
inline const memory_region *running_machine::region(const char *tag)
|
||||
{
|
||||
// if tag begins with a :, it's absolute
|
||||
if (tag[0] == ':')
|
||||
{
|
||||
return m_regionlist.find(&tag[1]);
|
||||
}
|
||||
|
||||
return m_regionlist.find(tag);
|
||||
}
|
||||
|
||||
|
@ -2198,11 +2198,20 @@ void address_space::prepare_map()
|
||||
if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
|
||||
{
|
||||
astring regiontag;
|
||||
|
||||
// a leading : on a region name indicates an absolute region, so fix up accordingly
|
||||
if (entry->m_region[0] == ':')
|
||||
{
|
||||
regiontag = &entry->m_region[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strchr(entry->m_region,':')) {
|
||||
regiontag = entry->m_region;
|
||||
} else {
|
||||
m_device.siblingtag(regiontag, entry->m_region);
|
||||
}
|
||||
}
|
||||
const memory_region *region = machine().region(regiontag.cstr());
|
||||
if (region == NULL)
|
||||
fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", m_device.tag(), m_name, entry->m_addrstart, entry->m_addrend, entry->m_region);
|
||||
|
Loading…
Reference in New Issue
Block a user