summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2021-05-12 17:44:02 +0200
committer Dirk Best <mail@dirk-best.de>2021-05-12 17:45:38 +0200
commitb77e947a1ce846533b592732e677ffb6acfeae3c (patch)
tree4efe8902774eaff9bc0ff1acbda348285d7f0a0b
parentecc64108198b7bf6f226111e5ddcd4a4e83f7e6c (diff)
315_5338a: Add command readback and more serial output commands. Also always output on port writes.
-rw-r--r--src/mame/machine/315_5338a.cpp22
-rw-r--r--src/mame/machine/315_5338a.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/src/mame/machine/315_5338a.cpp b/src/mame/machine/315_5338a.cpp
index 9d0db3701e8..7a70f19b29e 100644
--- a/src/mame/machine/315_5338a.cpp
+++ b/src/mame/machine/315_5338a.cpp
@@ -57,6 +57,7 @@ void sega_315_5338a_device::device_start()
save_item(NAME(m_port_config));
save_item(NAME(m_serial_output));
save_item(NAME(m_address));
+ save_item(NAME(m_cmd));
}
@@ -89,6 +90,9 @@ uint8_t sega_315_5338a_device::read(offs_t offset)
// serial data read back?
case 0x0a: data = m_serial_output; break;
+ // command read back?
+ case 0x0b: data = m_cmd; break;
+
// serial data input
case 0x0c: data = m_read_cb(m_address); break;
@@ -122,8 +126,10 @@ void sega_315_5338a_device::write(offs_t offset, uint8_t data)
case 0x05:
case 0x06:
m_port_value[offset] = data;
- if (BIT(m_port_config, offset) == 0)
- m_out_port_cb[offset](data);
+
+ // always output, even if set to input?
+ // needed for bingoct sound
+ m_out_port_cb[offset](data);
break;
// port direction register (0 = output, 1 = input)
@@ -141,6 +147,7 @@ void sega_315_5338a_device::write(offs_t offset, uint8_t data)
// command register
case 0x09:
+ m_cmd = data;
switch (data)
{
case 0x00:
@@ -152,11 +159,22 @@ void sega_315_5338a_device::write(offs_t offset, uint8_t data)
case 0x07:
m_write_cb(m_address, m_serial_output, 0xff);
break;
+ case 0x70:
+ case 0x71:
+ case 0x72:
+ case 0x73:
+ case 0x74:
+ case 0x75:
+ case 0x76:
+ case 0x77:
+ m_write_cb(data & 0x07, m_serial_output, 0xff);
+ break;
case 0x87:
// sent after setting up the address and when wanting to receive serial data
break;
default:
logerror("Unknown command: %02x\n", data);
+ break;
}
break;
diff --git a/src/mame/machine/315_5338a.h b/src/mame/machine/315_5338a.h
index f0ef95e10ea..5ec91528a05 100644
--- a/src/mame/machine/315_5338a.h
+++ b/src/mame/machine/315_5338a.h
@@ -73,6 +73,7 @@ private:
uint8_t m_port_config;
uint8_t m_serial_output;
uint16_t m_address;
+ uint8_t m_cmd;
};
// device type definition