1 // license:BSD-3-Clause
2 // copyright-holders:Tomasz Slanina
3 #ifndef MAME_INCLUDES_MUSTACHE_H
4 #define MAME_INCLUDES_MUSTACHE_H
5 
6 #pragma once
7 
8 #include "audio/seibu.h"    // for seibu_sound_decrypt on the MAIN cpu (not sound)
9 #include "machine/timer.h"
10 #include "emupal.h"
11 #include "screen.h"
12 #include "tilemap.h"
13 
14 class mustache_state : public driver_device
15 {
16 public:
mustache_state(const machine_config & mconfig,device_type type,const char * tag)17 	mustache_state(const machine_config &mconfig, device_type type, const char *tag) :
18 		driver_device(mconfig, type, tag),
19 		m_maincpu(*this, "maincpu"),
20 		m_gfxdecode(*this, "gfxdecode"),
21 		m_screen(*this, "screen"),
22 		m_palette(*this, "palette"),
23 		m_videoram(*this, "videoram"),
24 		m_spriteram(*this, "spriteram"),
25 		m_dswb(*this, "DSWB")
26 	{ }
27 
28 	void mustache(machine_config &config);
29 
30 	void init_mustache();
31 
32 private:
33 	required_device<cpu_device> m_maincpu;
34 	required_device<gfxdecode_device> m_gfxdecode;
35 	required_device<screen_device> m_screen;
36 	required_device<palette_device> m_palette;
37 
38 	required_shared_ptr<uint8_t> m_videoram;
39 	required_shared_ptr<uint8_t> m_spriteram;
40 
41 	required_ioport m_dswb;
42 
43 	tilemap_t *m_bg_tilemap;
44 	int m_control_byte;
45 
46 	void videoram_w(offs_t offset, uint8_t data);
47 	void video_control_w(uint8_t data);
48 	void scroll_w(uint8_t data);
49 
50 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
51 
52 	virtual void video_start() override;
53 
54 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
56 
57 	void decrypted_opcodes_map(address_map &map);
58 	void memmap(address_map &map);
59 };
60 
61 #endif // MAME_INCLUDES_MUSTACHE_H
62