i8251: Improve logging; restrict external command_w and mode_w access to V53 variant (nw)

This commit is contained in:
AJR 2017-04-15 15:42:52 -04:00
parent 52b0ef3911
commit 445858d683
3 changed files with 24 additions and 6 deletions

View File

@ -186,6 +186,7 @@ void i8251_device::check_for_tx_start()
-------------------------------------------------*/ -------------------------------------------------*/
void i8251_device::start_tx() void i8251_device::start_tx()
{ {
LOG("start_tx %02x\n", m_tx_data);
transmit_register_setup(m_tx_data); transmit_register_setup(m_tx_data);
m_status &= ~I8251_STATUS_TX_EMPTY; m_status &= ~I8251_STATUS_TX_EMPTY;
m_status |= I8251_STATUS_TX_READY; m_status |= I8251_STATUS_TX_READY;
@ -340,7 +341,7 @@ void i8251_device::device_reset()
control_w control_w
-------------------------------------------------*/ -------------------------------------------------*/
WRITE8_MEMBER(i8251_device::command_w) void i8251_device::command_w(uint8_t data)
{ {
/* command */ /* command */
LOG("I8251: Command byte\n"); LOG("I8251: Command byte\n");
@ -419,7 +420,7 @@ WRITE8_MEMBER(i8251_device::command_w)
update_tx_empty(); update_tx_empty();
} }
WRITE8_MEMBER(i8251_device::mode_w) void i8251_device::mode_w(uint8_t data)
{ {
LOG("I8251: Mode byte = %X\n", data); LOG("I8251: Mode byte = %X\n", data);
@ -597,12 +598,12 @@ WRITE8_MEMBER(i8251_device::control_w)
} }
else else
{ {
mode_w(space, offset, data); mode_w(data);
} }
} }
else else
{ {
command_w(space, offset, data); command_w(data);
} }
} }
@ -660,6 +661,8 @@ WRITE8_MEMBER(i8251_device::data_w)
void i8251_device::receive_character(uint8_t ch) void i8251_device::receive_character(uint8_t ch)
{ {
LOG("receive_character %02x\n", ch);
m_rx_data = ch; m_rx_data = ch;
/* char has not been read and another has arrived! */ /* char has not been read and another has arrived! */
@ -735,3 +738,13 @@ WRITE_LINE_MEMBER(i8251_device::write_txc)
transmit_clock(); transmit_clock();
} }
} }
WRITE8_MEMBER(v53_scu_device::command_w)
{
command_w(data);
}
WRITE8_MEMBER(v53_scu_device::mode_w)
{
mode_w(data);
}

View File

@ -57,8 +57,6 @@ public:
DECLARE_WRITE8_MEMBER(data_w); DECLARE_WRITE8_MEMBER(data_w);
DECLARE_READ8_MEMBER(status_r); DECLARE_READ8_MEMBER(status_r);
DECLARE_WRITE8_MEMBER(control_w); DECLARE_WRITE8_MEMBER(control_w);
DECLARE_WRITE8_MEMBER(command_w);
DECLARE_WRITE8_MEMBER(mode_w);
DECLARE_WRITE_LINE_MEMBER( write_rxd ); DECLARE_WRITE_LINE_MEMBER( write_rxd );
DECLARE_WRITE_LINE_MEMBER( write_cts ); DECLARE_WRITE_LINE_MEMBER( write_cts );
@ -96,6 +94,9 @@ protected:
virtual void device_reset() override; virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void command_w(uint8_t data);
void mode_w(uint8_t data);
void update_rx_ready(); void update_rx_ready();
void update_tx_ready(); void update_tx_ready();
void update_tx_empty(); void update_tx_empty();
@ -156,6 +157,9 @@ class v53_scu_device : public i8251_device
public: public:
// construction/destruction // construction/destruction
v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE8_MEMBER(command_w);
DECLARE_WRITE8_MEMBER(mode_w);
}; };

View File

@ -441,6 +441,7 @@ u8 device_serial_interface::transmit_register_get_data_bit()
bit = (m_tra_register_data>>(m_tra_bit_count-1-m_tra_bit_count_transmitted))&1; bit = (m_tra_register_data>>(m_tra_bit_count-1-m_tra_bit_count_transmitted))&1;
m_tra_bit_count_transmitted++; m_tra_bit_count_transmitted++;
//device().logerror("%d bits transmitted\n", m_tra_bit_count_transmitted);
/* have all bits of this stream formatted byte been sent? */ /* have all bits of this stream formatted byte been sent? */
if (m_tra_bit_count_transmitted==m_tra_bit_count) if (m_tra_bit_count_transmitted==m_tra_bit_count)