summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/dirom.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-11-25 17:29:44 -0500
committer AJR <ajrhacker@users.noreply.github.com>2016-11-25 17:47:10 -0500
commit4c9814ab301c0b34f9a16fcd7bad945579d0e646 (patch)
tree391b6c9712b2096d232daf8d1a01a099b7fbbfca /src/emu/dirom.cpp
parent2aeab228e8d4dba67ee2fc26eaf9a8ac60004740 (diff)
Move SEI80BU encryption out of the SEIBU_SOUND device and make it a device of its own
Add MCFG_DEVICE_ROM to override region tag for device_rom_interface (nw)
Diffstat (limited to 'src/emu/dirom.cpp')
-rw-r--r--src/emu/dirom.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/emu/dirom.cpp b/src/emu/dirom.cpp
index a4a9aadc365..5351534ec06 100644
--- a/src/emu/dirom.cpp
+++ b/src/emu/dirom.cpp
@@ -3,6 +3,7 @@
device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian, u8 datawidth) :
device_memory_interface(mconfig, device),
+ m_rom_tag(device.basetag()),
m_rom_config("rom", endian, datawidth, addrwidth)
{
}
@@ -11,6 +12,15 @@ device_rom_interface::~device_rom_interface()
{
}
+void device_rom_interface::static_set_device_rom_tag(device_t &device, const char *tag)
+{
+ device_rom_interface *romintf;
+ if (!device.interface(romintf))
+ throw emu_fatalerror("MCFG_DEVICE_ROM called on device '%s' with no ROM interface\n", device.tag());
+
+ romintf->m_rom_tag = tag;
+}
+
const address_space_config *device_rom_interface::memory_space_config(address_spacenum spacenum) const
{
return spacenum ? nullptr : &m_rom_config;
@@ -81,10 +91,11 @@ void device_rom_interface::interface_pre_start()
device().machine().save().register_postload(save_prepost_delegate(FUNC(device_rom_interface::reset_bank), this));
if(!has_configured_map(0)) {
- memory_region *reg = device().memregion(DEVICE_SELF);
+ memory_region *reg = device().owner()->memregion(m_rom_tag);
if(reg)
set_rom(reg->base(), reg->bytes());
else {
+ device().logerror("ROM region '%s' not found\n", m_rom_tag);
u32 end = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1;
space().unmap_read(0, end);
}