summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-10-30 10:08:54 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-10-30 10:08:54 -0400
commitea8913e128d15aa1d78e5993e1d6201edf450fd2 (patch)
tree4ec8b6f0eab8e58aa10b6723071b83b7b342c1f6 /src/devices/machine
parent470c416cc3a6f723779e2b6ae923126074ea0dfb (diff)
src/devices: Replace output().set_value with output finders (nw)
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/amigafdc.cpp17
-rw-r--r--src/devices/machine/amigafdc.h1
-rw-r--r--src/devices/machine/ie15.cpp33
-rw-r--r--src/devices/machine/ie15.h9
-rw-r--r--src/devices/machine/ldpr8210.cpp48
-rw-r--r--src/devices/machine/ldpr8210.h22
6 files changed, 94 insertions, 36 deletions
diff --git a/src/devices/machine/amigafdc.cpp b/src/devices/machine/amigafdc.cpp
index 69ec9066f87..ee854e461ad 100644
--- a/src/devices/machine/amigafdc.cpp
+++ b/src/devices/machine/amigafdc.cpp
@@ -25,6 +25,7 @@ amiga_fdc_device::amiga_fdc_device(const machine_config &mconfig, const char *ta
m_write_dskblk(*this),
m_write_dsksyn(*this),
m_leds(*this, "led%u", 1U),
+ m_fdc_led(*this, "fdc_led"),
floppy(nullptr), t_gen(nullptr), dsklen(0), pre_dsklen(0), dsksync(0), dskbyt(0), adkcon(0), dmacon(0), dskpt(0), dma_value(0), dma_state(0)
{
}
@@ -37,6 +38,7 @@ void amiga_fdc_device::device_start()
m_write_dskblk.resolve_safe();
m_write_dsksyn.resolve_safe();
m_leds.resolve();
+ m_fdc_led.resolve();
static char const *const names[] = { "0", "1", "2", "3" };
for(int i=0; i != 4; i++) {
@@ -437,11 +439,6 @@ void amiga_fdc_device::setup_leds()
floppy == floppy_devices[2] ? 2 :
3;
- machine().output().set_value("drive_0_led", drive == 0);
- machine().output().set_value("drive_1_led", drive == 1);
- machine().output().set_value("drive_2_led", drive == 2);
- machine().output().set_value("drive_3_led", drive == 3);
-
m_leds[0] = drive == 0 ? 1 : 0; // update internal drive led
m_leds[1] = drive == 1 ? 1 : 0; // update external drive led
}
@@ -472,11 +469,11 @@ WRITE8_MEMBER( amiga_fdc_device::ciaaprb_w )
}
if(floppy) {
- floppy->ss_w(!((data >> 2) & 1));
- floppy->dir_w((data >> 1) & 1);
- floppy->stp_w(data & 1);
- floppy->mon_w((data >> 7) & 1);
- machine().output().set_value("fdc_led", data & 0x80); // LED directly connected to FDC motor
+ floppy->ss_w(!(BIT(data, 2)));
+ floppy->dir_w(BIT(data, 1));
+ floppy->stp_w(BIT(data, 0));
+ floppy->mon_w(BIT(data, 7));
+ m_fdc_led = BIT(data, 7); // LED directly connected to FDC motor
}
if(floppy) {
diff --git a/src/devices/machine/amigafdc.h b/src/devices/machine/amigafdc.h
index cebb4dc221c..8142680bed7 100644
--- a/src/devices/machine/amigafdc.h
+++ b/src/devices/machine/amigafdc.h
@@ -93,6 +93,7 @@ private:
devcb_write_line m_write_dskblk;
devcb_write_line m_write_dsksyn;
output_finder<2> m_leds;
+ output_finder<> m_fdc_led;
floppy_image_device *floppy;
floppy_image_device *floppy_devices[4];
diff --git a/src/devices/machine/ie15.cpp b/src/devices/machine/ie15.cpp
index 802d92b6eff..5f19830f537 100644
--- a/src/devices/machine/ie15.cpp
+++ b/src/devices/machine/ie15.cpp
@@ -42,6 +42,14 @@ ie15_device::ie15_device(const machine_config &mconfig, device_type type, const
, m_screen(*this, "screen")
, m_keyboard(*this, "keyboard")
, m_io_keyboard(*this, "io_keyboard")
+ , m_lat_led(*this, "lat_led")
+ , m_nr_led(*this, "nr_led")
+ , m_pch_led(*this, "pch_led")
+ , m_dup_led(*this, "dup_led")
+ , m_lin_led(*this, "lin_led")
+ , m_red_led(*this, "red_led")
+ , m_sdv_led(*this, "sdv_led")
+ , m_prd_led(*this, "prd_led")
, m_rs232_conn_txd_handler(*this)
, m_rs232_conn_dtr_handler(*this)
, m_rs232_conn_rts_handler(*this)
@@ -465,6 +473,15 @@ void ie15_device::device_resolve_objects()
void ie15_device::device_start()
{
+ m_lat_led.resolve();
+ m_nr_led.resolve();
+ m_pch_led.resolve();
+ m_dup_led.resolve();
+ m_lin_led.resolve();
+ m_red_led.resolve();
+ m_sdv_led.resolve();
+ m_prd_led.resolve();
+
m_hblank_timer = timer_alloc(TIMER_HBLANK);
m_hblank_timer->adjust(attotime::never);
@@ -574,14 +591,14 @@ void ie15_device::update_leds()
{
uint8_t data = m_io_keyboard->read();
- machine().output().set_value("lat_led", m_kb_ruslat ^ 1);
- machine().output().set_value("nr_led", BIT(m_kb_control, ie15_keyboard_device::IE_KB_NR_BIT) ^ 1);
- machine().output().set_value("pch_led", BIT(data, ie15_keyboard_device::IE_KB_PCH_BIT) ^ 1);
- machine().output().set_value("dup_led", BIT(data, ie15_keyboard_device::IE_KB_DUP_BIT) ^ 1);
- machine().output().set_value("lin_led", BIT(data, ie15_keyboard_device::IE_KB_LIN_BIT) ^ 1);
- machine().output().set_value("red_led", BIT(data, ie15_keyboard_device::IE_KB_RED_BIT) ^ 1);
- machine().output().set_value("sdv_led", BIT(m_kb_control, ie15_keyboard_device::IE_KB_SDV_BIT) ^ 1);
- machine().output().set_value("prd_led", 1); // XXX
+ m_lat_led = m_kb_ruslat ^ 1;
+ m_nr_led = BIT(m_kb_control, ie15_keyboard_device::IE_KB_NR_BIT) ^ 1;
+ m_pch_led = BIT(data, ie15_keyboard_device::IE_KB_PCH_BIT) ^ 1;
+ m_dup_led = BIT(data, ie15_keyboard_device::IE_KB_DUP_BIT) ^ 1;
+ m_lin_led = BIT(data, ie15_keyboard_device::IE_KB_LIN_BIT) ^ 1;
+ m_red_led = BIT(data, ie15_keyboard_device::IE_KB_RED_BIT) ^ 1;
+ m_sdv_led = BIT(m_kb_control, ie15_keyboard_device::IE_KB_SDV_BIT) ^ 1;
+ m_prd_led = 1; // XXX
}
/*
diff --git a/src/devices/machine/ie15.h b/src/devices/machine/ie15.h
index 025c3940f9e..291bcf232a6 100644
--- a/src/devices/machine/ie15.h
+++ b/src/devices/machine/ie15.h
@@ -139,6 +139,15 @@ private:
required_device<ie15_keyboard_device> m_keyboard;
required_ioport m_io_keyboard;
+ output_finder<> m_lat_led;
+ output_finder<> m_nr_led;
+ output_finder<> m_pch_led;
+ output_finder<> m_dup_led;
+ output_finder<> m_lin_led;
+ output_finder<> m_red_led;
+ output_finder<> m_sdv_led;
+ output_finder<> m_prd_led;
+
devcb_write_line m_rs232_conn_txd_handler;
devcb_write_line m_rs232_conn_dtr_handler;
devcb_write_line m_rs232_conn_rts_handler;
diff --git a/src/devices/machine/ldpr8210.cpp b/src/devices/machine/ldpr8210.cpp
index 0bd86f5a3ae..283ffdc0916 100644
--- a/src/devices/machine/ldpr8210.cpp
+++ b/src/devices/machine/ldpr8210.cpp
@@ -175,6 +175,16 @@ pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, cons
pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: laserdisc_device(mconfig, type, tag, owner, clock),
+ m_audio1(*this, "pr8210_audio1"),
+ m_audio2(*this, "pr8210_audio2"),
+ m_clv(*this, "pr8210_clv"),
+ m_cav(*this, "pr8210_cav"),
+ m_srev(*this, "pr8210_srev"),
+ m_sfwd(*this, "pr8210_sfwd"),
+ m_play(*this, "pr8210_play"),
+ m_step(*this, "pr8210_step"),
+ m_pause(*this, "pr8210_pause"),
+ m_standby(*this, "pr8210_standby"),
m_control(0),
m_lastcommand(0),
m_accumulator(0),
@@ -266,6 +276,18 @@ void pioneer_pr8210_device::control_w(uint8_t data)
void pioneer_pr8210_device::device_start()
{
+ // resolve outputs
+ m_audio1.resolve();
+ m_audio2.resolve();
+ m_clv.resolve();
+ m_cav.resolve();
+ m_srev.resolve();
+ m_sfwd.resolve();
+ m_play.resolve();
+ m_step.resolve();
+ m_pause.resolve();
+ m_standby.resolve();
+
// pass through to the parent
laserdisc_device::device_start();
}
@@ -546,18 +568,18 @@ WRITE8_MEMBER( pioneer_pr8210_device::i8049_pia_w )
case 0x60:
// these 4 are direct-connect
- machine().output().set_value("pr8210_audio1", (data & 0x01) != 0);
- machine().output().set_value("pr8210_audio2", (data & 0x02) != 0);
- machine().output().set_value("pr8210_clv", (data & 0x04) != 0);
- machine().output().set_value("pr8210_cav", (data & 0x08) != 0);
+ m_audio1 = BIT(data, 0);
+ m_audio2 = BIT(data, 1);
+ m_clv = BIT(data, 2);
+ m_cav = BIT(data, 3);
// remaining 3 bits select one of 5 LEDs via a mux
value = ((data & 0x40) >> 6) | ((data & 0x20) >> 4) | ((data & 0x10) >> 2);
- machine().output().set_value("pr8210_srev", (value == 0));
- machine().output().set_value("pr8210_sfwd", (value == 1));
- machine().output().set_value("pr8210_play", (value == 2));
- machine().output().set_value("pr8210_step", (value == 3));
- machine().output().set_value("pr8210_pause", (value == 4));
+ m_srev = (value == 0);
+ m_sfwd = (value == 1);
+ m_play = (value == 2);
+ m_step = (value == 3);
+ m_pause = (value == 4);
m_pia.portb = data;
update_audio_squelch();
@@ -700,14 +722,14 @@ WRITE8_MEMBER( pioneer_pr8210_device::i8049_port2_w )
m_i8049_port2 = data;
// on the falling edge of bit 5, start the slow timer
- if (!(data & 0x20) && (prev & 0x20))
+ if (!BIT(data, 5) && BIT(prev, 5))
m_slowtrg = machine().time();
// bit 6 when low triggers an IRQ on the MCU
- m_i8049_cpu->set_input_line(MCS48_INPUT_IRQ, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
+ m_i8049_cpu->set_input_line(MCS48_INPUT_IRQ, BIT(data, 6) ? CLEAR_LINE : ASSERT_LINE);
- // standby LED is set accordingl to bit 4
- machine().output().set_value("pr8210_standby", (data & 0x10) != 0);
+ // standby LED is set accordingly to bit 4
+ m_standby = BIT(data, 4);
}
diff --git a/src/devices/machine/ldpr8210.h b/src/devices/machine/ldpr8210.h
index ed97f0f8fd2..02df0516361 100644
--- a/src/devices/machine/ldpr8210.h
+++ b/src/devices/machine/ldpr8210.h
@@ -103,10 +103,22 @@ protected:
void overlay_erase(bitmap_yuy16 &bitmap, float xstart, float xend);
void overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch, float xstart);
+ // LED outputs
+ output_finder<> m_audio1;
+ output_finder<> m_audio2;
+ output_finder<> m_clv;
+ output_finder<> m_cav;
+ output_finder<> m_srev;
+ output_finder<> m_sfwd;
+ output_finder<> m_play;
+ output_finder<> m_step;
+ output_finder<> m_pause;
+ output_finder<> m_standby;
+
// internal state
- uint8_t m_control; // control line state
- uint8_t m_lastcommand; // last command seen
- uint16_t m_accumulator; // bit accumulator
+ uint8_t m_control; // control line state
+ uint8_t m_lastcommand; // last command seen
+ uint16_t m_accumulator; // bit accumulator
attotime m_lastcommandtime; // time of the last command
attotime m_lastbittime; // time of last bit received
attotime m_firstbittime; // time of first bit in command
@@ -116,8 +128,8 @@ protected:
attotime m_slowtrg; // time of the last SLOW TRG
pioneer_pia m_pia; // PIA state
bool m_vsync; // live VSYNC state
- uint8_t m_i8049_port1; // 8049 port 1 state
- uint8_t m_i8049_port2; // 8049 port 2 state
+ uint8_t m_i8049_port1; // 8049 port 1 state
+ uint8_t m_i8049_port2; // 8049 port 2 state
private:
void pr8210_portmap(address_map &map);