diff options
Diffstat (limited to 'src/devices/bus/spectrum/fuller.cpp')
-rw-r--r-- | src/devices/bus/spectrum/fuller.cpp | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/src/devices/bus/spectrum/fuller.cpp b/src/devices/bus/spectrum/fuller.cpp index 4a1e70905c2..636967cbdd6 100644 --- a/src/devices/bus/spectrum/fuller.cpp +++ b/src/devices/bus/spectrum/fuller.cpp @@ -84,35 +84,28 @@ void spectrum_fuller_device::device_start() } -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void spectrum_fuller_device::device_reset() -{ - io_space().install_write_handler(0x3f, 0x3f, 0, 0xff00, 0, write8smo_delegate(FUNC(ay8910_device::address_w), m_psg.target())); - io_space().install_readwrite_handler(0x5f, 0x5f, 0, 0xff00, 0, read8smo_delegate(FUNC(ay8910_device::data_r), m_psg.target()), write8smo_delegate(FUNC(ay8910_device::data_w), m_psg.target())); - io_space().install_read_handler(0x7f, 0x7f, 0, 0xff00, 0, read8smo_delegate(FUNC(spectrum_fuller_device::joystick_r), this)); -} - - //************************************************************************** // IMPLEMENTATION //************************************************************************** -uint8_t spectrum_fuller_device::joystick_r() +READ_LINE_MEMBER(spectrum_fuller_device::romcs) { - return m_joy->read() | (0xff ^ 0x8f); + return m_exp->romcs(); } -READ_LINE_MEMBER(spectrum_fuller_device::romcs) +void spectrum_fuller_device::opcode_fetch(offs_t offset) { - return m_exp->romcs(); + m_exp->opcode_fetch(offset); } uint8_t spectrum_fuller_device::mreq_r(offs_t offset) { - return m_exp->mreq_r(offset); + uint8_t data = 0xff; + + if (m_exp->romcs()) + data &= m_exp->mreq_r(offset); + + return data; } void spectrum_fuller_device::mreq_w(offs_t offset, uint8_t data) @@ -121,12 +114,32 @@ void spectrum_fuller_device::mreq_w(offs_t offset, uint8_t data) m_exp->mreq_w(offset, data); } -uint8_t spectrum_fuller_device::port_fe_r(offs_t offset) +uint8_t spectrum_fuller_device::iorq_r(offs_t offset) { - uint8_t data = 0xff; - - if (m_exp->romcs()) - data &= m_exp->port_fe_r(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); +} |