1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 
4 /*************************************************************************
5 
6     Hot Pinball
7     Gals Pinball
8 
9 *************************************************************************/
10 #ifndef MAME_INCLUDES_GALSPNBL_H
11 #define MAME_INCLUDES_GALSPNBL_H
12 
13 #pragma once
14 
15 #include "machine/gen_latch.h"
16 #include "video/tecmo_spr.h"
17 #include "emupal.h"
18 #include "screen.h"
19 
20 class galspnbl_state : public driver_device
21 {
22 public:
galspnbl_state(const machine_config & mconfig,device_type type,const char * tag)23 	galspnbl_state(const machine_config &mconfig, device_type type, const char *tag) :
24 		driver_device(mconfig, type, tag),
25 		m_spriteram(*this, "spriteram"),
26 		m_colorram(*this, "colorram"),
27 		m_videoram(*this, "videoram"),
28 		m_bgvideoram(*this, "bgvideoram"),
29 		m_scroll(*this, "scroll"),
30 		m_audiocpu(*this, "audiocpu"),
31 		m_maincpu(*this, "maincpu"),
32 		m_gfxdecode(*this, "gfxdecode"),
33 		m_palette(*this, "palette"),
34 		m_sprgen(*this, "spritegen"),
35 		m_screen(*this, "screen"),
36 		m_soundlatch(*this, "soundlatch")
37 	{ }
38 
39 	void galspnbl(machine_config &config);
40 
41 private:
42 	/* memory pointers */
43 	required_shared_ptr<uint16_t> m_spriteram;
44 	required_shared_ptr<uint16_t> m_colorram;
45 	required_shared_ptr<uint16_t> m_videoram;
46 	required_shared_ptr<uint16_t> m_bgvideoram;
47 	required_shared_ptr<uint16_t> m_scroll;
48 
49 	/* devices */
50 	required_device<cpu_device> m_audiocpu;
51 	required_device<cpu_device> m_maincpu;
52 	required_device<gfxdecode_device> m_gfxdecode;
53 	required_device<palette_device> m_palette;
54 	required_device<tecmo_spr_device> m_sprgen;
55 	required_device<screen_device> m_screen;
56 	required_device<generic_latch_8_device> m_soundlatch;
57 
58 	void soundcommand_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
59 	virtual void machine_start() override;
60 	void galspnbl_palette(palette_device &palette) const;
61 	uint32_t screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
62 	void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect );
63 	bitmap_ind16 m_sprite_bitmap;
64 	DECLARE_VIDEO_START(galspnbl);
65 
66 	void mix_sprite_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
67 
68 	void audio_map(address_map &map);
69 	void main_map(address_map &map);
70 };
71 
72 #endif // MAME_INCLUDES_GALSPNBL_H
73