mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
315_5338a: Add command readback and more serial output commands. Also always output on port writes.
This commit is contained in:
parent
ecc6410819
commit
b77e947a1c
@ -57,6 +57,7 @@ void sega_315_5338a_device::device_start()
|
|||||||
save_item(NAME(m_port_config));
|
save_item(NAME(m_port_config));
|
||||||
save_item(NAME(m_serial_output));
|
save_item(NAME(m_serial_output));
|
||||||
save_item(NAME(m_address));
|
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?
|
// serial data read back?
|
||||||
case 0x0a: data = m_serial_output; break;
|
case 0x0a: data = m_serial_output; break;
|
||||||
|
|
||||||
|
// command read back?
|
||||||
|
case 0x0b: data = m_cmd; break;
|
||||||
|
|
||||||
// serial data input
|
// serial data input
|
||||||
case 0x0c: data = m_read_cb(m_address); break;
|
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 0x05:
|
||||||
case 0x06:
|
case 0x06:
|
||||||
m_port_value[offset] = data;
|
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;
|
break;
|
||||||
|
|
||||||
// port direction register (0 = output, 1 = input)
|
// 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
|
// command register
|
||||||
case 0x09:
|
case 0x09:
|
||||||
|
m_cmd = data;
|
||||||
switch (data)
|
switch (data)
|
||||||
{
|
{
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -152,11 +159,22 @@ void sega_315_5338a_device::write(offs_t offset, uint8_t data)
|
|||||||
case 0x07:
|
case 0x07:
|
||||||
m_write_cb(m_address, m_serial_output, 0xff);
|
m_write_cb(m_address, m_serial_output, 0xff);
|
||||||
break;
|
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:
|
case 0x87:
|
||||||
// sent after setting up the address and when wanting to receive serial data
|
// sent after setting up the address and when wanting to receive serial data
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logerror("Unknown command: %02x\n", data);
|
logerror("Unknown command: %02x\n", data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ private:
|
|||||||
uint8_t m_port_config;
|
uint8_t m_port_config;
|
||||||
uint8_t m_serial_output;
|
uint8_t m_serial_output;
|
||||||
uint16_t m_address;
|
uint16_t m_address;
|
||||||
|
uint8_t m_cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
|
Loading…
Reference in New Issue
Block a user