mirror of
https://github.com/holub/mame
synced 2025-05-29 17:13:05 +03:00
vt100_kbd: Use output finders (nw)
This commit is contained in:
parent
672405116d
commit
22e7581a2b
@ -166,6 +166,10 @@ vt100_keyboard_device::vt100_keyboard_device(const machine_config &mconfig, cons
|
|||||||
, m_speaker(*this, "beeper")
|
, m_speaker(*this, "beeper")
|
||||||
, m_scan_counter(*this, "counter")
|
, m_scan_counter(*this, "counter")
|
||||||
, m_key_row(*this, "LINE%X", 0)
|
, m_key_row(*this, "LINE%X", 0)
|
||||||
|
, m_online_led(*this, "online_led")
|
||||||
|
, m_local_led(*this, "local_led")
|
||||||
|
, m_locked_led(*this, "locked_led")
|
||||||
|
, m_ln_led(*this, "l%u_led", 1U)
|
||||||
, m_signal_line(true)
|
, m_signal_line(true)
|
||||||
, m_last_signal_change(attotime::zero)
|
, m_last_signal_change(attotime::zero)
|
||||||
, m_last_scan(0)
|
, m_last_scan(0)
|
||||||
@ -230,13 +234,16 @@ void vt100_keyboard_device::device_start()
|
|||||||
m_uart->write_cs(1);
|
m_uart->write_cs(1);
|
||||||
m_uart->write_swe(0);
|
m_uart->write_swe(0);
|
||||||
|
|
||||||
machine().output().set_value("online_led",0);
|
m_online_led.resolve();
|
||||||
machine().output().set_value("local_led", 1);
|
m_local_led.resolve();
|
||||||
machine().output().set_value("locked_led",1);
|
m_locked_led.resolve();
|
||||||
machine().output().set_value("l1_led", 1);
|
m_ln_led.resolve();
|
||||||
machine().output().set_value("l2_led", 1);
|
|
||||||
machine().output().set_value("l3_led", 1);
|
m_online_led = 0;
|
||||||
machine().output().set_value("l4_led", 1);
|
m_local_led = 1;
|
||||||
|
m_locked_led = 1;
|
||||||
|
for (int n = 0; n < 4; n++)
|
||||||
|
m_ln_led[n] = 1;
|
||||||
|
|
||||||
save_item(NAME(m_signal_line));
|
save_item(NAME(m_signal_line));
|
||||||
save_item(NAME(m_last_signal_change));
|
save_item(NAME(m_last_signal_change));
|
||||||
@ -267,13 +274,11 @@ WRITE_LINE_MEMBER(vt100_keyboard_device::signal_line_w)
|
|||||||
if (dav)
|
if (dav)
|
||||||
{
|
{
|
||||||
u8 data = m_uart->get_received_data();
|
u8 data = m_uart->get_received_data();
|
||||||
machine().output().set_value("online_led",BIT(data, 5) ? 1 : 0);
|
m_online_led = BIT(data, 5) ? 1 : 0;
|
||||||
machine().output().set_value("local_led", BIT(data, 5) ? 0 : 1);
|
m_local_led = BIT(data, 5) ? 0 : 1;
|
||||||
machine().output().set_value("locked_led",BIT(data, 4) ? 0 : 1);
|
m_locked_led = BIT(data, 4) ? 0 : 1;
|
||||||
machine().output().set_value("l1_led", BIT(data, 3) ? 0 : 1);
|
for (int n = 0; n < 4; n++)
|
||||||
machine().output().set_value("l2_led", BIT(data, 2) ? 0 : 1);
|
m_ln_led[n] = BIT(data, 3 - n) ? 0 : 1;
|
||||||
machine().output().set_value("l3_led", BIT(data, 1) ? 0 : 1);
|
|
||||||
machine().output().set_value("l4_led", BIT(data, 0) ? 0 : 1);
|
|
||||||
m_speaker->set_state(BIT(data, 7));
|
m_speaker->set_state(BIT(data, 7));
|
||||||
|
|
||||||
if (BIT(data, 6))
|
if (BIT(data, 6))
|
||||||
|
@ -60,6 +60,11 @@ private:
|
|||||||
required_device<ripple_counter_device> m_scan_counter;
|
required_device<ripple_counter_device> m_scan_counter;
|
||||||
required_ioport_array<16> m_key_row;
|
required_ioport_array<16> m_key_row;
|
||||||
|
|
||||||
|
output_finder<> m_online_led;
|
||||||
|
output_finder<> m_local_led;
|
||||||
|
output_finder<> m_locked_led;
|
||||||
|
output_finder<4> m_ln_led;
|
||||||
|
|
||||||
bool m_signal_line;
|
bool m_signal_line;
|
||||||
attotime m_last_signal_change;
|
attotime m_last_signal_change;
|
||||||
u8 m_last_scan;
|
u8 m_last_scan;
|
||||||
|
Loading…
Reference in New Issue
Block a user