Fixed AM_REGION to be relative to device (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2011-06-22 12:13:55 +00:00
parent 181a545884
commit d0793e644d
2 changed files with 11 additions and 4 deletions

View File

@ -317,8 +317,10 @@ bool device_memory_interface::interface_validity_check(emu_options &options, con
if (regiontag != NULL)
{
astring fulltag;
astring regiontag;
device().siblingtag(regiontag, entry->m_region);
rom_region_name(fulltag, &driver, source, romp);
if (fulltag.cmp(entry->m_region) == 0)
if (fulltag.cmp(regiontag) == 0)
{
// verify the address range is within the region's bounds
offs_t length = ROMREGION_GETLENGTH(romp);

View File

@ -2135,7 +2135,9 @@ void address_space::prepare_map()
// validate adjusted addresses against implicit regions
if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
{
const memory_region *region = machine().region(entry->m_region);
astring regiontag;
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);
@ -2145,8 +2147,11 @@ void address_space::prepare_map()
}
// convert any region-relative entries to their memory pointers
if (entry->m_region != NULL)
entry->m_memory = machine().region(entry->m_region)->base() + entry->m_rgnoffs;
if (entry->m_region != NULL) {
astring regiontag;
m_device.siblingtag(regiontag, entry->m_region);
entry->m_memory = machine().region(regiontag.cstr())->base() + entry->m_rgnoffs;
}
}
// now loop over all the handlers and enforce the address mask