diff options
Diffstat (limited to 'src/devices/machine/cxd1095.cpp')
-rw-r--r-- | src/devices/machine/cxd1095.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/devices/machine/cxd1095.cpp b/src/devices/machine/cxd1095.cpp index bb39a440bed..7819751e573 100644 --- a/src/devices/machine/cxd1095.cpp +++ b/src/devices/machine/cxd1095.cpp @@ -17,7 +17,7 @@ **********************************************************************/ #include "emu.h" -#include "machine/cxd1095.h" +#include "cxd1095.h" //************************************************************************** // GLOBAL VARIABLES @@ -35,8 +35,8 @@ DEFINE_DEVICE_TYPE(CXD1095, cxd1095_device, "cxd1095", "CXD1095 I/O Expander") cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, CXD1095, tag, owner, clock) - , m_input_cb{{*this}, {*this}, {*this}, {*this}, {*this}} - , m_output_cb{{*this}, {*this}, {*this}, {*this}, {*this}} + , m_input_cb(*this, 0) + , m_output_cb(*this) { } @@ -46,12 +46,6 @@ cxd1095_device::cxd1095_device(const machine_config &mconfig, const char *tag, d void cxd1095_device::device_start() { - // resolve callbacks - for (auto &cb : m_input_cb) - cb.resolve(); - for (auto &cb : m_output_cb) - cb.resolve(); - std::fill(std::begin(m_data_latch), std::end(m_data_latch), 0); // save state @@ -72,7 +66,7 @@ void cxd1095_device::device_reset() // read - read from an input port //------------------------------------------------- -READ8_MEMBER(cxd1095_device::read) +u8 cxd1095_device::read(offs_t offset) { if (offset < 5) { @@ -82,7 +76,7 @@ READ8_MEMBER(cxd1095_device::read) input_mask &= 0x0f; // read through callback if port not configured entirely for output - if (input_mask != 0 && !m_input_cb[offset].isnull()) + if (input_mask != 0 && !m_input_cb[offset].isunset()) input_data = m_input_cb[offset](0, input_mask) & input_mask; else if (m_data_dir[offset] == 0xff) logerror("Reading from undefined input port %c\n", 'A' + offset); @@ -100,7 +94,7 @@ READ8_MEMBER(cxd1095_device::read) // control registers //------------------------------------------------- -WRITE8_MEMBER(cxd1095_device::write) +void cxd1095_device::write(offs_t offset, u8 data) { if (offset < 5) { @@ -113,7 +107,7 @@ WRITE8_MEMBER(cxd1095_device::write) // send output through callback u8 dataout = data & ~m_data_dir[offset]; - if (!m_output_cb[offset].isnull()) + if (!m_output_cb[offset].isunset()) m_output_cb[offset](0, dataout, ~m_data_dir[offset]); else logerror("Writing %02X to undefined output port %c\n", dataout, 'A' + offset); |