diff options
Diffstat (limited to 'src/devices/bus/hp_hil/hp_hil.cpp')
-rw-r--r-- | src/devices/bus/hp_hil/hp_hil.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp index 2e8a904c97b..e1e477b5d58 100644 --- a/src/devices/bus/hp_hil/hp_hil.cpp +++ b/src/devices/bus/hp_hil/hp_hil.cpp @@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE(HP_HIL_SLOT, hp_hil_slot_device, "hp_hil_slot", "HP-HIL Slot" //------------------------------------------------- hp_hil_slot_device::hp_hil_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP_HIL_SLOT, tag, owner, clock) - , device_slot_interface(mconfig, *this) + , device_single_card_slot_interface<device_hp_hil_interface>(mconfig, *this) , m_mlc(*this, finder_base::DUMMY_TAG) { } @@ -39,7 +39,7 @@ hp_hil_slot_device::hp_hil_slot_device(const machine_config &mconfig, const char void hp_hil_slot_device::device_start() { - device_hp_hil_interface *dev = dynamic_cast<device_hp_hil_interface *>(get_card_device()); + device_hp_hil_interface *dev = get_card_device(); if (dev) dev->set_hp_hil_mlc(*m_mlc); } @@ -56,14 +56,19 @@ DEFINE_DEVICE_TYPE(HP_HIL_MLC, hp_hil_mlc_device, "hp_hil_mlc", "HP-HIL Master L // hp_hil_mlc_device - constructor //------------------------------------------------- hp_hil_mlc_device::hp_hil_mlc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, HP_HIL_MLC, tag, owner, clock) - , int_cb(*this) - , nmi_cb(*this) + : device_t{mconfig, HP_HIL_MLC, tag, owner, clock} + , m_r2{0} + , m_r3{0} + , m_w1{0} + , m_w2{0} + , m_w3{0} + , m_loop{1} + , int_cb{*this} + , nmi_cb{*this} { - m_loop = 1; } -void hp_hil_mlc_device::add_hp_hil_device( device_hp_hil_interface *device ) +void hp_hil_mlc_device::add_hp_hil_device(device_hp_hil_interface *device) { m_device_list.append(*device); } @@ -74,10 +79,6 @@ void hp_hil_mlc_device::add_hp_hil_device( device_hp_hil_interface *device ) //------------------------------------------------- void hp_hil_mlc_device::device_start() { - // resolve callbacks - int_cb.resolve_safe(); - nmi_cb.resolve_safe(); - save_item(NAME(m_r2)); save_item(NAME(m_r3)); save_item(NAME(m_w1)); @@ -96,10 +97,14 @@ void hp_hil_mlc_device::device_reset() m_r2 = 0; m_r3 = 0; // HPMLC_R3_NMI; + m_w1 = 0; + m_w2 = 0; + m_w3 = 0; + m_loop = 1; } -WRITE8_MEMBER(hp_hil_mlc_device::write) +void hp_hil_mlc_device::write(offs_t offset, uint8_t data) { device_hp_hil_interface *entry = m_device_list.first(); uint16_t tmp = data | (m_w1 << 8); @@ -154,7 +159,7 @@ WRITE8_MEMBER(hp_hil_mlc_device::write) } } -READ8_MEMBER(hp_hil_mlc_device::read) +uint8_t hp_hil_mlc_device::read(offs_t offset) { uint8_t data = 0; @@ -216,7 +221,7 @@ void hp_hil_mlc_device::hil_write(uint16_t data) } } -WRITE_LINE_MEMBER(hp_hil_mlc_device::ap_w) +void hp_hil_mlc_device::ap_w(int state) { uint16_t data = HPMLC_W1_C | HPHIL_POL; if (state && (m_w3 & HPMLC_W3_APE)) @@ -242,8 +247,10 @@ WRITE_LINE_MEMBER(hp_hil_mlc_device::ap_w) //------------------------------------------------- device_hp_hil_interface::device_hp_hil_interface(const machine_config &mconfig, device_t &device) - : device_slot_card_interface(mconfig, device) + : device_interface(device, "hphil") , m_hp_hil_mlc(nullptr) + , m_device_id(0) + , m_device_id16(0) , m_next(nullptr) { } |