summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ins8154.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ins8154.cpp')
-rw-r--r--src/devices/machine/ins8154.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/devices/machine/ins8154.cpp b/src/devices/machine/ins8154.cpp
index ff1cd79906e..11943cdee2c 100644
--- a/src/devices/machine/ins8154.cpp
+++ b/src/devices/machine/ins8154.cpp
@@ -78,6 +78,7 @@ void ins8154_device::device_start()
save_item(NAME(m_mdr));
save_item(NAME(m_odra));
save_item(NAME(m_odrb));
+ save_item(NAME(m_ram));
}
@@ -97,7 +98,7 @@ void ins8154_device::device_reset()
}
-READ8_MEMBER(ins8154_device::ins8154_r)
+uint8_t ins8154_device::read_io(offs_t offset)
{
uint8_t val = 0xff;
@@ -146,7 +147,12 @@ READ8_MEMBER(ins8154_device::ins8154_r)
return val;
}
-WRITE8_MEMBER(ins8154_device::ins8154_porta_w)
+uint8_t ins8154_device::read_ram(offs_t offset)
+{
+ return m_ram[offset & 0x7f];
+}
+
+void ins8154_device::porta_w(uint8_t data)
{
m_out_a = data;
@@ -155,7 +161,7 @@ WRITE8_MEMBER(ins8154_device::ins8154_porta_w)
m_out_a_cb(offs_t(0), (data & m_odra) | (m_odra ^ 0xff));
}
-WRITE8_MEMBER(ins8154_device::ins8154_portb_w)
+void ins8154_device::portb_w(uint8_t data)
{
LOG("%s: INS8154 Write PortB %02x with odrb: %02x\n", machine().describe_context(), data, m_odrb);
m_out_b = data;
@@ -165,7 +171,7 @@ WRITE8_MEMBER(ins8154_device::ins8154_portb_w)
m_out_b_cb(offs_t(0), (data & m_odrb) | (m_odrb ^ 0xff));
}
-WRITE8_MEMBER(ins8154_device::ins8154_w)
+void ins8154_device::write_io(offs_t offset, uint8_t data)
{
if (offset > 0x24)
{
@@ -176,11 +182,11 @@ WRITE8_MEMBER(ins8154_device::ins8154_w)
switch (offset)
{
case 0x20:
- ins8154_porta_w(space, 0, data);
+ porta_w(data);
break;
case 0x21:
- ins8154_portb_w(space, 0, data);
+ portb_w(data);
break;
case 0x22:
@@ -205,12 +211,12 @@ WRITE8_MEMBER(ins8154_device::ins8154_w)
if (offset < 0x08)
{
LOGBITS("%s: INS8154 Port A set bit %02x\n", machine().describe_context(), offset & 0x07);
- ins8154_porta_w(space, 0, m_out_a |= (1 << (offset & 0x07)));
+ porta_w(m_out_a |= (1 << (offset & 0x07)));
}
else
{
LOGBITS("%s: INS8154 Port B set bit %02x\n", machine().describe_context(), offset & 0x07);
- ins8154_portb_w(space, 0, m_out_b |= (1 << (offset & 0x07)));
+ portb_w(m_out_b |= (1 << (offset & 0x07)));
}
}
else
@@ -219,14 +225,19 @@ WRITE8_MEMBER(ins8154_device::ins8154_w)
if (offset < 0x08)
{
LOGBITS("%s: INS8154 Port A clear bit %02x\n", machine().describe_context(), offset & 0x07);
- ins8154_porta_w(space, 0, m_out_a & ~(1 << (offset & 0x07)));
+ porta_w(m_out_a & ~(1 << (offset & 0x07)));
}
else
{
LOGBITS("%s: INS8154 Port B clear bit %02x\n", machine().describe_context(), offset & 0x07);
- ins8154_portb_w(space, 0, m_out_b & ~(1 << (offset & 0x07)));
+ portb_w(m_out_b & ~(1 << (offset & 0x07)));
}
}
break;
}
}
+
+void ins8154_device::write_ram(offs_t offset, uint8_t data)
+{
+ m_ram[offset & 0x7f] = data;
+}