diff options
author | wilbertpol <wilbertpol@users.noreply.github.com> | 2018-05-20 19:27:20 +0200 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2018-05-20 13:27:20 -0400 |
commit | 2beba4ce73fad917c7159a39939bace54f76494b (patch) | |
tree | e9d33c059bc5045f13d0c1748f0a044650370b8d /src/mame/drivers/mw18w.cpp | |
parent | acf93837ac21b2b0bb003d1649b893200c269812 (diff) |
Replace set_led_value and set_lamp_value with output_finders. [Wilbe… (#3592)
* Replace set_led_value and set_lamp_value with output_finders. [Wilbert Pol]
* segaufo: keep the 2 bit lamp outputs
Diffstat (limited to 'src/mame/drivers/mw18w.cpp')
-rw-r--r-- | src/mame/drivers/mw18w.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mame/drivers/mw18w.cpp b/src/mame/drivers/mw18w.cpp index 98fc967333d..7d4418bfc7c 100644 --- a/src/mame/drivers/mw18w.cpp +++ b/src/mame/drivers/mw18w.cpp @@ -26,10 +26,11 @@ To diagnose game, turn on service mode and: class mw18w_state : public driver_device { public: - mw18w_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + mw18w_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_digits(*this, "digit%u", 0U) + m_digits(*this, "digit%u", 0U), + m_lamp(*this, "lamp%u", 0U) { } DECLARE_WRITE8_MEMBER(mw18w_sound0_w); @@ -42,9 +43,10 @@ public: void mw18w_map(address_map &map); void mw18w_portmap(address_map &map); private: - virtual void machine_start() override { m_digits.resolve(); } + virtual void machine_start() override { m_digits.resolve(); m_lamp.resolve(); } required_device<cpu_device> m_maincpu; output_finder<10> m_digits; + output_finder<81> m_lamp; }; @@ -72,7 +74,7 @@ WRITE8_MEMBER(mw18w_state::mw18w_sound1_w) // d6: bell sound // d7: backdrop lamp dim control - output().set_lamp_value(80, data >> 7 & 1); + m_lamp[80] = BIT(data, 7); } WRITE8_MEMBER(mw18w_state::mw18w_lamps_w) @@ -85,7 +87,7 @@ WRITE8_MEMBER(mw18w_state::mw18w_lamps_w) // refresh lamp status for (int i = 0; i < 5; i++) - output().set_lamp_value(col * 10 + i, rows >> i & 1); + m_lamp[col * 10 + i] = BIT(rows, i); /* lamps info: |