summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/pacman.h
blob: 9ef8d9c4f5091aebf7efae0b134f677c0c1305f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
#include "machine/watchdog.h"
#include "sound/namco.h"

/*************************************************************************

    Namco PuckMan

**************************************************************************/

class pacman_state : public driver_device
{
public:
	pacman_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_namco_sound(*this, "namco")
		, m_watchdog(*this, "watchdog")
		, m_spriteram(*this, "spriteram")
		, m_spriteram2(*this, "spriteram2")
		, m_s2650_spriteram(*this, "s2650_spriteram")
		, m_videoram(*this, "videoram")
		, m_colorram(*this, "colorram")
		, m_s2650games_tileram(*this, "s2650_tileram")
		, m_rocktrv2_prot_data(*this, "rocktrv2_prot")
		, m_gfxdecode(*this, "gfxdecode")
		, m_palette(*this, "palette")
	{ }

	required_device<cpu_device> m_maincpu;

	void _8bpm_portmap(address_map &map);
	void alibaba_map(address_map &map);
	void bigbucks_map(address_map &map);
	void bigbucks_portmap(address_map &map);
	void birdiy_map(address_map &map);
	void crushs_map(address_map &map);
	void crushs_portmap(address_map &map);
	void dremshpr_map(address_map &map);
	void dremshpr_portmap(address_map &map);
	void drivfrcp_portmap(address_map &map);
	void epos_map(address_map &map);
	void epos_portmap(address_map &map);
	void mschamp_map(address_map &map);
	void mschamp_portmap(address_map &map);
	void mspacman_map(address_map &map);
	void nmouse_portmap(address_map &map);
	void numcrash_map(address_map &map);
	void pacman_map(address_map &map);
	void pengojpm_map(address_map &map);
	void piranha_portmap(address_map &map);
	void porky_portmap(address_map &map);
	void rocktrv2_map(address_map &map);
	void s2650games_dataport(address_map &map);
	void s2650games_map(address_map &map);
	void superabc_map(address_map &map);
	void vanvan_portmap(address_map &map);
	void woodpek_map(address_map &map);
	void writeport(address_map &map);
protected:
	optional_device<namco_device> m_namco_sound;
	required_device<watchdog_timer_device> m_watchdog;
	optional_shared_ptr<uint8_t> m_spriteram;
	optional_shared_ptr<uint8_t> m_spriteram2;
	optional_shared_ptr<uint8_t> m_s2650_spriteram;
	required_shared_ptr<uint8_t> m_videoram;
	optional_shared_ptr<uint8_t> m_colorram;
	optional_shared_ptr<uint8_t> m_s2650games_tileram;
	optional_shared_ptr<uint8_t> m_rocktrv2_prot_data;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;

	uint8_t m_cannonb_bit_to_read;
	int m_mystery;
	uint8_t m_counter;
	int m_bigbucks_bank;
	uint8_t m_rocktrv2_question_bank;
	tilemap_t *m_bg_tilemap;
	uint8_t m_charbank;
	uint8_t m_spritebank;
	uint8_t m_palettebank;
	uint8_t m_colortablebank;
	uint8_t m_flipscreen;
	uint8_t m_bgpriority;
	int m_xoffsethack;
	uint8_t m_inv_spr;
	uint8_t m_maketrax_counter;
	uint8_t m_maketrax_offset;
	int m_maketrax_disable_protection;

public:
	uint8_t m_irq_mask;

	DECLARE_WRITE8_MEMBER(pacman_interrupt_vector_w);
	DECLARE_WRITE8_MEMBER(piranha_interrupt_vector_w);
	DECLARE_WRITE8_MEMBER(nmouse_interrupt_vector_w);
	DECLARE_WRITE_LINE_MEMBER(coin_counter_w);
	DECLARE_WRITE_LINE_MEMBER(coin_lockout_global_w);
	DECLARE_WRITE8_MEMBER(alibaba_sound_w);
	DECLARE_READ8_MEMBER(alibaba_mystery_1_r);
	DECLARE_READ8_MEMBER(alibaba_mystery_2_r);
	DECLARE_WRITE8_MEMBER(maketrax_protection_w);
	DECLARE_READ8_MEMBER(mbrush_prot_r);
	DECLARE_READ8_MEMBER(maketrax_special_port2_r);
	DECLARE_READ8_MEMBER(maketrax_special_port3_r);
	DECLARE_READ8_MEMBER(mschamp_kludge_r);
	DECLARE_WRITE8_MEMBER(bigbucks_bank_w);
	DECLARE_READ8_MEMBER(bigbucks_question_r);
	DECLARE_WRITE8_MEMBER(porky_banking_w);
	DECLARE_READ8_MEMBER(drivfrcp_port1_r);
	DECLARE_READ8_MEMBER(_8bpm_port1_r);
	DECLARE_READ8_MEMBER(porky_port1_r);
	DECLARE_READ8_MEMBER(rocktrv2_prot1_data_r);
	DECLARE_READ8_MEMBER(rocktrv2_prot2_data_r);
	DECLARE_READ8_MEMBER(rocktrv2_prot3_data_r);
	DECLARE_READ8_MEMBER(rocktrv2_prot4_data_r);
	DECLARE_WRITE8_MEMBER(rocktrv2_prot_data_w);
	DECLARE_WRITE8_MEMBER(rocktrv2_question_bank_w);
	DECLARE_READ8_MEMBER(rocktrv2_question_r);
	DECLARE_READ8_MEMBER(pacman_read_nop);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x0038);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x03b0);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x1600);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x2120);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x3ff0);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x8000);
	DECLARE_READ8_MEMBER(mspacman_disable_decode_r_0x97f0);
	DECLARE_WRITE8_MEMBER(mspacman_disable_decode_w);
	DECLARE_READ8_MEMBER(mspacman_enable_decode_r_0x3ff8);
	DECLARE_WRITE8_MEMBER(mspacman_enable_decode_w);
	DECLARE_WRITE_LINE_MEMBER(irq_mask_w);
	DECLARE_READ8_MEMBER(mspacii_protection_r);
	DECLARE_READ8_MEMBER(cannonbp_protection_r);
	DECLARE_WRITE8_MEMBER(pacman_videoram_w);
	DECLARE_WRITE8_MEMBER(pacman_colorram_w);
	DECLARE_WRITE_LINE_MEMBER(flipscreen_w);
	DECLARE_WRITE_LINE_MEMBER(pengo_palettebank_w);
	DECLARE_WRITE_LINE_MEMBER(pengo_colortablebank_w);
	DECLARE_WRITE_LINE_MEMBER(pengo_gfxbank_w);
	DECLARE_WRITE8_MEMBER(s2650games_videoram_w);
	DECLARE_WRITE8_MEMBER(s2650games_colorram_w);
	DECLARE_WRITE8_MEMBER(s2650games_scroll_w);
	DECLARE_WRITE8_MEMBER(s2650games_tilesbank_w);
	DECLARE_WRITE8_MEMBER(jrpacman_videoram_w);
	DECLARE_WRITE_LINE_MEMBER(jrpacman_charbank_w);
	DECLARE_WRITE_LINE_MEMBER(jrpacman_spritebank_w);
	DECLARE_WRITE8_MEMBER(jrpacman_scroll_w);
	DECLARE_WRITE_LINE_MEMBER(jrpacman_bgpriority_w);
	DECLARE_WRITE8_MEMBER(superabc_bank_w);
	void init_maketrax();
	void init_drivfrcp();
	void init_mspacmbe();
	void init_ponpoko();
	void init_eyes();
	void init_woodpek();
	void init_cannonbp();
	void init_jumpshot();
	void init_mspacii();
	void init_pacplus();
	void init_rocktrv2();
	void init_superabc();
	void init_8bpm();
	void init_porky();
	void init_mspacman();
	void init_mschamp();
	void init_mbrush();
	TILEMAP_MAPPER_MEMBER(pacman_scan_rows);
	TILE_GET_INFO_MEMBER(pacman_get_tile_info);
	TILE_GET_INFO_MEMBER(s2650_get_tile_info);
	TILEMAP_MAPPER_MEMBER(jrpacman_scan_rows);
	TILE_GET_INFO_MEMBER(jrpacman_get_tile_info);
	DECLARE_VIDEO_START(pacman);
	DECLARE_PALETTE_INIT(pacman);
	DECLARE_VIDEO_START(birdiy);
	DECLARE_VIDEO_START(s2650games);
	DECLARE_MACHINE_RESET(mschamp);
	DECLARE_MACHINE_RESET(superabc);
	DECLARE_MACHINE_RESET(maketrax);
	DECLARE_VIDEO_START(pengo);
	DECLARE_VIDEO_START(jrpacman);
	uint32_t screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_s2650games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
	INTERRUPT_GEN_MEMBER(periodic_irq);
	DECLARE_WRITE_LINE_MEMBER(rocktrv2_vblank_irq);
	DECLARE_WRITE_LINE_MEMBER(vblank_nmi);
	DECLARE_WRITE_LINE_MEMBER(s2650_interrupt);

private:
	void init_save_state();
	void jrpacman_mark_tile_dirty( int offset );
	void eyes_decode(uint8_t *data);
	void mspacman_install_patches(uint8_t *ROM);

public:
	// epos.c
	DECLARE_READ8_MEMBER(epos_decryption_w);
	DECLARE_MACHINE_START(theglobp);
	DECLARE_MACHINE_RESET(theglobp);
	DECLARE_MACHINE_START(eeekk);
	DECLARE_MACHINE_RESET(eeekk);
	DECLARE_MACHINE_START(acitya);
	DECLARE_MACHINE_RESET(acitya);

	void birdiy(machine_config &config);
	void rocktrv2(machine_config &config);
	void mspacman(machine_config &config);
	void dremshpr(machine_config &config);
	void mschamp(machine_config &config);
	void acitya(machine_config &config);
	void theglobp(machine_config &config);
	void nmouse(machine_config &config);
	void vanvan(machine_config &config);
	void s2650games(machine_config &config);
	void woodpek(machine_config &config);
	void crushs(machine_config &config);
	void eeekk(machine_config &config);
	void superabc(machine_config &config);
	void numcrash(machine_config &config);
	void crush4(machine_config &config);
	void bigbucks(machine_config &config);
	void porky(machine_config &config);
	void pacman(machine_config &config);
	void _8bpm(machine_config &config);
	void maketrax(machine_config &config);
	void korosuke(machine_config &config);
	void alibaba(machine_config &config);
	void drivfrcp(machine_config &config);
	void pengojpm(machine_config &config);
	void piranha(machine_config &config);

private:
	// pacplus.c
	uint8_t pacplus_decrypt(int addr, uint8_t e);
	void pacplus_decode();

	// jumpshot.c
	uint8_t jumpshot_decrypt(int addr, uint8_t e);
	void jumpshot_decode();
};