1 // license:BSD-3-Clause
2 // copyright-holders:Phil Stroffolino
3 /***************************************************************************
4 
5     Break Thru
6 
7 ***************************************************************************/
8 #ifndef MAME_INCLUDES_BRKTRHU_H
9 #define MAME_INCLUDES_BRKTRHU_H
10 
11 #pragma once
12 
13 #include "machine/gen_latch.h"
14 #include "emupal.h"
15 #include "tilemap.h"
16 
17 class brkthru_state : public driver_device
18 {
19 public:
brkthru_state(const machine_config & mconfig,device_type type,const char * tag)20 	brkthru_state(const machine_config &mconfig, device_type type, const char *tag) :
21 		driver_device(mconfig, type, tag),
22 		m_fg_videoram(*this, "fg_videoram"),
23 		m_videoram(*this, "videoram"),
24 		m_spriteram(*this, "spriteram"),
25 		m_maincpu(*this, "maincpu"),
26 		m_audiocpu(*this, "audiocpu"),
27 		m_gfxdecode(*this, "gfxdecode"),
28 		m_palette(*this, "palette"),
29 		m_soundlatch(*this, "soundlatch")
30 	{ }
31 
32 	/* memory pointers */
33 	required_shared_ptr<uint8_t> m_fg_videoram;
34 	required_shared_ptr<uint8_t> m_videoram;
35 	required_shared_ptr<uint8_t> m_spriteram;
36 
37 	/* video-related */
38 	tilemap_t *m_fg_tilemap;
39 	tilemap_t *m_bg_tilemap;
40 	int     m_bgscroll;
41 	int     m_bgbasecolor;
42 	int     m_flipscreen;
43 
44 	/* devices */
45 	required_device<cpu_device> m_maincpu;
46 	required_device<cpu_device> m_audiocpu;
47 	required_device<gfxdecode_device> m_gfxdecode;
48 	required_device<palette_device> m_palette;
49 	required_device<generic_latch_8_device> m_soundlatch;
50 
51 	uint8_t   m_nmi_mask;
52 	void brkthru_1803_w(uint8_t data);
53 	void darwin_0803_w(uint8_t data);
54 	void brkthru_bgram_w(offs_t offset, uint8_t data);
55 	void brkthru_fgram_w(offs_t offset, uint8_t data);
56 	void brkthru_1800_w(offs_t offset, uint8_t data);
57 	DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
58 	void init_brkthru();
59 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
60 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
61 	virtual void machine_start() override;
62 	virtual void machine_reset() override;
63 	virtual void video_start() override;
64 	void brkthru_palette(palette_device &palette) const;
65 	uint32_t screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
66 	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
67 	void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio );
68 	void brkthru(machine_config &config);
69 	void darwin(machine_config &config);
70 	void brkthru_map(address_map &map);
71 	void darwin_map(address_map &map);
72 	void sound_map(address_map &map);
73 };
74 
75 #endif // MAME_INCLUDES_BRKTRHU_H
76