summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/meyc8080.cpp
diff options
context:
space:
mode:
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
commit2beba4ce73fad917c7159a39939bace54f76494b (patch)
treee9d33c059bc5045f13d0c1748f0a044650370b8d /src/mame/drivers/meyc8080.cpp
parentacf93837ac21b2b0bb003d1649b893200c269812 (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/meyc8080.cpp')
-rw-r--r--src/mame/drivers/meyc8080.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/mame/drivers/meyc8080.cpp b/src/mame/drivers/meyc8080.cpp
index 54b3f4a2770..6092d9180c1 100644
--- a/src/mame/drivers/meyc8080.cpp
+++ b/src/mame/drivers/meyc8080.cpp
@@ -78,12 +78,9 @@ public:
, m_videoram_2(*this, "vram2")
, m_maincpu(*this, "maincpu")
, m_dac(*this, "dac")
+ , m_lamp(*this, "lamp%u", 0U)
{ }
- required_shared_ptr<uint8_t> m_videoram_0;
- required_shared_ptr<uint8_t> m_videoram_1;
- required_shared_ptr<uint8_t> m_videoram_2;
-
DECLARE_WRITE8_MEMBER(lights_1_w);
DECLARE_WRITE8_MEMBER(lights_2_w);
DECLARE_WRITE8_MEMBER(counters_w);
@@ -92,10 +89,18 @@ public:
DECLARE_WRITE8_MEMBER(meyc8080_dac_3_w);
DECLARE_WRITE8_MEMBER(meyc8080_dac_4_w);
uint32_t screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
- required_device<dac_byte_interface> m_dac;
void meyc8080(machine_config &config);
void meyc8080_map(address_map &map);
+
+protected:
+ virtual void machine_start() override { m_lamp.resolve(); }
+
+ required_shared_ptr<uint8_t> m_videoram_0;
+ required_shared_ptr<uint8_t> m_videoram_1;
+ required_shared_ptr<uint8_t> m_videoram_2;
+ required_device<cpu_device> m_maincpu;
+ required_device<dac_byte_interface> m_dac;
+ output_finder<11> m_lamp;
};
@@ -185,11 +190,11 @@ WRITE8_MEMBER(meyc8080_state::lights_1_w)
xxxx ---- Seems unused...
*/
- output().set_lamp_value(0, (data) & 1); /* Lamp 0 */
- output().set_lamp_value(1, (data >> 1) & 1); /* Lamp 1 */
- output().set_lamp_value(2, (data >> 2) & 1); /* Lamp 2 */
- output().set_lamp_value(3, (data >> 3) & 1); /* Lamp 3 */
- output().set_lamp_value(4, (data >> 4) & 1); /* Lamp 4 */
+ m_lamp[0] = BIT(data, 0); /* Lamp 0 */
+ m_lamp[1] = BIT(data, 1); /* Lamp 1 */
+ m_lamp[2] = BIT(data, 2); /* Lamp 2 */
+ m_lamp[3] = BIT(data, 3); /* Lamp 3 */
+ m_lamp[4] = BIT(data, 4); /* Lamp 4 */
logerror("lights 1: %02x\n", data);
}
@@ -232,13 +237,13 @@ WRITE8_MEMBER(meyc8080_state::lights_2_w)
xxx- ---- Unknown.
*/
- output().set_lamp_value(5, (data) & 1); /* Lamp 5 */
- output().set_lamp_value(6, (data >> 1) & 1); /* Lamp 6 */
- output().set_lamp_value(7, (data >> 2) & 1); /* Lamp 7 */
- output().set_lamp_value(8, (data >> 3) & 1); /* Lamp 8 */
- output().set_lamp_value(9, (data >> 4) & 1); /* Lamp 9 */
+ m_lamp[5] = BIT(data, 0); /* Lamp 5 */
+ m_lamp[6] = BIT(data, 1); /* Lamp 6 */
+ m_lamp[7] = BIT(data, 2); /* Lamp 7 */
+ m_lamp[8] = BIT(data, 3); /* Lamp 8 */
+ m_lamp[9] = BIT(data, 4); /* Lamp 9 */
- output().set_lamp_value(10, (data >> 5) & 1); /* Lamp 10 (Game-Over) */
+ m_lamp[10] = BIT(data, 5); /* Lamp 10 (Game-Over) */
logerror("lights 2: %02x\n", data);
}