1 // license:BSD-3-Clause
2 // copyright-holders:Roberto Fresca
3 #ifndef MAME_INCLUDES_SNOOKR10_H
4 #define MAME_INCLUDES_SNOOKR10_H
5 
6 #pragma once
7 
8 #include "emupal.h"
9 #include "tilemap.h"
10 
11 class snookr10_state : public driver_device
12 {
13 public:
snookr10_state(const machine_config & mconfig,device_type type,const char * tag)14 	snookr10_state(const machine_config &mconfig, device_type type, const char *tag) :
15 		driver_device(mconfig, type, tag),
16 		m_videoram(*this, "videoram"),
17 		m_colorram(*this, "colorram"),
18 		m_maincpu(*this, "maincpu"),
19 		m_gfxdecode(*this, "gfxdecode"),
20 		m_lamps(*this, "lamp%u", 0U)
21 	{ }
22 
23 	void apple10(machine_config &config);
24 	void snookr10(machine_config &config);
25 	void crystalc(machine_config &config);
26 	void tenballs(machine_config &config);
27 
28 private:
29 	uint8_t dsw_port_1_r();
30 	uint8_t port2000_8_r();
31 	void output_port_0_w(uint8_t data);
32 	void output_port_1_w(uint8_t data);
33 	void snookr10_videoram_w(offs_t offset, uint8_t data);
34 	void snookr10_colorram_w(offs_t offset, uint8_t data);
35 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
36 	TILE_GET_INFO_MEMBER(apple10_get_bg_tile_info);
37 	TILE_GET_INFO_MEMBER(crystalc_get_bg_tile_info);
38 	void snookr10_palette(palette_device &palette) const;
39 	DECLARE_VIDEO_START(apple10);
40 	DECLARE_VIDEO_START(crystalc);
41 	void apple10_palette(palette_device &palette) const;
42 	void crystalc_palette(palette_device &palette) const;
43 	uint32_t screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
44 	void crystalc_map(address_map &map);
45 	void snookr10_map(address_map &map);
46 	void tenballs_map(address_map &map);
47 
machine_start()48 	virtual void machine_start() override { m_lamps.resolve(); }
49 	virtual void video_start() override;
50 
51 	int m_outportl;
52 	int m_outporth;
53 	int m_bit0;
54 	int m_bit1;
55 	int m_bit2;
56 	int m_bit3;
57 	int m_bit4;
58 	int m_bit5;
59 	required_shared_ptr<uint8_t> m_videoram;
60 	required_shared_ptr<uint8_t> m_colorram;
61 	tilemap_t *m_bg_tilemap;
62 	required_device<cpu_device> m_maincpu;
63 	required_device<gfxdecode_device> m_gfxdecode;
64 	output_finder<7> m_lamps;
65 };
66 
67 #endif // MAME_INCLUDES_SNOOKR10_H
68