1 // license:BSD-3-Clause
2 // copyright-holders:Mike Balfour
3 /*************************************************************************
4 
5     Atari Avalanche hardware
6 
7 *************************************************************************/
8 
9 #include "machine/74259.h"
10 #include "sound/discrete.h"
11 
12 class avalnche_state : public driver_device
13 {
14 public:
avalnche_state(const machine_config & mconfig,device_type type,const char * tag)15 	avalnche_state(const machine_config &mconfig, device_type type, const char *tag)
16 		: driver_device(mconfig, type, tag),
17 		m_videoram(*this, "videoram"),
18 		m_discrete(*this, "discrete"),
19 		m_maincpu(*this, "maincpu"),
20 		m_latch(*this, "latch") { }
21 
22 	required_shared_ptr<uint8_t> m_videoram;
23 	optional_device<discrete_device> m_discrete;
24 	required_device<cpu_device> m_maincpu;
25 	required_device<f9334_device> m_latch;
26 
27 	uint8_t m_avalance_video_inverted;
28 
29 	DECLARE_WRITE_LINE_MEMBER(video_invert_w);
30 	void catch_coin_counter_w(uint8_t data);
31 	DECLARE_WRITE_LINE_MEMBER(credit_1_lamp_w);
32 	DECLARE_WRITE_LINE_MEMBER(credit_2_lamp_w);
33 	DECLARE_WRITE_LINE_MEMBER(start_lamp_w);
34 	virtual void machine_start() override;
35 	uint32_t screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
36 	void avalnche_noise_amplitude_w(uint8_t data);
37 	DECLARE_WRITE_LINE_MEMBER(catch_aud0_w);
38 	DECLARE_WRITE_LINE_MEMBER(catch_aud1_w);
39 	DECLARE_WRITE_LINE_MEMBER(catch_aud2_w);
40 	void avalnche_base(machine_config &config);
41 	void acatch(machine_config &config);
42 	void acatch_sound(machine_config &config);
43 	void avalnche(machine_config &config);
44 	void avalnche_sound(machine_config &config);
45 	void catch_map(address_map &map);
46 	void main_map(address_map &map);
47 };
48