summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/dimemory.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/emu/dimemory.cpp b/src/emu/dimemory.cpp
index fd8d4311a3a..30a3e395afa 100644
--- a/src/emu/dimemory.cpp
+++ b/src/emu/dimemory.cpp
@@ -97,8 +97,19 @@ void device_memory_interface::interface_validity_check(validity_checker &valid)
const int max_spaces = std::max(m_address_map.size(), m_address_config.size());
for (int spacenum = 0; spacenum < max_spaces; ++spacenum)
{
- if (space_config(spacenum))
+ const address_space_config *config = space_config(spacenum);
+ if (config != nullptr)
{
+ // validate data width
+ int width = config->data_width();
+ if (width != 8 && width != 16 && width != 32 && width != 64)
+ osd_printf_error("Invalid data width %d specified for address space %d\n", width, spacenum);
+
+ // validate address shift
+ int shift = config->addr_shift();
+ if (shift < 0 && (width >> -shift) < 8)
+ osd_printf_error("Invalid shift %d specified for address space %d\n", shift, spacenum);
+
// construct the map
::address_map addrmap(const_cast<device_t &>(device()), spacenum);