1 // license:BSD-3-Clause
2 // copyright-holders:Takahiro Nogi
3 #include "machine/nb1413m3.h"
4 #include "screen.h"
5 
6 class hyhoo_state : public driver_device
7 {
8 public:
hyhoo_state(const machine_config & mconfig,device_type type,const char * tag)9 	hyhoo_state(const machine_config &mconfig, device_type type, const char *tag)
10 		: driver_device(mconfig, type, tag),
11 		m_maincpu(*this, "maincpu"),
12 		m_nb1413m3(*this, "nb1413m3"),
13 		m_screen(*this, "screen"),
14 		m_clut(*this, "clut") { }
15 
16 	void hyhoo(machine_config &config);
17 	void hyhoo2(machine_config &config);
18 
19 private:
20 	enum
21 	{
22 		TIMER_BLITTER
23 	};
24 
25 	required_device<cpu_device> m_maincpu;
26 	required_device<nb1413m3_device> m_nb1413m3;
27 	required_device<screen_device> m_screen;
28 	required_shared_ptr<uint8_t> m_clut;
29 
30 	int m_blitter_destx;
31 	int m_blitter_desty;
32 	int m_blitter_sizex;
33 	int m_blitter_sizey;
34 	int m_blitter_src_addr;
35 	int m_blitter_direction_x;
36 	int m_blitter_direction_y;
37 	int m_gfxrom;
38 	int m_dispflag;
39 	int m_highcolorflag;
40 	int m_flipscreen;
41 	bitmap_rgb32 m_tmpbitmap;
42 	emu_timer *m_blitter_timer;
43 
44 	void hyhoo_blitter_w(offs_t offset, uint8_t data);
45 	void hyhoo_romsel_w(uint8_t data);
46 
47 	virtual void video_start() override;
48 
49 	uint32_t screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
50 	void hyhoo_gfxdraw();
51 
52 	void hyhoo_io_map(address_map &map);
53 	void hyhoo_map(address_map &map);
54 
55 	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
56 };
57