mirror of
https://github.com/holub/mame
synced 2025-05-11 08:38:47 +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,10 +318,19 @@ bool device_memory_interface::interface_validity_check(emu_options &options, con
|
|||||||
{
|
{
|
||||||
astring fulltag;
|
astring fulltag;
|
||||||
astring regiontag;
|
astring regiontag;
|
||||||
if (strchr(entry->m_region,':')) {
|
|
||||||
regiontag = entry->m_region;
|
// a leading : on a region name indicates an absolute region, so fix up accordingly
|
||||||
} else {
|
if (entry->m_region[0] == ':')
|
||||||
device().siblingtag(regiontag, entry->m_region);
|
{
|
||||||
|
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);
|
rom_region_name(fulltag, &driver, source, romp);
|
||||||
if (fulltag.cmp(regiontag) == 0)
|
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)
|
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);
|
return m_regionlist.find(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2198,10 +2198,19 @@ void address_space::prepare_map()
|
|||||||
if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
|
if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
|
||||||
{
|
{
|
||||||
astring regiontag;
|
astring regiontag;
|
||||||
if (strchr(entry->m_region,':')) {
|
|
||||||
regiontag = entry->m_region;
|
// a leading : on a region name indicates an absolute region, so fix up accordingly
|
||||||
} else {
|
if (entry->m_region[0] == ':')
|
||||||
m_device.siblingtag(regiontag, entry->m_region);
|
{
|
||||||
|
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());
|
const memory_region *region = machine().region(regiontag.cstr());
|
||||||
if (region == NULL)
|
if (region == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user