diff options
Diffstat (limited to 'src/devices/bus/spectrum/intf1.cpp')
-rw-r--r-- | src/devices/bus/spectrum/intf1.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/devices/bus/spectrum/intf1.cpp b/src/devices/bus/spectrum/intf1.cpp index d39d529e87f..344aaf61841 100644 --- a/src/devices/bus/spectrum/intf1.cpp +++ b/src/devices/bus/spectrum/intf1.cpp @@ -85,6 +85,7 @@ spectrum_intf1_device::spectrum_intf1_device(const machine_config &mconfig, cons void spectrum_intf1_device::device_start() { + save_item(NAME(m_romcs)); } //------------------------------------------------- @@ -105,29 +106,33 @@ READ_LINE_MEMBER(spectrum_intf1_device::romcs) return m_romcs | m_exp->romcs(); } -uint8_t spectrum_intf1_device::mreq_r(offs_t offset) +void spectrum_intf1_device::opcode_fetch(offs_t offset) { - uint8_t temp; - uint8_t data = 0xff; + m_exp->opcode_fetch(offset); if (!machine().side_effects_disabled()) { - if (offset == 0x0008 || offset == 0x1708) + switch (offset) + { + case 0x0008: case 0x1708: m_romcs = 1; + break; + case 0x0700: + m_romcs = 0; + break; + } } +} - temp = m_exp->mreq_r(offset); - if (m_exp->romcs()) - data &= temp; +uint8_t spectrum_intf1_device::mreq_r(offs_t offset) +{ + uint8_t data = 0xff; if (m_romcs) data &= m_rom->base()[offset & 0x1fff]; - if (!machine().side_effects_disabled()) - { - if (offset == 0x0700) - m_romcs = 0; - } + if (m_exp->romcs()) + data &= m_exp->mreq_r(offset); return data; } @@ -138,12 +143,12 @@ void spectrum_intf1_device::mreq_w(offs_t offset, uint8_t data) m_exp->mreq_w(offset, data); } -uint8_t spectrum_intf1_device::port_fe_r(offs_t offset) +uint8_t spectrum_intf1_device::iorq_r(offs_t offset) { - uint8_t data = 0xff; - - if (m_exp->romcs()) - data &= m_exp->port_fe_r(offset); + return m_exp->iorq_r(offset); +} - return data; +void spectrum_intf1_device::iorq_w(offs_t offset, uint8_t data) +{ + m_exp->iorq_w(offset, data); } |