1 // license:BSD-3-Clause
2 // copyright-holders:Phil Stroffolino
3 #ifndef MAME_INCLUDES_M57_H
4 #define MAME_INCLUDES_M57_H
5 
6 #pragma once
7 
8 #include "emupal.h"
9 #include "tilemap.h"
10 
11 class m57_state : public driver_device
12 {
13 public:
m57_state(const machine_config & mconfig,device_type type,const char * tag)14 	m57_state(const machine_config &mconfig, device_type type, const char *tag) :
15 		driver_device(mconfig, type, tag),
16 		m_videoram(*this, "videoram"),
17 		m_scrollram(*this, "scrollram"),
18 		m_spriteram(*this, "spriteram"),
19 		m_maincpu(*this, "maincpu"),
20 		m_gfxdecode(*this, "gfxdecode"),
21 		m_palette(*this, "palette")
22 	{ }
23 
24 	void m57(machine_config &config);
25 
26 private:
27 	/* memory pointers */
28 	required_shared_ptr<uint8_t> m_videoram;
29 	required_shared_ptr<uint8_t> m_scrollram;
30 	required_shared_ptr<uint8_t> m_spriteram;
31 
32 	/* video-related */
33 	tilemap_t*             m_bg_tilemap;
34 	int                  m_flipscreen;
35 	void m57_videoram_w(offs_t offset, uint8_t data);
36 	void m57_flipscreen_w(uint8_t data);
37 	TILE_GET_INFO_MEMBER(get_tile_info);
38 	virtual void video_start() override;
39 	void m57_palette(palette_device &palette) const;
40 	uint32_t screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41 	void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
42 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
43 	required_device<cpu_device> m_maincpu;
44 	required_device<gfxdecode_device> m_gfxdecode;
45 	required_device<palette_device> m_palette;
46 	void main_map(address_map &map);
47 };
48 
49 #endif // MAME_INCLUDES_M57_H
50