1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /*************************************************************************
4 
5     Labyrinth Runner
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_LABYRUNR_H
9 #define MAME_INCLUDES_LABYRUNR_H
10 
11 #pragma once
12 
13 #include "video/k007121.h"
14 #include "video/k051733.h"
15 #include "emupal.h"
16 #include "screen.h"
17 #include "tilemap.h"
18 
19 class labyrunr_state : public driver_device
20 {
21 public:
labyrunr_state(const machine_config & mconfig,device_type type,const char * tag)22 	labyrunr_state(const machine_config &mconfig, device_type type, const char *tag) :
23 		driver_device(mconfig, type, tag),
24 		m_k007121(*this, "k007121"),
25 		m_maincpu(*this,"maincpu"),
26 		m_scrollram(*this, "scrollram"),
27 		m_spriteram(*this, "spriteram"),
28 		m_videoram1(*this, "videoram1"),
29 		m_videoram2(*this, "videoram2"),
30 		m_gfxdecode(*this, "gfxdecode"),
31 		m_screen(*this, "screen"),
32 		m_palette(*this, "palette")
33 	{ }
34 
35 	void labyrunr(machine_config &config);
36 
37 private:
38 	/* devices */
39 	required_device<k007121_device> m_k007121;
40 
41 	required_device<cpu_device> m_maincpu;
42 	/* memory pointers */
43 	required_shared_ptr<uint8_t> m_scrollram;
44 	required_shared_ptr<uint8_t> m_spriteram;
45 	required_shared_ptr<uint8_t> m_videoram1;
46 	required_shared_ptr<uint8_t> m_videoram2;
47 
48 	required_device<gfxdecode_device> m_gfxdecode;
49 	required_device<screen_device> m_screen;
50 	required_device<palette_device> m_palette;
51 
52 	/* video-related */
53 	tilemap_t    *m_layer0;
54 	tilemap_t    *m_layer1;
55 	rectangle  m_clip0;
56 	rectangle  m_clip1;
57 
58 	void labyrunr_bankswitch_w(uint8_t data);
59 	void labyrunr_vram1_w(offs_t offset, uint8_t data);
60 	void labyrunr_vram2_w(offs_t offset, uint8_t data);
61 	TILE_GET_INFO_MEMBER(get_tile_info0);
62 	TILE_GET_INFO_MEMBER(get_tile_info1);
63 	virtual void machine_start() override;
64 	virtual void video_start() override;
65 	void labyrunr_palette(palette_device &palette) const;
66 	uint32_t screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
67 	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
68 	INTERRUPT_GEN_MEMBER(labyrunr_timer_interrupt);
69 	void labyrunr_map(address_map &map);
70 };
71 
72 #endif // MAME_INCLUDES_LABYRUNR_H
73