1 // license:BSD-3-Clause
2 // copyright-holders:Zsolt Vasvari
3 /*************************************************************************
4 
5     Atari Cops'n Robbers hardware
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_COPSNROB_H
9 #define MAME_INCLUDES_COPSNROB_H
10 
11 #pragma once
12 
13 #include "machine/74259.h"
14 #include "sound/discrete.h"
15 #include "emupal.h"
16 #include "screen.h"
17 
18 
19 class copsnrob_state : public driver_device
20 {
21 public:
copsnrob_state(const machine_config & mconfig,device_type type,const char * tag)22 	copsnrob_state(const machine_config &mconfig, device_type type, const char *tag) :
23 		driver_device(mconfig, type, tag),
24 		m_trucky(*this, "trucky"),
25 		m_truckram(*this, "truckram"),
26 		m_bulletsram(*this, "bulletsram"),
27 		m_carimage(*this, "carimage"),
28 		m_cary(*this, "cary"),
29 		m_videoram(*this, "videoram"),
30 		m_discrete(*this, "discrete"),
31 		m_maincpu(*this, "maincpu"),
32 		m_gfxdecode(*this, "gfxdecode"),
33 		m_screen(*this, "screen"),
34 		m_palette(*this, "palette"),
35 		m_leds(*this, "led%u", 0U)
36 	{ }
37 
38 	void copsnrob(machine_config &config);
39 
40 protected:
41 	virtual void machine_start() override;
42 	virtual void machine_reset() override;
43 	void copsnrob_audio(machine_config &config);
44 	void main_map(address_map &map);
45 
46 	uint8_t copsnrob_misc_r();
47 	void copsnrob_misc2_w(uint8_t data);
48 	DECLARE_WRITE_LINE_MEMBER(one_start_w);
49 	uint32_t screen_update_copsnrob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50 
51 private:
52 	/* memory pointers */
53 	required_shared_ptr<uint8_t> m_trucky;
54 	required_shared_ptr<uint8_t> m_truckram;
55 	required_shared_ptr<uint8_t> m_bulletsram;
56 	required_shared_ptr<uint8_t> m_carimage;
57 	required_shared_ptr<uint8_t> m_cary;
58 	required_shared_ptr<uint8_t> m_videoram;
59 	required_device<discrete_device> m_discrete;
60 
61 	/* misc */
62 	uint8_t          m_misc;
63 	uint8_t          m_ic_h3_data;
64 
65 	required_device<cpu_device> m_maincpu;
66 	required_device<gfxdecode_device> m_gfxdecode;
67 	required_device<screen_device> m_screen;
68 	required_device<palette_device> m_palette;
69 
70 	output_finder<2> m_leds;
71 };
72 
73 #endif // MAME_INCLUDES_COPSNROB_H
74