summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/didact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/didact.cpp')
-rw-r--r--src/mame/drivers/didact.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mame/drivers/didact.cpp b/src/mame/drivers/didact.cpp
index 270dd3af219..223e1ee44a2 100644
--- a/src/mame/drivers/didact.cpp
+++ b/src/mame/drivers/didact.cpp
@@ -100,15 +100,21 @@ class didact_state : public driver_device
, m_lines{ 0, 0, 0, 0 }
, m_led(0)
, m_rs232(*this, "rs232")
+ , m_leds(*this, "led%u", 0U)
{ }
+ TIMER_DEVICE_CALLBACK_MEMBER(scan_artwork);
+
+protected:
+ virtual void machine_start() override { m_leds.resolve(); }
+
required_ioport_array<5> m_io_lines;
uint8_t m_lines[4];
uint8_t m_reset;
uint8_t m_shift;
uint8_t m_led;
optional_device<rs232_port_device> m_rs232;
- TIMER_DEVICE_CALLBACK_MEMBER(scan_artwork);
+ output_finder<2> m_leds;
};
@@ -246,7 +252,7 @@ WRITE8_MEMBER( md6802_state::pia2_kbB_w )
WRITE_LINE_MEMBER( md6802_state::pia2_ca2_w )
{
LOG("--->%s(%02x) LED is connected through resisitor to +5v so logical 0 will lit it\n", FUNCNAME, state);
- output().set_led_value(m_led, !state);
+ m_leds[m_led] = state ? 0 :1;
// Serial Out - needs debug/verification
m_rs232->write_txd(state);
@@ -415,7 +421,7 @@ READ8_MEMBER( mp68a_state::pia2_kbB_r )
{
pb |= 0x80; // Set shift bit (PB7)
m_shift = 0; // Reset flip flop
- output().set_led_value(m_led, m_shift);
+ m_leds[m_led] = m_shift ? 1 : 0;
LOG("SHIFT is released\n");
}
@@ -550,7 +556,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(didact_state::scan_artwork)
{
LOG("RESET is pressed, resetting the CPU\n");
m_shift = 0;
- output().set_led_value(m_led, m_shift); // For mp68a only
+ m_leds[m_led] = m_shift ? 1 : 0; // For mp68a only
if (m_reset == 0)
{
machine_reset();
@@ -562,7 +568,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(didact_state::scan_artwork)
// Poll the artwork SHIFT/* key
LOG("%s", !m_shift ? "SHIFT is set\n" : "");
m_shift = 1;
- output().set_led_value(m_led, m_shift); // For mp68a only
+ m_leds[m_led] = m_shift ? 1 : 0; // For mp68a only
}
else
{