1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /***************************************************************************
4 
5     Bank Panic
6 
7 ***************************************************************************/
8 #ifndef MAME_INCLUDES_BANKP_H
9 #define MAME_INCLUDES_BANKP_H
10 
11 #pragma once
12 
13 #include "emupal.h"
14 #include "tilemap.h"
15 
16 class bankp_state : public driver_device
17 {
18 public:
bankp_state(const machine_config & mconfig,device_type type,const char * tag)19 	bankp_state(const machine_config &mconfig, device_type type, const char *tag) :
20 		driver_device(mconfig, type, tag),
21 		m_videoram(*this, "videoram"),
22 		m_colorram(*this, "colorram"),
23 		m_videoram2(*this, "videoram2"),
24 		m_colorram2(*this, "colorram2"),
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_colorram;
33 	required_shared_ptr<uint8_t> m_videoram2;
34 	required_shared_ptr<uint8_t> m_colorram2;
35 
36 	/* video-related */
37 	tilemap_t *m_bg_tilemap;
38 	tilemap_t *m_fg_tilemap;
39 	int     m_scroll_x;
40 	int     m_priority;
41 
42 	uint8_t m_nmi_mask;
43 	void scroll_w(uint8_t data);
44 	void videoram_w(offs_t offset, uint8_t data);
45 	void colorram_w(offs_t offset, uint8_t data);
46 	void videoram2_w(offs_t offset, uint8_t data);
47 	void colorram2_w(offs_t offset, uint8_t data);
48 	void out_w(uint8_t data);
49 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
50 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
51 	virtual void machine_reset() override;
52 	virtual void video_start() override;
53 	void bankp_palette(palette_device &palette) const;
54 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55 	INTERRUPT_GEN_MEMBER(vblank_irq);
56 	required_device<cpu_device> m_maincpu;
57 	required_device<gfxdecode_device> m_gfxdecode;
58 	required_device<palette_device> m_palette;
59 	void bankp(machine_config &config);
60 	void bankp_io_map(address_map &map);
61 	void bankp_map(address_map &map);
62 };
63 
64 #endif // MAME_INCLUDES_BANKP_H
65