1 // license:BSD-3-Clause
2 // copyright-holders:Bryan McPhail
3 #ifndef MAME_INCLUDES_PCKTGAL_H
4 #define MAME_INCLUDES_PCKTGAL_H
5 
6 #pragma once
7 
8 #include "machine/gen_latch.h"
9 #include "sound/msm5205.h"
10 #include "video/decbac06.h"
11 #include "emupal.h"
12 
13 class pcktgal_state : public driver_device
14 {
15 public:
pcktgal_state(const machine_config & mconfig,device_type type,const char * tag)16 	pcktgal_state(const machine_config &mconfig, device_type type, const char *tag) :
17 		driver_device(mconfig, type, tag),
18 		m_maincpu(*this, "maincpu"),
19 		m_audiocpu(*this, "audiocpu"),
20 		m_msm(*this, "msm"),
21 		m_tilegen(*this, "tilegen"),
22 		m_gfxdecode(*this, "gfxdecode"),
23 		m_palette(*this, "palette"),
24 		m_soundlatch(*this, "soundlatch"),
25 		m_spriteram(*this, "spriteram")
26 	{ }
27 
28 	required_device<cpu_device> m_maincpu;
29 	required_device<cpu_device> m_audiocpu;
30 	required_device<msm5205_device> m_msm;
31 	required_device<deco_bac06_device> m_tilegen;
32 	required_device<gfxdecode_device> m_gfxdecode;
33 	required_device<palette_device> m_palette;
34 	required_device<generic_latch_8_device> m_soundlatch;
35 
36 	required_shared_ptr<uint8_t> m_spriteram;
37 
38 	int m_msm5205next;
39 	int m_toggle;
40 
41 	void bank_w(uint8_t data);
42 	void sound_bank_w(uint8_t data);
43 	void sound_w(uint8_t data);
44 	void adpcm_data_w(uint8_t data);
45 	uint8_t sound_unk_r();
46 	DECLARE_WRITE_LINE_MEMBER(adpcm_int);
47 
48 	void init_pcktgal();
49 	void pcktgal_palette(palette_device &palette) const;
50 	virtual void machine_start() override;
51 
52 	uint32_t screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
53 	uint32_t screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen);
55 	void bootleg(machine_config &config);
56 	void pcktgal(machine_config &config);
57 	void pcktgal2(machine_config &config);
58 	void pcktgal_map(address_map &map);
59 	void pcktgal_sound_map(address_map &map);
60 };
61 
62 #endif // MAME_INCLUDES_PCKTGAL_H
63