1 // license:BSD-3-Clause
2 // copyright-holders:Mirko Buffoni
3 /*************************************************************************
4 
5     Pirate Ship Higemaru
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_HIGEMARU_H
9 #define MAME_INCLUDES_HIGEMARU_H
10 
11 #pragma once
12 
13 #include "machine/timer.h"
14 #include "emupal.h"
15 #include "tilemap.h"
16 
17 class higemaru_state : public driver_device
18 {
19 public:
higemaru_state(const machine_config & mconfig,device_type type,const char * tag)20 	higemaru_state(const machine_config &mconfig, device_type type, const char *tag) :
21 		driver_device(mconfig, type, tag),
22 		m_videoram(*this, "videoram"),
23 		m_colorram(*this, "colorram"),
24 		m_spriteram(*this, "spriteram"),
25 		m_maincpu(*this, "maincpu"),
26 		m_gfxdecode(*this, "gfxdecode"),
27 		m_palette(*this, "palette")
28 	{ }
29 
30 	void higemaru(machine_config &config);
31 
32 private:
33 	/* memory pointers */
34 	required_shared_ptr<uint8_t> m_videoram;
35 	required_shared_ptr<uint8_t> m_colorram;
36 	required_shared_ptr<uint8_t> m_spriteram;
37 
38 	/* video-related */
39 	tilemap_t    *m_bg_tilemap;
40 	void higemaru_videoram_w(offs_t offset, uint8_t data);
41 	void higemaru_colorram_w(offs_t offset, uint8_t data);
42 	void higemaru_c800_w(uint8_t data);
43 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
44 	virtual void video_start() override;
45 	void higemaru_palette(palette_device &palette) const;
46 	uint32_t screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47 	TIMER_DEVICE_CALLBACK_MEMBER(higemaru_scanline);
48 	void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
49 	required_device<cpu_device> m_maincpu;
50 	required_device<gfxdecode_device> m_gfxdecode;
51 	required_device<palette_device> m_palette;
52 	void higemaru_map(address_map &map);
53 };
54 
55 #endif // MAME_INCLUDES_HIGEMARU_H
56