1 // license:BSD-3-Clause
2 // copyright-holders:David Haywood
3 #ifndef MAME_INCLUDES_POKECHMP_H
4 #define MAME_INCLUDES_POKECHMP_H
5 
6 #pragma once
7 
8 #include "machine/gen_latch.h"
9 #include "emupal.h"
10 #include "tilemap.h"
11 
12 class pokechmp_state : public driver_device
13 {
14 public:
pokechmp_state(const machine_config & mconfig,device_type type,const char * tag)15 	pokechmp_state(const machine_config &mconfig, device_type type, const char *tag) :
16 		driver_device(mconfig, type, tag),
17 		m_videoram(*this, "videoram"),
18 		m_spriteram(*this, "spriteram"),
19 		m_maincpu(*this, "maincpu"),
20 		m_audiocpu(*this, "audiocpu"),
21 		m_gfxdecode(*this, "gfxdecode"),
22 		m_palette(*this, "palette"),
23 		m_soundlatch(*this, "soundlatch")
24 	{ }
25 
26 	void pokechmp(machine_config &config);
27 
28 	void init_pokechmp();
29 
30 private:
31 	required_shared_ptr<uint8_t> m_videoram;
32 	tilemap_t *m_bg_tilemap;
33 	required_shared_ptr<uint8_t> m_spriteram;
34 	void pokechmp_bank_w(uint8_t data);
35 	void pokechmp_sound_bank_w(uint8_t data);
36 	void pokechmp_sound_w(uint8_t data);
37 	void pokechmp_videoram_w(offs_t offset, uint8_t data);
38 	void pokechmp_flipscreen_w(uint8_t data);
39 	DECLARE_WRITE_LINE_MEMBER(sound_irq);
40 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
41 	virtual void video_start() override;
42 	uint32_t screen_update_pokechmp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
44 	required_device<cpu_device> m_maincpu;
45 	required_device<cpu_device> m_audiocpu;
46 	required_device<gfxdecode_device> m_gfxdecode;
47 	required_device<palette_device> m_palette;
48 	required_device<generic_latch_8_device> m_soundlatch;
49 	void pokechmp_map(address_map &map);
50 	void pokechmp_oki_map(address_map &map);
51 	void pokechmp_sound_map(address_map &map);
52 };
53 
54 #endif // MAME_INCLUDES_POKECHMP_H
55