1 // license:BSD-3-Clause
2 // copyright-holders:Ernesto Corvi
3 #ifndef MAME_INCLUDES_WC90_H
4 #define MAME_INCLUDES_WC90_H
5 
6 #pragma once
7 
8 #include "machine/gen_latch.h"
9 #include "video/tecmo_spr.h"
10 #include "emupal.h"
11 #include "tilemap.h"
12 
13 class wc90_state : public driver_device
14 {
15 public:
wc90_state(const machine_config & mconfig,device_type type,const char * tag)16 	wc90_state(const machine_config &mconfig, device_type type, const char *tag) :
17 		driver_device(mconfig, type, tag),
18 		m_maincpu(*this, "maincpu"),
19 		m_audiocpu(*this, "audiocpu"),
20 		m_gfxdecode(*this, "gfxdecode"),
21 		m_palette(*this, "palette"),
22 		m_sprgen(*this, "spritegen"),
23 		m_soundlatch(*this, "soundlatch"),
24 		m_fgvideoram(*this, "fgvideoram"),
25 		m_bgvideoram(*this, "bgvideoram"),
26 		m_txvideoram(*this, "txvideoram"),
27 		m_scroll0xlo(*this, "scroll0xlo"),
28 		m_scroll0xhi(*this, "scroll0xhi"),
29 		m_scroll1xlo(*this, "scroll1xlo"),
30 		m_scroll1xhi(*this, "scroll1xhi"),
31 		m_scroll2xlo(*this, "scroll2xlo"),
32 		m_scroll2xhi(*this, "scroll2xhi"),
33 		m_scroll0ylo(*this, "scroll0ylo"),
34 		m_scroll0yhi(*this, "scroll0yhi"),
35 		m_scroll1ylo(*this, "scroll1ylo"),
36 		m_scroll1yhi(*this, "scroll1yhi"),
37 		m_scroll2ylo(*this, "scroll2ylo"),
38 		m_scroll2yhi(*this, "scroll2yhi"),
39 		m_spriteram(*this, "spriteram"),
40 		m_mainbank(*this, "mainbank"),
41 		m_subbank(*this, "subbank")
42 	{ }
43 
44 	void wc90t(machine_config &config);
45 	void wc90(machine_config &config);
46 	void pac90(machine_config &config);
47 
48 protected:
49 	virtual void machine_start() override;
50 	virtual void video_start() override;
51 
52 private:
53 	required_device<cpu_device> m_maincpu;
54 	required_device<cpu_device> m_audiocpu;
55 	required_device<gfxdecode_device> m_gfxdecode;
56 	required_device<palette_device> m_palette;
57 	required_device<tecmo_spr_device> m_sprgen;
58 	required_device<generic_latch_8_device> m_soundlatch;
59 
60 	required_shared_ptr<uint8_t> m_fgvideoram;
61 	required_shared_ptr<uint8_t> m_bgvideoram;
62 	required_shared_ptr<uint8_t> m_txvideoram;
63 	required_shared_ptr<uint8_t> m_scroll0xlo;
64 	required_shared_ptr<uint8_t> m_scroll0xhi;
65 	required_shared_ptr<uint8_t> m_scroll1xlo;
66 	required_shared_ptr<uint8_t> m_scroll1xhi;
67 	required_shared_ptr<uint8_t> m_scroll2xlo;
68 	required_shared_ptr<uint8_t> m_scroll2xhi;
69 	required_shared_ptr<uint8_t> m_scroll0ylo;
70 	required_shared_ptr<uint8_t> m_scroll0yhi;
71 	required_shared_ptr<uint8_t> m_scroll1ylo;
72 	required_shared_ptr<uint8_t> m_scroll1yhi;
73 	required_shared_ptr<uint8_t> m_scroll2ylo;
74 	required_shared_ptr<uint8_t> m_scroll2yhi;
75 	required_shared_ptr<uint8_t> m_spriteram;
76 
77 	required_memory_bank m_mainbank;
78 	required_memory_bank m_subbank;
79 
80 	tilemap_t *m_tx_tilemap;
81 	tilemap_t *m_fg_tilemap;
82 	tilemap_t *m_bg_tilemap;
83 
84 	void bankswitch_w(uint8_t data);
85 	void bankswitch1_w(uint8_t data);
86 	void bgvideoram_w(offs_t offset, uint8_t data);
87 	void fgvideoram_w(offs_t offset, uint8_t data);
88 	void txvideoram_w(offs_t offset, uint8_t data);
89 
90 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
91 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
92 	TILE_GET_INFO_MEMBER(get_tx_tile_info);
93 	TILE_GET_INFO_MEMBER(track_get_bg_tile_info);
94 	TILE_GET_INFO_MEMBER(track_get_fg_tile_info);
95 
96 	DECLARE_VIDEO_START(wc90t);
97 
98 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
99 
100 	void sound_map(address_map &map);
101 	void wc90_map_1(address_map &map);
102 	void wc90_map_2(address_map &map);
103 };
104 
105 #endif // MAME_INCLUDES_WC90_H
106