From 56e169ea6664770d3356efa083608c07b6d5b42e Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Wed, 4 Apr 2018 22:24:17 +0200 Subject: [PATCH] -output: Removed legacy output accessors from ampoker2, amusco. [Ryan Holtz] --- src/mame/drivers/ampoker2.cpp | 25 +++++++++++++++---------- src/mame/drivers/amusco.cpp | 28 ++++++++++++++++------------ src/mame/includes/ampoker2.h | 27 +++++++++++++++++++-------- 3 files changed, 50 insertions(+), 30 deletions(-) diff --git a/src/mame/drivers/ampoker2.cpp b/src/mame/drivers/ampoker2.cpp index e37917f1fa2..f31602615fa 100644 --- a/src/mame/drivers/ampoker2.cpp +++ b/src/mame/drivers/ampoker2.cpp @@ -388,6 +388,11 @@ #include "ampoker2.lh" #include "sigmapkr.lh" +void ampoker2_state::machine_start() +{ + m_lamps.resolve(); +} + /********************** * Read/Write Handlers * * - Output Ports - * @@ -483,10 +488,10 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port31_w) BIT 4 = TWL_YELL ;Tower Light YELLOW --------------------------------------------------*/ { - output().set_lamp_value(1, ((data >> 1) & 1)); /* Lamp 1 - BET/RED */ - output().set_lamp_value(6, ((data >> 2) & 1)); /* Lamp 6 - HOLD 4 */ - output().set_lamp_value(4, ((data >> 3) & 1)); /* Lamp 4 - HOLD 2 */ - output().set_lamp_value(8, ((data >> 4) & 1)); /* Lamp 8 - TWR.YELLOW */ + m_lamps[1] = BIT(data, 1); // BET/RED + m_lamps[6] = BIT(data, 2); // HOLD 4 + m_lamps[4] = BIT(data, 3); // HOLD 2 + m_lamps[8] = BIT(data, 4); // TWR.YELLOW } @@ -501,7 +506,7 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port32_w) BIT 4 = --------------------------------------------------*/ { - output().set_lamp_value(5, ((data >> 3) & 1)); /* Lamp 5 - HOLD 3 */ + m_lamps[5] = BIT(data, 3); // HOLD3 } @@ -530,7 +535,7 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port34_w) BIT 4 = LAMP_2 ;Lamp 3 (BLACK) --------------------------------------------------*/ { - output().set_lamp_value(2, ((data >> 4) & 1)); /* Lamp 2 - BLACK */ + m_lamps[2] = BIT(data, 4); // BLACK } @@ -559,10 +564,10 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port36_w) BIT 4 = LAMP_3 ;Lamp 3 (HOLD1) --------------------------------------------------*/ { - output().set_lamp_value(9, (data & 1)); /* Lamp 9 - TWR.GREEN */ - output().set_lamp_value(7, ((data >> 2) & 1)); /* Lamp 7 - HOLD 5 */ - output().set_lamp_value(0, ((data >> 3) & 1)); /* Lamp 0 - DEAL */ - output().set_lamp_value(3, ((data >> 4) & 1)); /* Lamp 3 - HOLD 1 */ + m_lamps[9] = BIT(data, 0); // TWR.GREEN + m_lamps[7] = BIT(data, 2); // HOLD 5 + m_lamps[0] = BIT(data, 3); // DEAL + m_lamps[3] = BIT(data, 4); // HOLD 1 } diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp index 4b59576ba5b..26c0bd2a8f2 100644 --- a/src/mame/drivers/amusco.cpp +++ b/src/mame/drivers/amusco.cpp @@ -110,8 +110,9 @@ public: m_rtc(*this, "rtc"), m_crtc(*this, "crtc"), m_screen(*this, "screen"), - m_hopper(*this, "hopper") - { } + m_hopper(*this, "hopper"), + m_lamps(*this, "lamp%u", 0U) + { } TILE_GET_INFO_MEMBER(get_bg_tile_info); DECLARE_WRITE_LINE_MEMBER(coin_irq); @@ -127,14 +128,18 @@ public: MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); MC6845_UPDATE_ROW(update_row); DECLARE_PALETTE_INIT(amusco); + void amusco(machine_config &config); void draw88pkr(machine_config &config); - void amusco_io_map(address_map &map); - void amusco_mem_map(address_map &map); + protected: virtual void video_start() override; virtual void machine_start() override; + private: + void amusco_mem_map(address_map &map); + void amusco_io_map(address_map &map); + std::unique_ptr m_videoram; tilemap_t *m_bg_tilemap; @@ -146,6 +151,8 @@ private: required_device m_crtc; required_device m_screen; required_device m_hopper; + output_finder<8> m_lamps; + uint8_t m_mc6845_address; uint16_t m_video_update_address; bool m_blink_state; @@ -192,6 +199,7 @@ void amusco_state::video_start() void amusco_state::machine_start() { + m_lamps.resolve(); } @@ -244,12 +252,8 @@ WRITE8_MEMBER(amusco_state::output_a_w) xx-- ---- Unknown. */ - output().set_lamp_value(0, (data) & 1); // Lamp 0 (Bet) - output().set_lamp_value(1, (data >> 1) & 1); // Lamp 1 (Hold/Disc 5) - output().set_lamp_value(2, (data >> 2) & 1); // Lamp 2 (Hold/Disc 3) - output().set_lamp_value(3, (data >> 3) & 1); // Lamp 3 (Hold/Disc 1) - output().set_lamp_value(4, (data >> 4) & 1); // Lamp 4 (Hold/Disc 2) - output().set_lamp_value(5, (data >> 5) & 1); // Lamp 5 (Hold/Disc 4) + for (int i = 0; i < 6; i++) + m_lamps[i] = BIT(data, i); // logerror("Writing %02Xh to PPI output A\n", data); } @@ -268,8 +272,8 @@ WRITE8_MEMBER(amusco_state::output_b_w) x--- ---- Special: NMI enable (cleared and set along with CPU interrupt flag). */ - output().set_lamp_value(6, (data >> 2) & 1); // Lamp 6 (Start/Draw) - output().set_lamp_value(7, (data >> 1) & 1); // Lamp 7 (Unknown) + m_lamps[6] = BIT(data, 2); // Lamp 6 (Start/Draw) + m_lamps[7] = BIT(data, 1); // Lamp 7 (Unknown) m_pit->write_gate0(!BIT(data, 4)); diff --git a/src/mame/includes/ampoker2.h b/src/mame/includes/ampoker2.h index c4e90009c5d..e47c975b0f1 100644 --- a/src/mame/includes/ampoker2.h +++ b/src/mame/includes/ampoker2.h @@ -11,10 +11,13 @@ public: m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_lamps(*this, "lamp%u", 0U) + { } + + void sigma2k(machine_config &config); + void ampoker2(machine_config &config); - required_shared_ptr m_videoram; - tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(ampoker2_port30_w); DECLARE_WRITE8_MEMBER(ampoker2_port31_w); DECLARE_WRITE8_MEMBER(ampoker2_port32_w); @@ -28,15 +31,23 @@ public: DECLARE_DRIVER_INIT(piccolop); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(s2k_get_bg_tile_info); - virtual void video_start() override; DECLARE_PALETTE_INIT(ampoker2); DECLARE_VIDEO_START(sigma2k); + +protected: + virtual void video_start() override; + virtual void machine_start() override; + +private: + void ampoker2_io_map(address_map &map); + void ampoker2_map(address_map &map); + + required_shared_ptr m_videoram; + tilemap_t *m_bg_tilemap; uint32_t screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_device m_maincpu; required_device m_watchdog; required_device m_gfxdecode; - void sigma2k(machine_config &config); - void ampoker2(machine_config &config); - void ampoker2_io_map(address_map &map); - void ampoker2_map(address_map &map); + output_finder<10> m_lamps; };