1 // license:BSD-3-Clause
2 // copyright-holders:Bryan McPhail
3 
4 #include "machine/gen_latch.h"
5 #include "video/decbac06.h"
6 #include "video/decmxc06.h"
7 #include "screen.h"
8 #include "tilemap.h"
9 
10 class stadhero_state : public driver_device
11 {
12 public:
stadhero_state(const machine_config & mconfig,device_type type,const char * tag)13 	stadhero_state(const machine_config &mconfig, device_type type, const char *tag) :
14 		driver_device(mconfig, type, tag),
15 		m_maincpu(*this, "maincpu"),
16 		m_audiocpu(*this, "audiocpu"),
17 		m_tilegen(*this, "tilegen"),
18 		m_spritegen(*this, "spritegen"),
19 		m_gfxdecode(*this, "gfxdecode"),
20 		m_soundlatch(*this, "soundlatch"),
21 		m_screen(*this, "screen"),
22 		m_spriteram(*this, "spriteram"),
23 		m_pf1_data(*this, "pf1_data"),
24 		m_coin(*this, "COIN")
25 	{
26 	}
27 
28 	void stadhero(machine_config &config);
29 
30 private:
31 	required_device<cpu_device> m_maincpu;
32 	required_device<cpu_device> m_audiocpu;
33 	required_device<deco_bac06_device> m_tilegen;
34 	required_device<deco_mxc06_device> m_spritegen;
35 	required_device<gfxdecode_device> m_gfxdecode;
36 	required_device<generic_latch_8_device> m_soundlatch;
37 	required_device<screen_device> m_screen;
38 
39 	required_shared_ptr<uint16_t> m_spriteram;
40 	required_shared_ptr<uint16_t> m_pf1_data;
41 
42 	required_ioport m_coin;
43 
44 	tilemap_t *m_pf1_tilemap;
45 
46 	void int_ack_w(uint16_t data);
47 	void pf1_data_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
48 	uint8_t mystery_r();
49 
50 	virtual void video_start() override;
51 
52 	TILE_GET_INFO_MEMBER(get_pf1_tile_info);
53 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54 	void audio_map(address_map &map);
55 	void main_map(address_map &map);
56 };
57