-output: Removed legacy output accessors from ampoker2, amusco. [Ryan Holtz]

This commit is contained in:
mooglyguy 2018-04-04 22:24:17 +02:00
parent c0f2724be9
commit 56e169ea66
3 changed files with 50 additions and 30 deletions

View File

@ -388,6 +388,11 @@
#include "ampoker2.lh" #include "ampoker2.lh"
#include "sigmapkr.lh" #include "sigmapkr.lh"
void ampoker2_state::machine_start()
{
m_lamps.resolve();
}
/********************** /**********************
* Read/Write Handlers * * Read/Write Handlers *
* - Output Ports - * * - Output Ports - *
@ -483,10 +488,10 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port31_w)
BIT 4 = TWL_YELL ;Tower Light YELLOW BIT 4 = TWL_YELL ;Tower Light YELLOW
--------------------------------------------------*/ --------------------------------------------------*/
{ {
output().set_lamp_value(1, ((data >> 1) & 1)); /* Lamp 1 - BET/RED */ m_lamps[1] = BIT(data, 1); // BET/RED
output().set_lamp_value(6, ((data >> 2) & 1)); /* Lamp 6 - HOLD 4 */ m_lamps[6] = BIT(data, 2); // HOLD 4
output().set_lamp_value(4, ((data >> 3) & 1)); /* Lamp 4 - HOLD 2 */ m_lamps[4] = BIT(data, 3); // HOLD 2
output().set_lamp_value(8, ((data >> 4) & 1)); /* Lamp 8 - TWR.YELLOW */ m_lamps[8] = BIT(data, 4); // TWR.YELLOW
} }
@ -501,7 +506,7 @@ WRITE8_MEMBER(ampoker2_state::ampoker2_port32_w)
BIT 4 = 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) 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) BIT 4 = LAMP_3 ;Lamp 3 (HOLD1)
--------------------------------------------------*/ --------------------------------------------------*/
{ {
output().set_lamp_value(9, (data & 1)); /* Lamp 9 - TWR.GREEN */ m_lamps[9] = BIT(data, 0); // TWR.GREEN
output().set_lamp_value(7, ((data >> 2) & 1)); /* Lamp 7 - HOLD 5 */ m_lamps[7] = BIT(data, 2); // HOLD 5
output().set_lamp_value(0, ((data >> 3) & 1)); /* Lamp 0 - DEAL */ m_lamps[0] = BIT(data, 3); // DEAL
output().set_lamp_value(3, ((data >> 4) & 1)); /* Lamp 3 - HOLD 1 */ m_lamps[3] = BIT(data, 4); // HOLD 1
} }

View File

@ -110,7 +110,8 @@ public:
m_rtc(*this, "rtc"), m_rtc(*this, "rtc"),
m_crtc(*this, "crtc"), m_crtc(*this, "crtc"),
m_screen(*this, "screen"), 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); TILE_GET_INFO_MEMBER(get_bg_tile_info);
@ -127,14 +128,18 @@ public:
MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
MC6845_UPDATE_ROW(update_row); MC6845_UPDATE_ROW(update_row);
DECLARE_PALETTE_INIT(amusco); DECLARE_PALETTE_INIT(amusco);
void amusco(machine_config &config); void amusco(machine_config &config);
void draw88pkr(machine_config &config); void draw88pkr(machine_config &config);
void amusco_io_map(address_map &map);
void amusco_mem_map(address_map &map);
protected: protected:
virtual void video_start() override; virtual void video_start() override;
virtual void machine_start() override; virtual void machine_start() override;
private: private:
void amusco_mem_map(address_map &map);
void amusco_io_map(address_map &map);
std::unique_ptr<uint8_t []> m_videoram; std::unique_ptr<uint8_t []> m_videoram;
tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap;
@ -146,6 +151,8 @@ private:
required_device<mc6845_device> m_crtc; required_device<mc6845_device> m_crtc;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
required_device<ticket_dispenser_device> m_hopper; required_device<ticket_dispenser_device> m_hopper;
output_finder<8> m_lamps;
uint8_t m_mc6845_address; uint8_t m_mc6845_address;
uint16_t m_video_update_address; uint16_t m_video_update_address;
bool m_blink_state; bool m_blink_state;
@ -192,6 +199,7 @@ void amusco_state::video_start()
void amusco_state::machine_start() void amusco_state::machine_start()
{ {
m_lamps.resolve();
} }
@ -244,12 +252,8 @@ WRITE8_MEMBER(amusco_state::output_a_w)
xx-- ---- Unknown. xx-- ---- Unknown.
*/ */
output().set_lamp_value(0, (data) & 1); // Lamp 0 (Bet) for (int i = 0; i < 6; i++)
output().set_lamp_value(1, (data >> 1) & 1); // Lamp 1 (Hold/Disc 5) m_lamps[i] = BIT(data, i);
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)
// logerror("Writing %02Xh to PPI output A\n", data); // 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). x--- ---- Special: NMI enable (cleared and set along with CPU interrupt flag).
*/ */
output().set_lamp_value(6, (data >> 2) & 1); // Lamp 6 (Start/Draw) m_lamps[6] = BIT(data, 2); // Lamp 6 (Start/Draw)
output().set_lamp_value(7, (data >> 1) & 1); // Lamp 7 (Unknown) m_lamps[7] = BIT(data, 1); // Lamp 7 (Unknown)
m_pit->write_gate0(!BIT(data, 4)); m_pit->write_gate0(!BIT(data, 4));

View File

@ -11,10 +11,13 @@ public:
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_watchdog(*this, "watchdog"), 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<uint8_t> m_videoram;
tilemap_t *m_bg_tilemap;
DECLARE_WRITE8_MEMBER(ampoker2_port30_w); DECLARE_WRITE8_MEMBER(ampoker2_port30_w);
DECLARE_WRITE8_MEMBER(ampoker2_port31_w); DECLARE_WRITE8_MEMBER(ampoker2_port31_w);
DECLARE_WRITE8_MEMBER(ampoker2_port32_w); DECLARE_WRITE8_MEMBER(ampoker2_port32_w);
@ -28,15 +31,23 @@ public:
DECLARE_DRIVER_INIT(piccolop); DECLARE_DRIVER_INIT(piccolop);
TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(s2k_get_bg_tile_info); TILE_GET_INFO_MEMBER(s2k_get_bg_tile_info);
virtual void video_start() override;
DECLARE_PALETTE_INIT(ampoker2); DECLARE_PALETTE_INIT(ampoker2);
DECLARE_VIDEO_START(sigma2k); 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<uint8_t> m_videoram;
tilemap_t *m_bg_tilemap;
uint32_t screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<watchdog_timer_device> m_watchdog; required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
void sigma2k(machine_config &config); output_finder<10> m_lamps;
void ampoker2(machine_config &config);
void ampoker2_io_map(address_map &map);
void ampoker2_map(address_map &map);
}; };