summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/spectrum/intf1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/spectrum/intf1.cpp')
-rw-r--r--src/devices/bus/spectrum/intf1.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/devices/bus/spectrum/intf1.cpp b/src/devices/bus/spectrum/intf1.cpp
index d324e931e2c..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));
}
//-------------------------------------------------
@@ -93,8 +94,6 @@ void spectrum_intf1_device::device_start()
void spectrum_intf1_device::device_reset()
{
- m_exp->set_io_space(&io_space());
-
m_romcs = 0;
}
@@ -107,45 +106,49 @@ READ_LINE_MEMBER(spectrum_intf1_device::romcs)
return m_romcs | m_exp->romcs();
}
-READ8_MEMBER(spectrum_intf1_device::mreq_r)
+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(space, 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;
}
-WRITE8_MEMBER(spectrum_intf1_device::mreq_w)
+void spectrum_intf1_device::mreq_w(offs_t offset, uint8_t data)
{
if (m_exp->romcs())
- m_exp->mreq_w(space, offset, data);
+ m_exp->mreq_w(offset, data);
}
-READ8_MEMBER(spectrum_intf1_device::port_fe_r)
+uint8_t spectrum_intf1_device::iorq_r(offs_t offset)
{
- uint8_t data = 0xff;
-
- if (m_exp->romcs())
- data &= m_exp->port_fe_r(space, 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);
}