diff options
Diffstat (limited to 'src/devices/bus/spectrum/fuller.cpp')
-rw-r--r-- | src/devices/bus/spectrum/fuller.cpp | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/src/devices/bus/spectrum/fuller.cpp b/src/devices/bus/spectrum/fuller.cpp index 636967cbdd6..36275ccc4cd 100644 --- a/src/devices/bus/spectrum/fuller.cpp +++ b/src/devices/bus/spectrum/fuller.cpp @@ -84,62 +84,51 @@ void spectrum_fuller_device::device_start() } +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void spectrum_fuller_device::device_reset() +{ + m_exp->set_io_space(&io_space()); + + io_space().install_write_handler(0x3f, 0x3f, 0, 0xff00, 0, write8_delegate(FUNC(ay8910_device::address_w), m_psg.target())); + io_space().install_readwrite_handler(0x5f, 0x5f, 0, 0xff00, 0, read8_delegate(FUNC(ay8910_device::data_r), m_psg.target()), write8_delegate(FUNC(ay8910_device::data_w), m_psg.target())); + io_space().install_read_handler(0x7f, 0x7f, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_fuller_device::joystick_r), this)); +} + + //************************************************************************** // IMPLEMENTATION //************************************************************************** +READ8_MEMBER(spectrum_fuller_device::joystick_r) +{ + return m_joy->read() | (0xff ^ 0x8f); +} + READ_LINE_MEMBER(spectrum_fuller_device::romcs) { return m_exp->romcs(); } -void spectrum_fuller_device::opcode_fetch(offs_t offset) +READ8_MEMBER(spectrum_fuller_device::mreq_r) { - m_exp->opcode_fetch(offset); + return m_exp->mreq_r(space, offset); } -uint8_t spectrum_fuller_device::mreq_r(offs_t offset) +WRITE8_MEMBER(spectrum_fuller_device::mreq_w) { - uint8_t data = 0xff; - if (m_exp->romcs()) - data &= m_exp->mreq_r(offset); - - return data; + m_exp->mreq_w(space, offset, data); } -void spectrum_fuller_device::mreq_w(offs_t offset, uint8_t data) +READ8_MEMBER(spectrum_fuller_device::port_fe_r) { + uint8_t data = 0xff; + if (m_exp->romcs()) - m_exp->mreq_w(offset, data); -} + data &= m_exp->port_fe_r(space, offset); -uint8_t spectrum_fuller_device::iorq_r(offs_t offset) -{ - uint8_t data = m_exp->iorq_r(offset); - - switch (offset & 0xff) - { - case 0x5f: - data &= m_psg->data_r(); - break; - case 0x7f: - data &= m_joy->read() | (0xff ^ 0x8f); - break; - } return data; } - -void spectrum_fuller_device::iorq_w(offs_t offset, uint8_t data) -{ - switch (offset & 0xff) - { - case 0x3f: - m_psg->address_w(data); - break; - case 0x5f: - m_psg->data_w(data); - break; - } - m_exp->iorq_w(offset, data); -} |