1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /*************************************************************************
4 
5     Mr. Do
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_MRDO_H
9 #define MAME_INCLUDES_MRDO_H
10 
11 #pragma once
12 
13 #include "emupal.h"
14 #include "tilemap.h"
15 
16 class mrdo_state : public driver_device
17 {
18 public:
mrdo_state(const machine_config & mconfig,device_type type,const char * tag)19 	mrdo_state(const machine_config &mconfig, device_type type, const char *tag) :
20 		driver_device(mconfig, type, tag),
21 		m_bgvideoram(*this, "bgvideoram"),
22 		m_fgvideoram(*this, "fgvideoram"),
23 		m_spriteram(*this, "spriteram"),
24 		m_maincpu(*this, "maincpu"),
25 		m_gfxdecode(*this, "gfxdecode"),
26 		m_palette(*this, "palette")
27 	{ }
28 
29 	void mrdo(machine_config &config);
30 	void mrlo(machine_config &config);
31 	void mrdobl(machine_config &config);
32 
33 protected:
34 	virtual void video_start() override;
35 
36 private:
37 	// memory pointers
38 	required_shared_ptr<uint8_t> m_bgvideoram;
39 	required_shared_ptr<uint8_t> m_fgvideoram;
40 	required_shared_ptr<uint8_t> m_spriteram;
41 
42 	required_device<cpu_device> m_maincpu;
43 	required_device<gfxdecode_device> m_gfxdecode;
44 	required_device<palette_device> m_palette;
45 
46 	// video-related
47 	tilemap_t *m_bg_tilemap;
48 	tilemap_t *m_fg_tilemap;
49 	int       m_flipscreen;
50 
51 	uint8_t mrdo_SECRE_r();
52 	void mrdo_bgvideoram_w(offs_t offset, uint8_t data);
53 	void mrdo_fgvideoram_w(offs_t offset, uint8_t data);
54 	void mrdo_scrollx_w(uint8_t data);
55 	void mrdo_scrolly_w(uint8_t data);
56 	void mrdo_flipscreen_w(uint8_t data);
57 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
58 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
59 	void mrdo_palette(palette_device &palette) const;
60 	uint32_t screen_update_mrdo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
61 	void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
62 	void main_map(address_map &map);
63 };
64 
65 #endif // MAME_INCLUDES_MRDO_H
66