summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/hp_dio/hp_dio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/hp_dio/hp_dio.cpp')
-rw-r--r--src/devices/bus/hp_dio/hp_dio.cpp63
1 files changed, 11 insertions, 52 deletions
diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp
index 3c6bbd6891b..52b2a01d13a 100644
--- a/src/devices/bus/hp_dio/hp_dio.cpp
+++ b/src/devices/bus/hp_dio/hp_dio.cpp
@@ -48,9 +48,12 @@ void dio16_slot_device::static_set_dio16_slot(device_t &device, device_t *owner,
void dio16_slot_device::device_start()
{
device_dio16_card_interface *dev = dynamic_cast<device_dio16_card_interface *>(get_card_device());
+
const device_dio32_card_interface *intf;
if (get_card_device() && get_card_device()->interface(intf))
+ {
fatalerror("DIO32 device in DIO16 slot\n");
+ }
if (dev) device_dio16_card_interface::static_set_diobus(*dev,m_owner->subdevice(m_dio_tag));
}
@@ -120,9 +123,6 @@ dio16_device::dio16_device(const machine_config &mconfig, const char *tag, devic
dio16_device::dio16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
- device_memory_interface(mconfig, *this),
- m_program_config("DIO 16-bit program", ENDIANNESS_LITTLE, 8, 24, 0, nullptr),
- m_program32_config("DIO-II 32-bit program", ENDIANNESS_LITTLE, 16, 32, 0, nullptr),
m_maincpu(nullptr),
m_prgspace(nullptr),
m_out_irq3_cb(*this),
@@ -159,55 +159,21 @@ void dio16_device::device_reset()
}
-void dio16_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
+void dio16_device::install_memory(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler)
{
- int buswidth;
- address_space *space;
-
- if (spacenum == AS_PROGRAM)
- {
- space = m_prgspace;
- buswidth = m_prgwidth;
- }
- else
- {
- fatalerror("Unknown space passed to dio16_device::install_space!\n");
- }
-
- switch(buswidth)
+ switch (m_prgwidth)
{
case 16:
- space->install_readwrite_handler(start, end, rhandler, whandler, 0xffff);
+ m_prgspace->install_readwrite_handler(start, end, rhandler, whandler);
break;
case 32:
- if ((start % 4) == 0) {
- if ((end-start)==1) {
- space->install_readwrite_handler(start, end+2, rhandler, whandler, 0x0000ffff);
- } else {
- space->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
- }
- } else {
- // we handle just misaligned by 2
- space->install_readwrite_handler(start-2, end, rhandler, whandler, 0xffff0000);
- }
+ m_prgspace->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
break;
default:
- fatalerror("DIO16: Bus width %d not supported\n", buswidth);
+ fatalerror("DIO: Bus width %d not supported\n", m_prgwidth);
}
}
-
-void dio16_device::install_memory(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
-{
- install_space(AS_PROGRAM, start, end, rhandler, whandler);
-}
-
-void dio16_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
-{
- install_space(AS_IO, start, end, rhandler, whandler);
-}
-
-
void dio16_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data)
{
m_prgspace->install_readwrite_bank(start, end, 0, tag );
@@ -219,17 +185,10 @@ void dio16_device::unmap_bank(offs_t start, offs_t end)
m_prgspace->unmap_readwrite(start, end);
}
-void dio16_device::install_rom(device_t *dev, offs_t start, offs_t end, const char *tag, const char *region)
+void dio16_device::install_rom(offs_t start, offs_t end, const char *tag, uint8_t *data)
{
- if (machine().root_device().memregion("dio")) {
- uint8_t *src = dev->memregion(region)->base();
- uint8_t *dest = machine().root_device().memregion("dio")->base() + start - 0xc0000;
- memcpy(dest,src, end - start + 1);
- } else {
- m_prgspace->install_read_bank(start, end, 0, tag);
- m_prgspace->unmap_write(start, end);
- machine().root_device().membank(m_prgspace->device().siblingtag(tag).c_str())->set_base(machine().root_device().memregion(dev->subtag(region).c_str())->base());
- }
+ m_prgspace->install_read_bank(start, end, 0, tag );
+ machine().root_device().membank(m_prgspace->device().siblingtag(tag).c_str())->set_base(data);
}
void dio16_device::unmap_rom(offs_t start, offs_t end)