summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/addrmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/addrmap.cpp')
-rw-r--r--src/emu/addrmap.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index c44e4285303..abcc2799025 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -47,17 +47,6 @@ address_map_entry::address_map_entry(device_t &device, address_map &map, offs_t
m_bytemirror(0),
m_bytemask(0)
{
- if (map.m_globalmask != 0 && (start & ~map.m_globalmask) != 0)
- {
- osd_printf_warning("AS_%d map entry start %08X lies outside global address mask %08X\n", map.m_spacenum, start, map.m_globalmask);
- m_addrstart &= map.m_globalmask;
- }
-
- if (map.m_globalmask != 0 && (end & ~map.m_globalmask) != 0)
- {
- osd_printf_warning("AS_%d map entry end %08X lies outside global address mask %08X\n", map.m_spacenum, end, map.m_globalmask);
- m_addrend &= map.m_globalmask;
- }
}
@@ -635,6 +624,10 @@ void address_map::map_validity_check(validity_checker &valid, address_spacenum s
if (m_databits != datawidth)
osd_printf_error("Wrong memory handlers provided for %s space! (width = %d, memory = %08x)\n", spaceconfig.m_name, datawidth, m_databits);
+ offs_t globalmask = 0xffffffffUL >> (32 - spaceconfig.m_addrbus_width);
+ if (m_globalmask != 0)
+ globalmask = m_globalmask;
+
// loop over entries and look for errors
for (address_map_entry &entry : m_entrylist)
{
@@ -663,6 +656,12 @@ void address_map::map_validity_check(validity_checker &valid, address_spacenum s
if (byteend < bytestart)
osd_printf_error("Wrong %s memory read handler start = %08x > end = %08x\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend);
+ // look for ranges outside the global mask
+ if (entry.m_addrstart & ~globalmask)
+ osd_printf_error("In %s memory range %x-%x, start address is outside of the global address mask %x\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, globalmask);
+ if (entry.m_addrend & ~globalmask)
+ osd_printf_error("In %s memory range %x-%x, end address is outside of the global address mask %x\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, globalmask);
+
// look for misaligned entries
if ((bytestart & (alignunit - 1)) != 0 || (byteend & (alignunit - 1)) != (alignunit - 1))
osd_printf_error("Wrong %s memory read handler start = %08x, end = %08x ALIGN = %d\n", spaceconfig.m_name, entry.m_addrstart, entry.m_addrend, alignunit);