1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /*************************************************************************
4 
5     Mosaic
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_MOSAIC_H
9 #define MAME_INCLUDES_MOSAIC_H
10 
11 #pragma once
12 
13 #include "tilemap.h"
14 
15 class mosaic_state : public driver_device
16 {
17 public:
mosaic_state(const machine_config & mconfig,device_type type,const char * tag)18 	mosaic_state(const machine_config &mconfig, device_type type, const char *tag) :
19 		driver_device(mconfig, type, tag),
20 		m_maincpu(*this, "maincpu"),
21 		m_gfxdecode(*this, "gfxdecode"),
22 		m_fgvideoram(*this, "fgvideoram"),
23 		m_bgvideoram(*this, "bgvideoram")
24 	{ }
25 
26 	void mosaic(machine_config &config);
27 	void gfire2(machine_config &config);
28 
29 protected:
30 	virtual void machine_start() override;
31 	virtual void machine_reset() override;
32 	virtual void video_start() override;
33 
34 private:
35 	/* devices */
36 	required_device<cpu_device> m_maincpu;
37 	required_device<gfxdecode_device> m_gfxdecode;
38 
39 	/* memory pointers */
40 	required_shared_ptr<uint8_t> m_fgvideoram;
41 	required_shared_ptr<uint8_t> m_bgvideoram;
42 
43 	/* video-related */
44 	tilemap_t      *m_bg_tilemap;
45 	tilemap_t      *m_fg_tilemap;
46 
47 	/* misc */
48 	int            m_prot_val;
49 
50 	void protection_w(uint8_t data);
51 	uint8_t protection_r();
52 	void gfire2_protection_w(uint8_t data);
53 	uint8_t gfire2_protection_r();
54 	void fgvideoram_w(offs_t offset, uint8_t data);
55 	void bgvideoram_w(offs_t offset, uint8_t data);
56 
57 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
58 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
59 
60 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
61 	void gfire2_io_map(address_map &map);
62 	void gfire2_map(address_map &map);
63 	void mosaic_io_map(address_map &map);
64 	void mosaic_map(address_map &map);
65 };
66 
67 #endif // MAME_INCLUDES_MOSAIC_H
68