1 /***************************************************************************
2 
3 	Beast Busters			A9003	(c) 1989 SNK Corporation
4 	Mechanized Attack			A8002	(c) 1989 SNK Corporation
5 
6 	Beast Busters is a large dedicated (non-jamma) triple machine gun game,
7 	the gun positions values are read in an interrupt routine that must be
8 	called for each position (X and Y for 3 guns, so at least 6 times a
9 	frame).  However I can't make it work reliably..  So for the moment
10 	I'm writing the gun positions directly to memory and bypassing
11 	the IRQ routine.
12 
13 	Mechanized Attack (A8002) is an earlier design, it only has one sprite
14 	chip, no eeprom, and only 2 machine guns, but the tilemaps are twice
15 	the size.
16 
17 	Emulation by Bryan McPhail, mish@tendril.co.uk
18 
19 
20 Stephh's notes (based on the games M68000 code and some tests) :
21 
22 1) 'bbusters'
23 
24   - Country/version is stored at 0x003954.w and the possible values are
25     0x0000, 0x0004 and 0x0008 (0x000c being the same as 0x0008), 0x0008
26     being the value stored in ROM in the current set.
27     I haven't noticed any major effect (copyright/logo, language, coinage),
28     the only thing I found is that the text relative to number of coins
29     needed is different (but it's a lie as coinage is NOT modified).
30     So my guess is that if other versions exist, part of the code (or at
31     least data in it) will have to be different.
32     Anyway, here is my guess to determine the versions (by using some infos
33     from 'mechatt' :
34 
35        Value   Country
36       0x0000    Japan
37       0x0004    US?
38       0x0008    World?   (value stored in the current set)
39       0x000c    World?   (same as 0x0008 - impossible choice ?)
40 
41   - Coin buttons act differently depending on the "Coin Slots" Dip Switch :
42 
43       * "Coin Slots" Dip Switch set to "Common" :
44 
45           . COIN1    : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
46           . COIN2    : adds coin(s)/credit(s) depending on "Coin B" Dip Switch
47           . COIN3    : NO EFFECT !
48           . COIN4    : NO EFFECT !
49           . COIN5    : NO EFFECT !
50           . COIN6    : NO EFFECT !
51           . SERVICE1 : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
52 
53       * "Coin Slots" Dip Switch set to "Individual" :
54 
55           . COIN1    : adds coin(s)/credit(s) for player 1 depending on "Coin A" Dip Switch
56           . COIN2    : adds coin(s)/credit(s) for player 1 depending on "Coin B" Dip Switch
57           . COIN3    : adds coin(s)/credit(s) for player 2 depending on "Coin A" Dip Switch
58           . COIN4    : adds coin(s)/credit(s) for player 2 depending on "Coin B" Dip Switch
59           . COIN5    : adds coin(s)/credit(s) for player 3 depending on "Coin A" Dip Switch
60           . COIN6    : adds coin(s)/credit(s) for player 3 depending on "Coin B" Dip Switch
61           . SERVICE1 : adds coin(s)/credit(s) for all players depending on "Coin A" Dip Switch
62 
63     Note that I had to map COIN5 and COIN6 to SERVICE2 and SERVICE3 to be
64     able to use the default parametrable keys. Let me know if there is a
65     another (better ?) way to do so.
66 
67 
68 2) 'mechatt'
69 
70   - Country/version is stored at 0x06a000.w and the possible values are :
71 
72        Value   Country
73       0x0000    Japan
74       0x1111    World    (value stored in the current set)
75       0x2222    US
76       0x3333    Asia?    (it looks like Japanese text but some "symbols" are missing)
77 
78 2a) Japan version
79 
80   - All texts are in Japanese.
81   - "(c) 1989 (Corp) S-N-K".
82   - "Coin Slots" Dip Switch has no effect.
83   - "Coin A" and "Coin B" Dip Switches are the same as in the World version.
84   - Coin buttons effect :
85 
86       * "Coin Slots" are ALWAYS considered as "Common" :
87 
88           . COIN1    : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
89           . COIN2    : adds coin(s)/credit(s) depending on "Coin B" Dip Switch
90           . COIN3    : NO EFFECT !
91           . COIN4    : NO EFFECT !
92           . SERVICE1 : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
93 
94 2b) World version
95 
96   - All texts are in English.
97   - "(c) 1989 SNK Corporation".
98   - Coin buttons effect :
99 
100       * "Coin Slots" Dip Switch set to "Common" :
101 
102           . COIN1    : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
103           . COIN2    : adds coin(s)/credit(s) depending on "Coin B" Dip Switch
104           . COIN3    : NO EFFECT !
105           . COIN4    : NO EFFECT !
106           . SERVICE1 : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
107 
108       * "Coin Slots" Dip Switch set to "Individual" :
109 
110           . COIN1    : adds coin(s)/credit(s) for player 1 depending on "Coin A" Dip Switch
111           . COIN2    : adds coin(s)/credit(s) for player 1 depending on "Coin B" Dip Switch
112           . COIN3    : adds coin(s)/credit(s) for player 2 depending on "Coin A" Dip Switch
113           . COIN4    : adds coin(s)/credit(s) for player 2 depending on "Coin B" Dip Switch
114           . SERVICE1 : adds coin(s)/credit(s) for all players depending on "Coin A" Dip Switch
115 
116 2c) US version
117 
118   - All texts are in English.
119   - "(c) 1989 SNK Corp. of America".
120   - Additional FBI logo as first screen as well as small FBI notice at the bottom left
121     of the screens until a coin is inserted.
122   - "Coin Slots" Dip Switch has no effect.
123   - "Coin A" Dip Switch is different from the World version :
124 
125       World      US
126       4C_1C    "Free Play"
127       3C_1C    special (see below)
128       2C_1C    "2 Coins to Start, 1 to Continue"
129       1C_1C    1C_1C
130 
131     It's a bit hard to explain the "special" coinage, so here are some infos :
132 
133       * when you insert a coin before starting a game, you are awarded 2 credits
134         if credits == 0, else you are awarded 1 credit
135       * when you insert a coin to continue, you are ALWAYS awarded 1 credit
136 
137   - "Coin B" Dip Switch has no effect.
138 
139   - Coin buttons effect :
140 
141       * "Coin Slots" are ALWAYS considered as "Individual" :
142 
143           . COIN1    : adds coin(s)/credit(s) for player 1 depending on "Coin A" Dip Switch
144           . COIN2    : adds coin(s)/credit(s) for player 2 depending on "Coin A" Dip Switch
145           . COIN3    : NO EFFECT !
146           . COIN4    : NO EFFECT !
147           . SERVICE1 : adds coin(s)/credit(s) for all players depending on "Coin A" Dip Switch
148 
149 2d) Asia? version
150 
151   - All texts are in Japanese ? (to be confirmed)
152   - "(c) 1989 SNK Corporation".
153   - "Coin Slots" Dip Switch has no effect.
154   - "Coin A" and "Coin B" Dip Switches are the same as in the World version.
155   - Coin buttons effect :
156 
157       * "Coin Slots" are ALWAYS considered as "Common" :
158 
159           . COIN1    : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
160           . COIN2    : adds coin(s)/credit(s) depending on "Coin B" Dip Switch
161           . COIN3    : NO EFFECT !
162           . COIN4    : NO EFFECT !
163           . SERVICE1 : adds coin(s)/credit(s) depending on "Coin A" Dip Switch
164 
165 ***************************************************************************/
166 
167 #include "driver.h"
168 #include "vidhrdw/generic.h"
169 
170 #define BBUSTERS_HACK	0
171 #define MECHATT_HACK	0
172 
173 VIDEO_START( bbuster );
174 VIDEO_START( mechatt );
175 VIDEO_UPDATE( bbuster );
176 VIDEO_UPDATE( mechatt );
177 
178 static data16_t *bbuster_ram, *eprom_data;
179 extern data16_t *bbuster_pf1_data,*bbuster_pf2_data,*bbuster_pf1_scroll_data,*bbuster_pf2_scroll_data;
180 
181 WRITE16_HANDLER( bbuster_pf1_w );
182 WRITE16_HANDLER( bbuster_pf2_w );
183 WRITE16_HANDLER( bbuster_video_w );
184 
185 /******************************************************************************/
186 
187 #if BBUSTERS_HACK
MACHINE_INIT(bbusters)188 static MACHINE_INIT( bbusters )
189 {
190 	data16_t *RAM = (data16_t *)memory_region(REGION_CPU1);
191 	int data = readinputport(11) & 0x03;
192 
193 	/* Country/Version :
194 	     - 0x0000 : Japan?
195            - 0x0004 : US?
196            - 0x0008 : World?	(default)
197            - 0x000c : World?	(same as 0x0008)
198 	*/
199 
200 	RAM[0x003954/2] = data * 4;
201 
202 /*	memset (eprom_data, 0xff, 0x80);	*/ /* Force EEPROM reset*/
203 }
204 #endif
205 
206 #if MECHATT_HACK
MACHINE_INIT(mechatt)207 static MACHINE_INIT( mechatt )
208 {
209 	data16_t *RAM = (data16_t *)memory_region(REGION_CPU1);
210 	int data = readinputport(6) & 0x03;
211 
212 	/* Country :
213 	     - 0x0000 : Japan
214            - 0x1111 : World	(default)
215            - 0x2222 : US
216            - 0x3333 : Asia?
217 	*/
218 
219 	RAM[0x06a000/2] = (data << 12) | (data << 8) | (data << 4) | (data << 0);
220 }
221 #endif
222 
223 /******************************************************************************/
224 
READ16_HANDLER(sound_cpu_r)225 static READ16_HANDLER( sound_cpu_r )
226 {
227 	return 0x01;
228 }
229 
230 /* Eprom is byte wide, top half of word _must_ be 0xff */
READ16_HANDLER(eprom_r)231 static READ16_HANDLER( eprom_r )
232 {
233 	return (eprom_data[offset]&0xff) | 0xff00;
234 }
235 
236 static int gun_select;
237 
READ16_HANDLER(control_3_r)238 static READ16_HANDLER( control_3_r )
239 {
240 	return readinputport(gun_select);
241 }
242 
WRITE16_HANDLER(gun_select_w)243 static WRITE16_HANDLER( gun_select_w )
244 {
245 	log_cb(RETRO_LOG_DEBUG, LOGPRE "%08x: gun r\n",activecpu_get_pc());
246 
247 	gun_select=5 + (data&0xff);
248 }
249 
READ16_HANDLER(kludge_r)250 static READ16_HANDLER( kludge_r )
251 {
252 	bbuster_ram[0xa692/2]=readinputport(5)<<1;
253 	bbuster_ram[0xa694/2]=readinputport(6)<<1;
254 	bbuster_ram[0xa696/2]=readinputport(7)<<1;
255 	bbuster_ram[0xa698/2]=readinputport(8)<<1;
256 	bbuster_ram[0xa69a/2]=readinputport(9)<<1;
257 	bbuster_ram[0xa69c/2]=readinputport(10)<<1;
258 	return 0;
259 }
260 
WRITE16_HANDLER(sound_cpu_w)261 static WRITE16_HANDLER( sound_cpu_w )
262 {
263 	soundlatch_w(0,data&0xff);
264 	cpu_set_irq_line(1,IRQ_LINE_NMI,PULSE_LINE);
265 }
266 
READ16_HANDLER(mechatt_gun_r)267 static READ16_HANDLER( mechatt_gun_r )
268 {
269 	int baseport=2,x,y;
270 	if (offset) baseport=4; /* Player 2 */
271 
272 	x=readinputport(baseport);
273 	y=readinputport(baseport+1);
274 
275 	/* Todo - does the hardware really clamp like this? */
276 	x+=0x18;
277 	if (x>0xff) x=0xff;
278 	if (y>0xef) y=0xef;
279 
280 	return x|(y<<8);
281 }
282 
283 /*******************************************************************************/
284 
MEMORY_READ16_START(bbuster_readmem)285 static MEMORY_READ16_START( bbuster_readmem )
286 	{ 0x000000, 0x07ffff, MRA16_ROM },
287 	{ 0x080000, 0x08ffff, MRA16_RAM },
288 	{ 0x090000, 0x090fff, MRA16_RAM },
289 	{ 0x0a0000, 0x0a0fff, MRA16_RAM },
290 	{ 0x0a8000, 0x0a8fff, MRA16_RAM },
291 	{ 0x0b0000, 0x0b1fff, MRA16_RAM },
292 	{ 0x0b2000, 0x0b3fff, MRA16_RAM },
293 	{ 0x0d0000, 0x0d0fff, MRA16_RAM },
294 	{ 0x0e0000, 0x0e0001, input_port_2_word_r }, /* Coins */
295 	{ 0x0e0002, 0x0e0003, input_port_0_word_r }, /* Player 1 & 2 */
296 	{ 0x0e0004, 0x0e0005, input_port_1_word_r }, /* Player 3 */
297 	{ 0x0e0008, 0x0e0009, input_port_3_word_r }, /* Dip 1 */
298 	{ 0x0e000a, 0x0e000b, input_port_4_word_r }, /* Dip 2 */
299 	{ 0x0e0018, 0x0e0019, sound_cpu_r },
300 	{ 0x0e8000, 0x0e8001, kludge_r },
301 	{ 0x0e8002, 0x0e8003, control_3_r },
302 	{ 0x0f8000, 0x0f80ff, eprom_r }, /* Eeprom */
303 MEMORY_END
304 
305 static MEMORY_WRITE16_START( bbuster_writemem )
306 	{ 0x000000, 0x07ffff, MWA16_ROM },
307 	{ 0x080000, 0x08ffff, MWA16_RAM, &bbuster_ram },
308 	{ 0x090000, 0x090fff, bbuster_video_w, &videoram16 },
309 	{ 0x0a0000, 0x0a0fff, MWA16_RAM, &spriteram16, &spriteram_size },
310 	{ 0x0a8000, 0x0a8fff, MWA16_RAM, &spriteram16_2, &spriteram_2_size },
311 	{ 0x0b0000, 0x0b1fff, bbuster_pf1_w, &bbuster_pf1_data },
312 	{ 0x0b2000, 0x0b3fff, bbuster_pf2_w, &bbuster_pf2_data },
313 	{ 0x0b8000, 0x0b8003, MWA16_RAM, &bbuster_pf1_scroll_data },
314 	{ 0x0b8008, 0x0b800b, MWA16_RAM, &bbuster_pf2_scroll_data },
315 	{ 0x0d0000, 0x0d0fff, paletteram16_RRRRGGGGBBBBxxxx_word_w, &paletteram16 },
316 	{ 0x0e8000, 0x0e8001, gun_select_w },
317 	{ 0x0f0008, 0x0f0009, MWA16_NOP },
318 	{ 0x0f0018, 0x0f0019, sound_cpu_w },
319 	{ 0x0f8000, 0x0f80ff, MWA16_RAM, &eprom_data }, /* Eeprom */
320 MEMORY_END
321 
322 /*******************************************************************************/
323 
324 static MEMORY_READ16_START( mechatt_readmem )
325 	{ 0x000000, 0x06ffff, MRA16_ROM },
326 	{ 0x070000, 0x07ffff, MRA16_RAM },
327 	{ 0x090000, 0x090fff, MRA16_RAM },
328 	{ 0x0a0000, 0x0a0fff, MRA16_RAM },
329 	{ 0x0b0000, 0x0b3fff, MRA16_RAM },
330 	{ 0x0c0000, 0x0c3fff, MRA16_RAM },
331 	{ 0x0d0000, 0x0d07ff, MRA16_RAM },
332 	{ 0x0e0000, 0x0e0001, input_port_0_word_r },
333 	{ 0x0e0002, 0x0e0003, input_port_1_word_r },
334 	{ 0x0e0004, 0x0e0007, mechatt_gun_r },
335 	{ 0x0e8000, 0x0e8001, sound_cpu_r },
336 MEMORY_END
337 
338 static MEMORY_WRITE16_START( mechatt_writemem )
339 	{ 0x000000, 0x06ffff, MWA16_ROM },
340 	{ 0x070000, 0x07ffff, MWA16_RAM, &bbuster_ram },
341 	{ 0x090000, 0x090fff, bbuster_video_w, &videoram16 },
342 	{ 0x0a0000, 0x0a0fff, MWA16_RAM, &spriteram16, &spriteram_size },
343 	{ 0x0a1000, 0x0a7fff, MWA16_NOP },
344 	{ 0x0b0000, 0x0b3fff, bbuster_pf1_w, &bbuster_pf1_data },
345 	{ 0x0b8000, 0x0b8003, MWA16_RAM, &bbuster_pf1_scroll_data },
346 	{ 0x0c0000, 0x0c3fff, bbuster_pf2_w, &bbuster_pf2_data },
347 	{ 0x0c8000, 0x0c8003, MWA16_RAM, &bbuster_pf2_scroll_data },
348 	{ 0x0d0000, 0x0d07ff, paletteram16_RRRRGGGGBBBBxxxx_word_w, &paletteram16 },
349 	{ 0x0e4002, 0x0e4003, MWA16_NOP }, /* Gun force feedback? */
350 	{ 0x0e8000, 0x0e8001, sound_cpu_w },
351 MEMORY_END
352 
353 /******************************************************************************/
354 
355 static MEMORY_READ_START( sound_readmem )
356 	{ 0x0000, 0xefff, MRA_ROM },
357 	{ 0xf000, 0xf7ff, MRA_RAM },
358 	{ 0xf800, 0xf800, soundlatch_r },
359 MEMORY_END
360 
361 static MEMORY_WRITE_START( sound_writemem )
362 	{ 0x0000, 0xefff, MWA_ROM },
363 	{ 0xf000, 0xf7ff, MWA_RAM },
364 MEMORY_END
365 
366 static PORT_READ_START( sound_readport )
367 	{ 0x00, 0x00, YM2610_status_port_0_A_r },
368 	{ 0x02, 0x02, YM2610_status_port_0_B_r },
369 MEMORY_END
370 
371 static PORT_WRITE_START( sound_writeport )
372 	{ 0x00, 0x00, YM2610_control_port_0_A_w },
373 	{ 0x01, 0x01, YM2610_data_port_0_A_w },
374 	{ 0x02, 0x02, YM2610_control_port_0_B_w },
375 	{ 0x03, 0x03, YM2610_data_port_0_B_w },
376 	{ 0xc0, 0xc1, MWA_NOP }, /* -> Main CPU */
377 MEMORY_END
378 
379 static PORT_READ_START( sounda_readport )
380 	{ 0x00, 0x00, YM2608_status_port_0_A_r },
381 	{ 0x02, 0x02, YM2608_status_port_0_B_r },
382 MEMORY_END
383 
384 static PORT_WRITE_START( sounda_writeport )
385 	{ 0x00, 0x00, YM2608_control_port_0_A_w },
386 	{ 0x01, 0x01, YM2608_data_port_0_A_w },
387 	{ 0x02, 0x02, YM2608_control_port_0_B_w },
388 	{ 0x03, 0x03, YM2608_data_port_0_B_w },
389 	{ 0xc0, 0xc1, MWA_NOP }, /* -> Main CPU */
390 MEMORY_END
391 
392 /******************************************************************************/
393 
394 INPUT_PORTS_START( bbusters )
395 	PORT_START	/* Player controls */
396 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
397 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )		/* "Fire"*/
398 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )		/* "Grenade"*/
399 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
400 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
401 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )		/* "Fire"*/
402 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )		/* "Grenade"*/
403 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
404 
405 	PORT_START	/* Player controls */
406 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
407 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )		/* "Fire"*/
408 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )		/* "Grenade"*/
409 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
410 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
411 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
412 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
413 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
414 
415 	PORT_START
416 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
417 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
418 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
419 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
420 	PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_SERVICE2, "Coin 5", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
421 	PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_SERVICE3, "Coin 6", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
422 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )		/* See notes*/
423 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
424 
425 	PORT_START	/* Dip switch bank 1 */
426 	PORT_DIPNAME( 0x01, 0x01, "Allow Continue" )
427 	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
428 	PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
429 	PORT_DIPNAME( 0x06, 0x06, "Magazine / Grenade" )
430 	PORT_DIPSETTING(    0x04, "5 / 2" )
431 	PORT_DIPSETTING(    0x06, "7 / 3" )
432 	PORT_DIPSETTING(    0x02, "9 / 4" )
433 	PORT_DIPSETTING(    0x00, "12 / 5" )
434 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_A ) )
435 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
436 	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
437 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
438 	PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
439 	PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_B ) )
440 	PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
441 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
442 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
443 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
444 	PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )			/* See notes*/
445 	PORT_DIPSETTING(    0x80, "Common" )
446 	PORT_DIPSETTING(    0x00, "Individual" )
447 
448 	PORT_START	/* Dip switch bank 2 */
449 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
450 	PORT_DIPSETTING(    0x02, "Easy" )
451 	PORT_DIPSETTING(    0x03, "Normal" )
452 	PORT_DIPSETTING(    0x01, "Hard" )
453 	PORT_DIPSETTING(    0x00, "Hardest" )
454 	PORT_BITX( 0,       0x04, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite Energy", IP_KEY_NONE, IP_JOY_NONE )
455 	PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
456 	PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
457 	PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
458 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
459 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
460 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
462 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
463 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
464 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
465 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
466 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467  	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
468 
469 	PORT_START
470 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER1, 25, 10, 0, 255 )
471 	PORT_START
472 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER1, 25, 10, 0, 255 )
473 
474 	PORT_START
475 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER2, 25, 10, 0, 255 )
476 	PORT_START
477 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER2, 25, 10, 0, 255 )
478 
479 	PORT_START
480 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER3, 25, 10, 0, 255 )
481 	PORT_START
482 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER3, 25, 10, 0, 255 )
483 
484 #if BBUSTERS_HACK
485 	PORT_START
486 	PORT_DIPNAME( 0x03, 0x02, "Country/Version" )
487 	PORT_DIPSETTING(    0x00, "Japan?" )
488 	PORT_DIPSETTING(    0x01, "US?" )
489 	PORT_DIPSETTING(    0x02, "World?" )
490 /*	PORT_DIPSETTING(    0x03, "World?" )			*/ /* Same as "0008" - impossible choice ?*/
491 #endif
492 INPUT_PORTS_END
493 
494 INPUT_PORTS_START( mechatt )
495 	PORT_START
496 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
497 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
498 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )		/* See notes*/
499 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
500 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN3 )
501 	PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN4 )
502 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
503 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
504 	PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
505 	PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )	/* "Fire"*/
506 	PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )	/* "Grenade"*/
507 	PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
508 	PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START2 )
509 	PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )	/* "Fire"*/
510 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )	/* "Grenade"*/
511 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
512 
513 	PORT_START	/* Dip switch bank 1 */
514 	PORT_DIPNAME( 0x0001, 0x0001, "Coin Slots" )		/* See notes*/
515 	PORT_DIPSETTING(      0x0001, "Common" )
516 	PORT_DIPSETTING(      0x0000, "Individual" )
517 	PORT_DIPNAME( 0x0002, 0x0002, "Allow Continue" )
518 	PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
519 	PORT_DIPSETTING(      0x0002, DEF_STR( Yes ) )
520 	PORT_DIPNAME( 0x000c, 0x000c, "Magazine / Grenade" )
521 	PORT_DIPSETTING(      0x0008, "5 / 2" )
522 	PORT_DIPSETTING(      0x000c, "6 / 3" )
523 	PORT_DIPSETTING(      0x0004, "7 / 4" )
524 	PORT_DIPSETTING(      0x0000, "8 / 5" )
525 	PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Coin_A ) )	/* See notes*/
526 	PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
527 	PORT_DIPSETTING(      0x0010, DEF_STR( 3C_1C ) )
528 	PORT_DIPSETTING(      0x0020, DEF_STR( 2C_1C ) )
529 	PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )
530 	PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Coin_B ) )	/* See notes*/
531 	PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_1C ) )
532 	PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
533 	PORT_DIPSETTING(      0x0040, DEF_STR( 1C_3C ) )
534 	PORT_DIPSETTING(      0x0000, DEF_STR( 1C_4C ) )
535 	PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
536 	PORT_DIPSETTING(      0x0200, "Easy" )
537 	PORT_DIPSETTING(      0x0300, "Normal" )
538 	PORT_DIPSETTING(      0x0100, "Hard" )
539 	PORT_DIPSETTING(      0x0000, "Hardest" )
540 	PORT_BITX( 0,         0x0400, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite Energy", IP_KEY_NONE, IP_JOY_NONE )
541 	PORT_DIPNAME( 0x0c00, 0x0c00, "Game Mode" )
542 	PORT_DIPSETTING(      0x0800, "Demo Sounds Off" )
543 	PORT_DIPSETTING(      0x0c00, "Demo Sounds On" )
544 	PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )
545 	PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
546 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
547 	PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )
548 	PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
549 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
550 	PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )
551 	PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
552 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
553  	PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
554 
555 	PORT_START
556 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER1, 25, 10, 0, 255 )
557 	PORT_START
558 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER1, 25, 10, 0, 255 )
559 
560 	PORT_START
561 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_X | IPF_PLAYER2, 25, 10, 0, 255 )
562 	PORT_START
563 	PORT_ANALOG( 0xff, 0x80, IPT_LIGHTGUN_Y | IPF_PLAYER2, 25, 10, 0, 255 )
564 
565 #if MECHATT_HACK
566 	PORT_START
567 	PORT_DIPNAME( 0x03, 0x01, "Country" )
568 	PORT_DIPSETTING(    0x00, "Japan" )
569 	PORT_DIPSETTING(    0x01, "World" )
570 	PORT_DIPSETTING(    0x02, "US" )
571 	PORT_DIPSETTING(    0x03, "Asia?" )
572 #endif
573 INPUT_PORTS_END
574 
575 /******************************************************************************/
576 
577 static struct GfxLayout charlayout =
578 {
579 	8,8,
580 	RGN_FRAC(1,1),
581 	4,
582 	{ 0, 1, 2, 3 },
583 	{ 0,4,8,12,16,20,24,28 },
584 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
585 	32*8
586 };
587 
588 static struct GfxLayout spritelayout =
589 {
590 	16,16,
591 	RGN_FRAC(1,1),
592 	4,
593 	{ 8, 12, 0, 4 },
594 	{
595 		0, 1, 2, 3,
596 		16,17,18,19,
597 
598 		0+32*8, 1+32*8, 2+32*8, 3+32*8,
599 		16+32*8,17+32*8,18+32*8,19+32*8,
600 	},
601 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
602 			16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
603 	128*8
604 };
605 
606 static struct GfxLayout tilelayout =
607 {
608 	16,16,	/* 16*16 sprites */
609 	RGN_FRAC(1,1),
610 	4,	/* 4 bits per pixel */
611 	{ 0, 1, 2, 3 },
612 	{ 0, 4, 8, 12, 16, 20, 24, 28,
613 		0+64*8, 4+64*8, 8+64*8, 12+64*8,
614 		16+64*8,20+64*8,24+64*8,28+64*8,
615 	},
616 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
617 		8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
618 	128*8
619 };
620 
621 static struct GfxDecodeInfo gfxdecodeinfo[] =
622 {
623 	{ REGION_GFX1, 0, &charlayout,     0, 16 },
624 	{ REGION_GFX2, 0, &spritelayout, 256, 16 },
625 	{ REGION_GFX3, 0, &spritelayout, 512, 16 },
626 	{ REGION_GFX4, 0, &tilelayout,   768, 16 },
627 	{ REGION_GFX5, 0, &tilelayout,  1024+256, 16 },
628 	{ -1 } /* end of array */
629 };
630 
631 static struct GfxDecodeInfo gfxdecodeinfo_mechatt[] =
632 {
633 	{ REGION_GFX1, 0, &charlayout,     0, 16 },
634 	{ REGION_GFX2, 0, &spritelayout, 256, 16 },
635 	{ REGION_GFX3, 0, &spritelayout, 512, 16 },
636 	{ REGION_GFX4, 0, &tilelayout,   512, 16 },
637 	{ REGION_GFX5, 0, &tilelayout,   768, 16 },
638 	{ -1 } /* end of array */
639 };
640 
641 /******************************************************************************/
642 
sound_irq(int irq)643 static void sound_irq( int irq )
644 {
645 	cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
646 }
647 
648 static struct YM2608interface ym2608_interface =
649 {
650 	1,
651 	8000000,	/* 8 MHz */
652 	{ 50 },
653 	{ 0 },
654 	{ 0 },
655 	{ 0 },
656 	{ 0 },
657 	{ sound_irq },
658 	{ REGION_SOUND1 },
659 	{ YM3012_VOL(100,MIXER_PAN_LEFT,100,MIXER_PAN_RIGHT) }
660 };
661 
662 struct YM2610interface ym2610_interface =
663 {
664 	1,
665 	8000000,
666 	{ MIXERG(15,MIXER_GAIN_4x,MIXER_PAN_CENTER) },
667 	{ 0 },
668 	{ 0 },
669 	{ 0 },
670 	{ 0 },
671 	{ sound_irq },
672 	{ REGION_SOUND2 },
673 	{ REGION_SOUND1 },
674 	{ YM3012_VOL(20,MIXER_PAN_LEFT,20,MIXER_PAN_RIGHT) }
675 };
676 
677 /******************************************************************************/
678 
NVRAM_HANDLER(bbusters)679 static NVRAM_HANDLER( bbusters )
680 {
681 	if( read_or_write ) {
682 		mame_fwrite (file, eprom_data, 0x80);
683 	}
684 	else {
685 		if (file)
686 			mame_fread (file, eprom_data, 0x80);
687 		else
688 			memset (eprom_data, 0xff, 0x80);
689 	}
690 }
691 
INTERRUPT_GEN(bbuster)692 static INTERRUPT_GEN( bbuster )
693 {
694 	if (cpu_getiloops()==0)
695 		cpu_set_irq_line(0, 6, HOLD_LINE); /* VBL */
696 	else
697 		cpu_set_irq_line(0, 2, HOLD_LINE); /* at least 6 interrupts per frame to read gun controls */
698 }
699 
VIDEO_EOF(bbuster)700 static VIDEO_EOF( bbuster )
701 {
702 	buffer_spriteram16_w(0,0,0);
703 	buffer_spriteram16_2_w(0,0,0);
704 }
705 
VIDEO_EOF(mechatt)706 static VIDEO_EOF( mechatt )
707 {
708 	buffer_spriteram16_w(0,0,0);
709 }
710 
711 static MACHINE_DRIVER_START( bbusters )
712 
713 	/* basic machine hardware */
714 	MDRV_CPU_ADD(M68000, 12000000)
MDRV_CPU_MEMORY(bbuster_readmem,bbuster_writemem)715 	MDRV_CPU_MEMORY(bbuster_readmem,bbuster_writemem)
716 	MDRV_CPU_VBLANK_INT(bbuster,4)
717 
718 	MDRV_CPU_ADD(Z80,4000000) /* Accurate */
719 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
720 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
721 	MDRV_CPU_PORTS(sound_readport,sound_writeport)
722 
723 	MDRV_FRAMES_PER_SECOND(60)
724 
725 #if BBUSTERS_HACK
726 	MDRV_MACHINE_INIT(bbusters)
727 #endif
728 
729 	MDRV_NVRAM_HANDLER(bbusters)
730 
731 	/* video hardware */
732 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM)
733 	MDRV_SCREEN_SIZE(32*8, 32*8)
734 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
735 	MDRV_GFXDECODE(gfxdecodeinfo)
736 	MDRV_PALETTE_LENGTH(2048)
737 
738 	MDRV_VIDEO_START(bbuster)
739 	MDRV_VIDEO_UPDATE(bbuster)
740 	MDRV_VIDEO_EOF(bbuster)
741 
742 	/* sound hardware */
743 	MDRV_SOUND_ADD(YM2610, ym2610_interface)
744 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
745 MACHINE_DRIVER_END
746 
747 static MACHINE_DRIVER_START( mechatt )
748 
749 	/* basic machine hardware */
750 	MDRV_CPU_ADD(M68000, 12000000)
751 	MDRV_CPU_MEMORY(mechatt_readmem,mechatt_writemem)
752 	MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
753 
754 	MDRV_CPU_ADD(Z80,4000000) /* Accurate */
755 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
756 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
757 	MDRV_CPU_PORTS(sounda_readport,sounda_writeport)
758 
759 	MDRV_FRAMES_PER_SECOND(60)
760 
761 #if MECHATT_HACK
762 	MDRV_MACHINE_INIT(mechatt)
763 #endif
764 
765 	/* video hardware */
766 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_BUFFERS_SPRITERAM)
767 	MDRV_SCREEN_SIZE(32*8, 32*8)
768 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
769 	MDRV_GFXDECODE(gfxdecodeinfo_mechatt)
770 	MDRV_PALETTE_LENGTH(1024)
771 
772 	MDRV_VIDEO_START(mechatt)
773 	MDRV_VIDEO_UPDATE(mechatt)
774 	MDRV_VIDEO_EOF(mechatt)
775 
776 	/* sound hardware */
777 	MDRV_SOUND_ADD(YM2608, ym2608_interface)
778 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
779 MACHINE_DRIVER_END
780 
781 /******************************************************************************/
782 
783 ROM_START( bbusters )
784 	ROM_REGION( 0x80000, REGION_CPU1, 0 )
785 	ROM_LOAD16_BYTE( "bb-3.k10",   0x000000, 0x20000, CRC(04da1820) SHA1(0b6e06adf9c181d7aef28f781efbdd2c225fe81e) )
786 	ROM_LOAD16_BYTE( "bb-5.k12",   0x000001, 0x20000, CRC(777e0611) SHA1(b7ac0c6ea3738d560a5be75aed286821de918808) )
787 	ROM_LOAD16_BYTE( "bb-2.k8",    0x040000, 0x20000, CRC(20141805) SHA1(0958579681bda81bcf48d020a14bc147c1e575f1) )
788 	ROM_LOAD16_BYTE( "bb-4.k11",   0x040001, 0x20000, CRC(d482e0e9) SHA1(e56ca92965e8954b613ba4b0e3975e3a12840c30) )
789 
790 	ROM_REGION( 0x10000, REGION_CPU2, 0 )
791 	ROM_LOAD( "bb-1.e6",     0x000000, 0x10000, CRC(4360f2ee) SHA1(4c6b212f59389bdf4388893d2030493b110ac087) )
792 
793 	ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE )
794 	ROM_LOAD( "bb-10.l9",    0x000000, 0x20000, CRC(490c0d9b) SHA1(567c25a6d96407259c64061d674305e4117d9fa4) )
795 
796 	ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
797 	ROM_LOAD( "bb-f11.m16",  0x000000, 0x80000, CRC(39fdf9c0) SHA1(80392947e3a1831c3ee80139f6f3bdc3bafa4f0d) )
798 	ROM_LOAD( "bb-f12.m13",  0x080000, 0x80000, CRC(69ee046b) SHA1(5c0435f1ce76b584fa8d154d7617d73c7ab5f62f) )
799 	ROM_LOAD( "bb-f13.m12",  0x100000, 0x80000, CRC(f5ef840e) SHA1(dd0f630c52076e0d330f47931e68a3ae9a401078) )
800 	ROM_LOAD( "bb-f14.m11",  0x180000, 0x80000, CRC(1a7df3bb) SHA1(1f27a528e6f89fe56a7342c4f1ff733da0a09327) )
801 
802 	ROM_REGION( 0x200000, REGION_GFX3, ROMREGION_DISPOSE )
803 	ROM_LOAD( "bb-f21.l10",  0x000000, 0x80000, CRC(530f595b) SHA1(820898693b878c4423de9c244f943d39ea69515e) )
804 	ROM_LOAD( "bb-f22.l12",  0x080000, 0x80000, CRC(889c562e) SHA1(d19172d6515ab9793c98de75d6e41687e61a408d) )
805 	ROM_LOAD( "bb-f23.l13",  0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) )
806 	ROM_LOAD( "bb-f24.l15",  0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) )
807 
808 	ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE )
809 	ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) )
810 
811 	ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE )
812 	ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) )
813 
814 	ROM_REGION( 0x10000, REGION_USER1, 0 ) /* Zoom table */
815 	ROM_LOAD( "bb-6.e7",       0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
816 	/* This rom also as bb-7.h7 */
817 	/* This rom also as bb-8.a14 */
818 	/* This rom also as bb-9.c14 */
819 
820 	ROM_REGION( 0x80000, REGION_SOUND1, 0 )
821 	ROM_LOAD( "bb-pcma.l5",  0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) )
822 
823 	ROM_REGION( 0x80000, REGION_SOUND2, 0 )
824 	ROM_LOAD( "bb-pcmb.l3",  0x000000, 0x80000, CRC(c8d5dd53) SHA1(0f7e94532cc14852ca12c1b792e5479667af899e) )
825 ROM_END
826 
827 ROM_START( mechatt )
828 	ROM_REGION( 0x80000, REGION_CPU1, 0 )
829 	ROM_LOAD16_BYTE( "ma5-e.bin", 0x000000, 0x20000, CRC(9bbb852a) SHA1(34b696bf79cf53cac1c384a3143c0f3f243a71f3) )
830 	ROM_LOAD16_BYTE( "ma4.bin",   0x000001, 0x20000, CRC(0d414918) SHA1(0d51b893d37ba124b983beebb691e65bdc52d300) )
831 	ROM_LOAD16_BYTE( "ma7.bin",   0x040000, 0x20000, CRC(61d85e1b) SHA1(46234d48ac21c481a5e70c6a654a341ebdd4cd3a) )
832 	ROM_LOAD16_BYTE( "ma6-f.bin", 0x040001, 0x20000, CRC(4055fe8d) SHA1(b4d8bd5f73805ce1c332eff657dddbb88ff45b37) )
833 
834 	ROM_REGION( 0x10000, REGION_CPU2, 0 )
835 	ROM_LOAD( "ma3.bin",       0x000000, 0x10000, CRC(c06cc8e1) SHA1(65f5f1901120d633f7c3ba07432a188fd7fd7272) )
836 
837 	ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE )
838 	ROM_LOAD( "ma1.bin",       0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) )
839 
840 	ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
841 	ROM_LOAD( "mao89p13.bin",  0x000000, 0x80000, CRC(8bcb16cf) SHA1(409ee1944188d9ce39adce29b1df029b560dd5b0) )
842 	ROM_LOAD( "ma189p15.bin",  0x080000, 0x80000, CRC(b84d9658) SHA1(448adecb0067d8f5b219ec2f94a8dec84187a554) )
843 	ROM_LOAD( "ma289p17.bin",  0x100000, 0x80000, CRC(6cbe08ac) SHA1(8f81f6e92b84ab6867452011d52f3e7689c62a1a) )
844 	ROM_LOAD( "ma389m15.bin",  0x180000, 0x80000, CRC(34d4585e) SHA1(38d9fd5d775e4b3c8b8b487a6ba9b8bdcb3274b0) )
845 
846 	ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
847 	/* Unused */
848 
849 	ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE )
850 	ROM_LOAD( "mab189a2.bin",  0x000000, 0x80000, CRC(e1c8b4d0) SHA1(2f8a1839cca892f8380c7cffe7a12e615d38fd55) )
851 
852 	ROM_REGION( 0x80000, REGION_GFX5, ROMREGION_DISPOSE )
853 	ROM_LOAD( "mab289c2.bin",  0x000000, 0x80000, CRC(14f97ceb) SHA1(a22033532ea616dc3a3db8b66ad6ccc6172ed7cc) )
854 
855 	ROM_REGION( 0x20000, REGION_SOUND1, 0 )
856 	ROM_LOAD( "ma2.bin",       0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) )
857 
858 	ROM_REGION( 0x20000, REGION_USER1, 0 ) /* Zoom table */
859 	ROM_LOAD( "ma8.bin",       0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
860 	/* ma9 is identical to ma8 */
861 ROM_END
862 
863 #if 0
864 static void bbusters_patch_code(UINT16 offset)
865 {
866 	/* To avoid checksum error */
867 	data16_t *RAM = (data16_t *)memory_region(REGION_CPU1);
868 	RAM[(offset +  0)/2] = 0x4e71;
869 	RAM[(offset +  2)/2] = 0x4e71;
870 	RAM[(offset + 10)/2] = 0x4e71;
871 	RAM[(offset + 12)/2] = 0x4e71;
872 	RAM[(offset + 20)/2] = 0x4e71;
873 	RAM[(offset + 22)/2] = 0x4e71;
874 	RAM[(offset + 30)/2] = 0x4e71;
875 	RAM[(offset + 32)/2] = 0x4e71;
876 }
877 #endif
878 
879 DRIVER_INIT( bbusters )
880 {
881 	#if BBUSTERS_HACK
882 	bbusters_patch_code(0x00234c);
883 	#endif
884 }
885 
DRIVER_INIT(mechatt)886 DRIVER_INIT( mechatt )
887 {
888 	#if MECHATT_HACK
889 	bbusters_patch_code(0x003306);
890 	#endif
891 }
892 
893 /******************************************************************************/
894 
895 #if !MECHATT_HACK
896 GAME( 1989, bbusters, 0, bbusters, bbusters, bbusters, ROT0,  "SNK", "Beast Busters (World [Q])" )
897 #else
898 GAME( 1989, bbusters, 0, bbusters, bbusters, bbusters, ROT0,  "SNK", "Beast Busters" )
899 #endif
900 #if !MECHATT_HACK
901 GAME( 1989, mechatt,  0, mechatt,  mechatt,  mechatt,  ROT0,  "SNK", "Mechanized Attack (World)" )
902 #else
903 GAME( 1989, mechatt,  0, mechatt,  mechatt,  mechatt,  ROT0,  "SNK", "Mechanized Attack" )
904 #endif
905