1 // license:BSD-3-Clause
2 // copyright-holders:Mirko Buffoni
3 /*************************************************************************
4 
5     City Connection
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_CITYCON_H
9 #define MAME_INCLUDES_CITYCON_H
10 
11 #pragma once
12 
13 #include "emupal.h"
14 #include "tilemap.h"
15 
16 class citycon_state : public driver_device
17 {
18 public:
citycon_state(const machine_config & mconfig,device_type type,const char * tag)19 	citycon_state(const machine_config &mconfig, device_type type, const char *tag) :
20 		driver_device(mconfig, type, tag),
21 		m_videoram(*this, "videoram"),
22 		m_linecolor(*this, "linecolor"),
23 		m_spriteram(*this, "spriteram"),
24 		m_scroll(*this, "scroll"),
25 		m_maincpu(*this, "maincpu"),
26 		m_gfxdecode(*this, "gfxdecode"),
27 		m_palette(*this, "palette")
28 	{ }
29 
30 	/* memory pointers */
31 	required_shared_ptr<uint8_t> m_videoram;
32 	required_shared_ptr<uint8_t> m_linecolor;
33 	required_shared_ptr<uint8_t> m_spriteram;
34 	required_shared_ptr<uint8_t> m_scroll;
35 
36 	/* video-related */
37 	tilemap_t        *m_bg_tilemap;
38 	tilemap_t        *m_fg_tilemap;
39 	int            m_bg_image;
40 
41 	/* devices */
42 	required_device<cpu_device> m_maincpu;
43 	required_device<gfxdecode_device> m_gfxdecode;
44 	required_device<palette_device> m_palette;
45 
46 	uint8_t citycon_in_r();
47 	uint8_t citycon_irq_ack_r();
48 	void citycon_videoram_w(offs_t offset, uint8_t data);
49 	void citycon_linecolor_w(offs_t offset, uint8_t data);
50 	void citycon_background_w(uint8_t data);
51 	void init_citycon();
52 	TILEMAP_MAPPER_MEMBER(citycon_scan);
53 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
54 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
55 	virtual void machine_start() override;
56 	virtual void machine_reset() override;
57 	virtual void video_start() override;
58 	uint32_t screen_update_citycon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59 	void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
60 	inline void changecolor_RRRRGGGGBBBBxxxx( int color, int indx );
61 	void citycon(machine_config &config);
62 	void citycon_map(address_map &map);
63 	void sound_map(address_map &map);
64 };
65 
66 #endif // MAME_INCLUDES_CITYCON_H
67