1 /***************************************************************************
2 
3 Atari Fire Truck + Super Bug + Monte Carlo driver
4 
5 ***************************************************************************/
6 
7 #include "driver.h"
8 #include "firetrk.h"
9 
10 int firetrk_game;
11 
12 static int steer_dir[2];
13 static int steer_flag[2];
14 static int attract;
15 static int gear;
16 
17 
DRIVER_INIT(firetrk)18 static DRIVER_INIT( firetrk )
19 {
20 	firetrk_game = 1;
21 }
DRIVER_INIT(superbug)22 static DRIVER_INIT( superbug )
23 {
24 	firetrk_game = 2;
25 }
DRIVER_INIT(montecar)26 static DRIVER_INIT( montecar )
27 {
28 	firetrk_game = 3;
29 }
30 
31 
INTERRUPT_GEN(firetrk_interrupt)32 static INTERRUPT_GEN( firetrk_interrupt )
33 {
34 	/* interrupts are disabled during service mode */
35 
36 	if (GAME_IS_FIRETRUCK)
37 	{
38 		if (readinputport(4) & 0x80)
39 			return;
40 	}
41 	if (GAME_IS_MONTECARLO)
42 	{
43 		if (readinputport(6) & 0x04)
44 			return;
45 	}
46 	if (GAME_IS_SUPERBUG)
47 	{
48 		discrete_sound_w(7, 0);	/* ASR */
49 	}
50 
51 	cpu_set_nmi_line(0, PULSE_LINE);
52 }
53 
54 
periodic_callback(int scanline)55 static void periodic_callback(int scanline)
56 {
57 	cpu_set_irq_line(0, 0, PULSE_LINE);
58 
59 	/* IRQs are generated by inverse 16V signal */
60 
61 	scanline += 32;
62 
63 	if (scanline > 256)
64 	{
65 		scanline = 0;
66 	}
67 
68 	timer_set(cpu_getscanlinetime(scanline), scanline, periodic_callback);
69 }
70 
71 
frame_callback(int dummy)72 static void frame_callback(int dummy)
73 {
74 	static UINT8 dial[2];
75 
76 	int i;
77 
78 	/* handle steering wheels */
79 
80 	for (i = 0; i < 2; i++)
81 	{
82 		signed char delta = readinputport(i) - dial[i];
83 
84 		if (delta < 0)
85 		{
86 			steer_flag[i] = 1;
87 			steer_dir[i] = 0;
88 		}
89 		if (delta > 0)
90 		{
91 			steer_flag[i] = 1;
92 			steer_dir[i] = 1;
93 		}
94 
95 		dial[i] += delta;
96 	}
97 
98 
99 	if (GAME_IS_FIRETRUCK)
100 	{
101 		/* watchdog is disabled during service mode */
102 		if (readinputport(4) & 0x80)
103 		{
104 			watchdog_reset_w(0, 0);
105 		}
106 
107 		/* map horn button onto discrete sound emulation */
108 		discrete_sound_w(1, readinputport(7));
109 	}
110 
111 	/* update gear shift */
112 
113 	if (GAME_IS_SUPERBUG || GAME_IS_MONTECARLO)
114 	{
115 		switch (readinputport(7) & 15)
116 		{
117 		case 1: gear = 1; break;
118 		case 2: gear = 2; break;
119 		case 4: gear = 3; break;
120 		case 8: gear = 4; break;
121 		}
122 	}
123 }
124 
125 
write_output(UINT8 flags)126 static void write_output(UINT8 flags)
127 {
128 	if (GAME_IS_FIRETRUCK)
129 	{
130 		/* BIT0 => START1 LAMP */
131 		/* BIT1 => START2 LAMP */
132 		/* BIT2 => FLASH       */
133 		/* BIT3 => TRACK LAMP  */
134 		/* BIT4 => ATTRACT     */
135 		/* BIT5 => START3 LAMP */
136 		/* BIT6 => UNUSED      */
137 		/* BIT7 => BELL OUT    */
138 
139 		set_led_status(0, !(flags & 0x01));
140 		set_led_status(1, !(flags & 0x02));
141 		set_led_status(2, !(flags & 0x20));
142 		set_led_status(3, !(flags & 0x08));
143 
144 		attract = flags & 0x10;
145 
146 		discrete_sound_w(5, (flags & 0x80) ? 0 : 1);	/* Bell Sound */
147 		discrete_sound_w(6, (flags & 0x10) ? 0 : 1);	/* Attract */
148 
149 		coin_lockout_w(0, !attract);
150 		coin_lockout_w(1, !attract);
151 
152 		firetrk_set_flash(flags & 0x04);
153 	}
154 
155 	if (GAME_IS_SUPERBUG)
156 	{
157 		/* BIT0 => START LAMP */
158 		/* BIT1 => ATTRACT    */
159 		/* BIT2 => FLASH      */
160 		/* BIT3 => TRACK LAMP */
161 
162 		attract = flags & 0x02;
163 
164 		set_led_status(0, flags & 0x01);
165 		set_led_status(1, flags & 0x08);
166 
167 		discrete_sound_w(6, (flags & 0x02) ? 0 : 1);	/* Attract */
168 
169 		coin_lockout_w(0, !attract);
170 		coin_lockout_w(1, !attract);
171 
172 		firetrk_set_flash(flags & 0x04);
173 	}
174 
175 	if (GAME_IS_MONTECARLO)
176 	{
177 		/* BIT0 => START LAMP    */
178 		/* BIT1 => TRACK LAMP    */
179 		/* BIT2 => ATTRACT       */
180 		/* BIT3 => UNUSED        */
181 		/* BIT4 => UNUSED        */
182 		/* BIT5 => COIN3 COUNTER */
183 		/* BIT6 => COIN2 COUNTER */
184 		/* BIT7 => COIN1 COUNTER */
185 
186 		set_led_status(0, !(flags & 0x01));
187 		set_led_status(1, !(flags & 0x02));
188 
189 		discrete_sound_w(6, (flags & 0x04) ? 1 : 0);	/* Attract */
190 
191 		coin_counter_w(0, flags & 0x80);
192 		coin_counter_w(1, flags & 0x40);
193 		coin_counter_w(2, flags & 0x20);
194 	}
195 }
196 
197 
MACHINE_INIT(firetrk)198 static MACHINE_INIT( firetrk )
199 {
200 	timer_pulse(1. / 60, 0, frame_callback);
201 
202 	if (GAME_IS_MONTECARLO)
203 	{
204 		write_output(0);
205 	}
206 
207 	timer_set(0, 0, periodic_callback);
208 }
209 
210 
PALETTE_INIT(firetrk)211 static PALETTE_INIT( firetrk )
212 {
213 	static const UINT16 colortable_source[] =
214 	{
215 		0, 0, 1, 0,
216 		2, 0, 3, 0,
217 		3, 3, 2, 3,
218 		1, 3, 0, 3,
219 		0, 0, 1, 0,
220 		2, 0, 0, 3,
221 		3, 0, 0, 3
222 	};
223 
224 	palette_set_color(0, 0x00, 0x00, 0x00);
225 	palette_set_color(1, 0x5b, 0x5b, 0x5b);
226 	palette_set_color(2, 0xa4, 0xa4, 0xa4);
227 	palette_set_color(3, 0xff, 0xff, 0xff);
228 
229 	memcpy(colortable, colortable_source, sizeof(colortable_source));
230 }
231 
232 
prom_to_palette(int number,UINT8 val)233 static void prom_to_palette(int number, UINT8 val)
234 {
235 	palette_set_color(number,
236 		(val & 4) ? 0xff : 0x00,
237 		(val & 2) ? 0xff : 0x00,
238 		(val & 1) ? 0xff : 0x00);
239 }
240 
241 
PALETTE_INIT(montecar)242 static PALETTE_INIT( montecar )
243 {
244 	static const UINT16 colortable_source[] =
245 	{
246 		0x00, 0x00, 0x00, 0x01,
247 		0x00, 0x02, 0x00, 0x03,
248 		0x03, 0x03, 0x03, 0x02,
249 		0x03, 0x01, 0x03, 0x00,
250 		0x00, 0x00, 0x02, 0x00,
251 		0x02, 0x01, 0x02, 0x02,
252 		0x00, 0x05, 0x06, 0x07,
253 		0x00, 0x09, 0x0A, 0x0B,
254 		0x00, 0x0D, 0x0E, 0x0F,
255 		0x00, 0x11, 0x12, 0x13,
256 		0x00, 0x15, 0x16, 0x17,
257 		0x18, 0x19
258 	};
259 
260 	/*
261 	 * The color PROM is addressed as follows:
262 	 *
263 	 *   A0 => PLAYFIELD 1
264 	 *   A1 => PLAYFIELD 2
265 	 *   A2 => DRONE 1
266 	 *   A3 => DRONE 2
267 	 *   A4 => CAR 1
268 	 *   A5 => CAR 2
269 	 *   A6 => DRONE COLOR 1
270 	 *   A7 => DRONE COLOR 2
271 	 *   A8 => PLAYFIELD WINDOW
272 	 *
273 	 * This driver hard-codes some behavior which actually depends
274 	 * on the PROM, like priorities, clipping and transparency.
275 	 *
276 	 */
277 
278 	const UINT8* p = memory_region(REGION_PROMS);
279 
280 	int number = 0;
281 
282 	prom_to_palette(number++, p[0x100]);
283 	prom_to_palette(number++, p[0x101]);
284 	prom_to_palette(number++, p[0x102]);
285 	prom_to_palette(number++, p[0x103]);
286 
287 	prom_to_palette(number++, p[0x100]);
288 	prom_to_palette(number++, p[0x110]);
289 	prom_to_palette(number++, p[0x120]);
290 	prom_to_palette(number++, p[0x130]);
291 
292 	prom_to_palette(number++, p[0x100]);
293 	prom_to_palette(number++, p[0x104]);
294 	prom_to_palette(number++, p[0x108]);
295 	prom_to_palette(number++, p[0x10C]);
296 
297 	prom_to_palette(number++, p[0x140]);
298 	prom_to_palette(number++, p[0x144]);
299 	prom_to_palette(number++, p[0x148]);
300 	prom_to_palette(number++, p[0x14C]);
301 
302 	prom_to_palette(number++, p[0x180]);
303 	prom_to_palette(number++, p[0x184]);
304 	prom_to_palette(number++, p[0x188]);
305 	prom_to_palette(number++, p[0x18C]);
306 
307 	prom_to_palette(number++, p[0x1C0]);
308 	prom_to_palette(number++, p[0x1C4]);
309 	prom_to_palette(number++, p[0x1C8]);
310 	prom_to_palette(number++, p[0x1CC]);
311 
312 	palette_set_color(number++, 0x00, 0x00, 0x00);
313 	palette_set_color(number++, 0xff, 0xff, 0xff);
314 
315 	memcpy(colortable, colortable_source, sizeof(colortable_source));
316 }
317 
318 
READ_HANDLER(firetrk_zeropage_r)319 static READ_HANDLER( firetrk_zeropage_r )
320 {
321 	return memory_region(REGION_CPU1)[offset & 0xff];
322 }
323 
324 
READ_HANDLER(firetrk_playfield_r)325 static READ_HANDLER( firetrk_playfield_r )
326 {
327 	return firetrk_playfield_ram[offset & 0xff];
328 }
329 
330 
READ_HANDLER(firetrk_dip_r)331 static READ_HANDLER( firetrk_dip_r )
332 {
333 	UINT8 val0 = readinputport(2);
334 	UINT8 val1 = readinputport(3);
335 
336 	if (GAME_IS_FIRETRUCK || GAME_IS_SUPERBUG)
337 	{
338 		if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
339 		if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
340 	}
341 	if (GAME_IS_MONTECARLO)
342 	{
343 		if (val1 & (1 << (3 - offset))) val0 |= 1;
344 		if (val1 & (1 << (7 - offset))) val0 |= 2;
345 	}
346 
347 	return val0;
348 }
349 
350 
READ_HANDLER(firetrk_input_r)351 static READ_HANDLER( firetrk_input_r )
352 {
353 	UINT8 val = 0;
354 
355 	UINT8 bit0 = readinputport(4);
356 	UINT8 bit6 = readinputport(5);
357 	UINT8 bit7 = readinputport(6);
358 
359 	if (GAME_IS_FIRETRUCK)
360 	{
361 		if (!steer_dir[0])
362 			bit0 |= 0x04;
363 		if (!steer_flag[0])
364 			bit7 |= 0x04;
365 		if (firetrk_skid[0] || firetrk_skid[1])
366 			bit0 |= 0x40;
367 		if (firetrk_crash[0] || firetrk_crash[1])
368 			bit7 |= 0x40;
369 		if (!steer_dir[1])
370 			bit0 |= 0x08;
371 		if (!steer_flag[1])
372 			bit7 |= 0x08;
373 	}
374 
375 	if (GAME_IS_SUPERBUG)
376 	{
377 		if (!steer_dir[0])
378 			bit0 |= 0x04;
379 		if (!steer_flag[0])
380 			bit7 |= 0x04;
381 		if (firetrk_skid[0])
382 			bit0 |= 0x40;
383 		if (firetrk_crash[0])
384 			bit7 |= 0x40;
385 		if (gear == 1)
386 			bit7 |= 0x02;
387 		if (gear == 2)
388 			bit0 |= 0x01;
389 		if (gear == 3)
390 			bit7 |= 0x01;
391 	}
392 
393 	if (GAME_IS_MONTECARLO)
394 	{
395 		if (!steer_dir[0])
396 			bit6 |= 0x40;
397 		if (!steer_flag[0])
398 			bit7 |= 0x40;
399 		if (gear == 1)
400 			bit6 |= 0x01;
401 		if (gear == 2)
402 			bit6 |= 0x02;
403 		if (gear == 3)
404 			bit6 |= 0x04;
405 		if (firetrk_skid[0])
406 			bit7 |= 0x80;
407 		if (firetrk_skid[1])
408 			bit6 |= 0x80;
409 		if (firetrk_crash[0])
410 			val |= 0x02;
411 		if (firetrk_crash[1])
412 			val |= 0x01;
413 	}
414 
415 	if (bit0 & (1 << offset)) val |= 0x01;
416 	if (bit6 & (1 << offset)) val |= 0x40;
417 	if (bit7 & (1 << offset)) val |= 0x80;
418 
419 	return val;
420 }
421 
422 
WRITE_HANDLER(firetrk_zeropage_w)423 static WRITE_HANDLER( firetrk_zeropage_w )
424 {
425 	memory_region(REGION_CPU1)[offset & 0xff] = data;
426 }
427 
428 
WRITE_HANDLER(firetrk_arrow_off_w)429 static WRITE_HANDLER( firetrk_arrow_off_w )
430 {
431 	firetrk_set_blink(1);
432 }
433 
434 
WRITE_HANDLER(firetrk_car_reset_w)435 static WRITE_HANDLER( firetrk_car_reset_w )
436 {
437 	firetrk_crash[0] = 0;
438 	firetrk_skid[0] = 0;
439 }
440 
441 
WRITE_HANDLER(firetrk_drone_reset_w)442 static WRITE_HANDLER( firetrk_drone_reset_w )
443 {
444 	firetrk_crash[1] = 0;
445 	firetrk_skid[1] = 0;
446 }
447 
448 
WRITE_HANDLER(firetrk_steer_reset_w)449 static WRITE_HANDLER( firetrk_steer_reset_w )
450 {
451 	steer_flag[0] = 0;
452 	steer_flag[1] = 0;
453 }
454 
455 
WRITE_HANDLER(firetrk_crash_reset_w)456 static WRITE_HANDLER( firetrk_crash_reset_w )
457 {
458 	firetrk_crash[0] = 0;
459 	firetrk_crash[1] = 0;
460 }
461 
462 
WRITE_HANDLER(firetrk_skid_reset_w)463 static WRITE_HANDLER( firetrk_skid_reset_w )
464 {
465 	if (GAME_IS_FIRETRUCK || GAME_IS_SUPERBUG)
466 	{
467 		firetrk_skid[0] = 0;
468 		firetrk_skid[1] = 0;
469 	}
470 
471 	discrete_sound_w(4, 0);
472 }
473 
474 
WRITE_HANDLER(firetrk_crash_snd_w)475 static WRITE_HANDLER( firetrk_crash_snd_w )
476 {
477 	/* invert data here to make life easier on the sound system */
478 	discrete_sound_w(3, ((~data) >> 4)& 0x0f);
479 }
480 
481 
WRITE_HANDLER(firetrk_skid_snd_w)482 static WRITE_HANDLER( firetrk_skid_snd_w )
483 {
484 	discrete_sound_w(4, 1);
485 }
486 
487 
WRITE_HANDLER(firetrk_motor_snd_w)488 static WRITE_HANDLER( firetrk_motor_snd_w )
489 {
490 	if (GAME_IS_FIRETRUCK || GAME_IS_MONTECARLO)
491 	{
492 		discrete_sound_w(2, data / 16);		/* Fire Truck - Siren frequency */
493 							/* Monte Carlo - Drone Motor frequency */
494 	}
495 
496 	discrete_sound_w(0, data & 0x0f);    /* motor frequency */
497 }
498 
499 
WRITE_HANDLER(firetrk_xtndply_w)500 static WRITE_HANDLER( firetrk_xtndply_w )
501 {
502 	discrete_sound_w(7, !(data & 1));
503 }
504 
505 
WRITE_HANDLER(firetrk_out_w)506 static WRITE_HANDLER( firetrk_out_w )
507 {
508 	if (GAME_IS_FIRETRUCK || GAME_IS_MONTECARLO)
509 	{
510 		write_output(data);
511 	}
512 	if (GAME_IS_SUPERBUG)
513 	{
514 		write_output(offset);
515 	}
516 }
517 
518 
WRITE_HANDLER(firetrk_out2_w)519 static WRITE_HANDLER( firetrk_out2_w )
520 {
521 	firetrk_set_flash(data & 0x80);
522 
523 	if (GAME_IS_MONTECARLO)
524 	{
525 		discrete_sound_w(7, !(data & 0x10));	/* Beep */
526 		discrete_sound_w(5, data & 0x0f);	/* Drone Motor Volume */
527 	}
528 }
529 
530 
WRITE_HANDLER(firetrk_asr_w)531 static WRITE_HANDLER( firetrk_asr_w )
532 {
533 	if (GAME_IS_SUPERBUG)
534 	{
535 		discrete_sound_w(7, 1);	/* ASR */
536 	}
537 }
538 
539 
MEMORY_READ_START(firetrk_readmem)540 static MEMORY_READ_START( firetrk_readmem )
541 	{ 0x0000, 0x00ff, MRA_RAM },
542 	{ 0x0100, 0x07ff, firetrk_zeropage_r },
543 	{ 0x0800, 0x08ff, MRA_RAM },
544 	{ 0x0900, 0x0fff, firetrk_playfield_r },
545 	{ 0x1800, 0x1807, firetrk_input_r },
546 	{ 0x1c00, 0x1c03, firetrk_dip_r },
547 	{ 0x2000, 0x3fff, MRA_ROM },
548 	{ 0xf800, 0xffff, MRA_ROM },
549 MEMORY_END
550 
551 
552 static MEMORY_WRITE_START( firetrk_writemem )
553 	{ 0x0000, 0x00ff, MWA_RAM, &firetrk_alpha_num_ram },
554 	{ 0x0100, 0x07ff, firetrk_zeropage_w },
555 	{ 0x0800, 0x0fff, firetrk_playfield_w, &firetrk_playfield_ram },
556 	{ 0x1000, 0x1000, firetrk_vert_w },
557 	{ 0x1020, 0x1020, firetrk_horz_w },
558 	{ 0x1040, 0x104f, firetrk_crash_reset_w },
559 	{ 0x1060, 0x1060, firetrk_skid_reset_w },
560 	{ 0x1080, 0x1080, firetrk_car_rot_w },
561 	{ 0x10a0, 0x10a0, firetrk_steer_reset_w },
562 	{ 0x10c0, 0x10c0, watchdog_reset_w },
563 	{ 0x10e0, 0x10e0, firetrk_arrow_off_w },
564 	{ 0x1400, 0x1400, firetrk_motor_snd_w },
565 	{ 0x1420, 0x1420, firetrk_crash_snd_w },
566 	{ 0x1440, 0x1440, firetrk_skid_snd_w },
567 	{ 0x1460, 0x1460, firetrk_drone_hpos_w },
568 	{ 0x1480, 0x1480, firetrk_drone_vpos_w },
569 	{ 0x14a0, 0x14a0, firetrk_drone_rot_w },
570 	{ 0x14c0, 0x14c0, firetrk_out_w },
571 	{ 0x14e0, 0x14e0, firetrk_xtndply_w },
572 	{ 0x1800, 0x1807, MWA_NOP },
573 	{ 0x2000, 0x3fff, MWA_ROM },
574 	{ 0xf800, 0xffff, MWA_ROM },
575 MEMORY_END
576 
577 
578 static MEMORY_READ_START( superbug_readmem )
579 	{ 0x0000, 0x00ff, MRA_RAM },
580 	{ 0x0200, 0x0207, firetrk_input_r },
581 	{ 0x0240, 0x0243, firetrk_dip_r },
582 	{ 0x0400, 0x041f, MRA_RAM },
583 	{ 0x0500, 0x05ff, MRA_RAM },
584 	{ 0x0800, 0x1fff, MRA_ROM },
585 	{ 0xf800, 0xffff, MRA_ROM },
586 MEMORY_END
587 
588 
589 static MEMORY_WRITE_START( superbug_writemem )
590 	{ 0x0000, 0x00ff, MWA_RAM },
591 	{ 0x0100, 0x0100, firetrk_vert_w },
592 	{ 0x0120, 0x0120, firetrk_horz_w },
593 	{ 0x0140, 0x0140, firetrk_crash_reset_w },
594 	{ 0x0160, 0x0160, firetrk_skid_reset_w },
595 	{ 0x0180, 0x0180, firetrk_car_rot_w },
596 	{ 0x01a0, 0x01a0, firetrk_steer_reset_w },
597 	{ 0x01c0, 0x01c0, watchdog_reset_w },
598 	{ 0x01e0, 0x01e0, firetrk_arrow_off_w },
599 	{ 0x0220, 0x0220, firetrk_asr_w },
600 	{ 0x0260, 0x026f, firetrk_out_w },
601 	{ 0x0280, 0x0280, firetrk_motor_snd_w },
602 	{ 0x02a0, 0x02a0, firetrk_crash_snd_w },
603 	{ 0x02c0, 0x02c0, firetrk_skid_snd_w },
604 	{ 0x0400, 0x041f, MWA_RAM, &firetrk_alpha_num_ram },
605 	{ 0x0500, 0x05ff, firetrk_playfield_w, &firetrk_playfield_ram },
606 	{ 0x0800, 0x1fff, MWA_ROM },
607 	{ 0xf800, 0xffff, MWA_ROM },
608 MEMORY_END
609 
610 
611 static MEMORY_READ_START( montecar_readmem )
612 	{ 0x0000, 0x00ff, MRA_RAM },
613 	{ 0x0100, 0x07ff, firetrk_zeropage_r },
614 	{ 0x0800, 0x08ff, MRA_RAM },
615 	{ 0x0900, 0x0fff, firetrk_playfield_r },
616 	{ 0x1800, 0x1807, firetrk_input_r },
617 	{ 0x1c00, 0x1c03, firetrk_dip_r },
618 	{ 0x2000, 0x3fff, MRA_ROM },
619 	{ 0xf800, 0xffff, MRA_ROM },
620 MEMORY_END
621 
622 
623 static MEMORY_WRITE_START( montecar_writemem )
624 	{ 0x0000, 0x00ff, MWA_RAM, &firetrk_alpha_num_ram },
625 	{ 0x0100, 0x07ff, firetrk_zeropage_w },
626 	{ 0x0800, 0x0fff, firetrk_playfield_w, &firetrk_playfield_ram },
627 	{ 0x1000, 0x1000, firetrk_vert_w },
628 	{ 0x1020, 0x1020, firetrk_horz_w },
629 	{ 0x1040, 0x1040, firetrk_drone_reset_w },
630 	{ 0x1060, 0x1060, firetrk_car_reset_w },
631 	{ 0x1080, 0x1080, firetrk_car_rot_w },
632 	{ 0x10a0, 0x10a0, firetrk_steer_reset_w },
633 	{ 0x10c0, 0x10c0, watchdog_reset_w },
634 	{ 0x10e0, 0x10e0, firetrk_skid_reset_w },
635 	{ 0x1400, 0x1400, firetrk_motor_snd_w },
636 	{ 0x1420, 0x1420, firetrk_crash_snd_w },
637 	{ 0x1440, 0x1440, firetrk_skid_snd_w },
638 	{ 0x1460, 0x1460, firetrk_drone_hpos_w },
639 	{ 0x1480, 0x1480, firetrk_drone_vpos_w },
640 	{ 0x14a0, 0x14a0, firetrk_drone_rot_w },
641 	{ 0x14c0, 0x14c0, firetrk_out_w },
642 	{ 0x14e0, 0x14e0, firetrk_out2_w },
643 	{ 0x1800, 0x1807, MWA_NOP },
644 	{ 0x2000, 0x3fff, MWA_ROM },
645 	{ 0xf800, 0xffff, MWA_ROM },
646 MEMORY_END
647 
648 
649 INPUT_PORTS_START( firetrk )
650 	PORT_START
651 	PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_PLAYER1, 25, 10, 0, 0 )
652 
653 	PORT_START
654 	PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_PLAYER2, 25, 10, 0, 0 )
655 
656 	PORT_START
657 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
658 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
659 	PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Coinage ))
660 	PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ))
661 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ))
662 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ))
663 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
664 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ))
665 	PORT_DIPSETTING(    0x10, DEF_STR( Off ))
666 	PORT_DIPSETTING(    0x00, DEF_STR( On ))
667 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ))
668 	PORT_DIPSETTING(    0x20, DEF_STR( Off ))
669 	PORT_DIPSETTING(    0x00, DEF_STR( On ))
670 
671 	PORT_START
672 	PORT_DIPNAME( 0x03, 0x00, "Language" )
673 	PORT_DIPSETTING(    0x00, "English" )
674 	PORT_DIPSETTING(    0x01, "French" )
675 	PORT_DIPSETTING(    0x02, "Spanish" )
676 	PORT_DIPSETTING(    0x03, "German" )
677 	PORT_DIPNAME( 0x0c, 0x04, "Play Time" )
678 	PORT_DIPSETTING(    0x00, "60 Seconds" )
679 	PORT_DIPSETTING(    0x04, "90 Seconds" )
680 	PORT_DIPSETTING(    0x08, "120 Seconds" )
681 	PORT_DIPSETTING(    0x0c, "150 Seconds" )
682 	PORT_DIPNAME( 0x30, 0x20, "Extended Play" )
683 	PORT_DIPSETTING(    0x10, "Liberal" )
684 	PORT_DIPSETTING(    0x20, "Medium" )
685 	PORT_DIPSETTING(    0x30, "Conservative" )
686 	PORT_DIPSETTING(    0x00, "Never" )
687 
688 	PORT_START /* bit 0 */
689 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
690 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1, "Gas", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
691 	PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR 1 */
692 	PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR 2 */
693 	PORT_BITX(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2, "Bell", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
694 	PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_TILT)
695 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID */
696 	PORT_SERVICE(0x80, IP_ACTIVE_HIGH)
697 
698 	PORT_START /* bit 6 */
699 	PORT_BITX(0x01, IP_ACTIVE_HIGH, IPT_START1, "Front Player Start", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
700 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_START2, "Back Player Start", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
701 	PORT_BITX(0x04, IP_ACTIVE_HIGH, IPT_START3, "Both Players Start", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
702 	PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1, "Track Select", KEYCODE_SPACE, IP_JOY_DEFAULT)
703 	PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
704 	PORT_BIT (0x20, IP_ACTIVE_LOW,  IPT_VBLANK)
705 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ))
706 	PORT_DIPSETTING(    0x00, "Smokey Joe (1 Player)" )
707 	PORT_DIPSETTING(    0x40, "Fire Truck (2 Players)" )
708 	PORT_BITX(0x80, IP_ACTIVE_HIGH,	IPT_SERVICE, "Diag Hold", KEYCODE_F6, IP_JOY_NONE)
709 
710 	PORT_START /* bit 7 */
711 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
712 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
713 	PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG 1 */
714 	PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG 2 */
715 	PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN1)
716 	PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_COIN2)
717 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* CRASH */
718 	PORT_BITX(0x80, IP_ACTIVE_HIGH, IPT_SERVICE, "Diag Step", KEYCODE_F1, IP_JOY_NONE)
719 
720 	PORT_START
721 	PORT_BITX(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1, "Horn", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
722 INPUT_PORTS_END
723 
724 
725 INPUT_PORTS_START( superbug )
726 	PORT_START
727 	PORT_ANALOG( 0xff, 0x00, IPT_DIAL, 25, 10, 0, 0 )
728 
729 	PORT_START
730 	PORT_BIT (0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
731 
732 	PORT_START
733 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
734 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
735 
736 	PORT_START
737 	PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ))
738 	PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ))
739 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ))
740 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
741 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
742 	PORT_DIPNAME( 0x0c, 0x04, "Play Time" )
743 	PORT_DIPSETTING(    0x00, "60 seconds" )
744 	PORT_DIPSETTING(    0x04, "90 seconds" )
745 	PORT_DIPSETTING(    0x08, "120 seconds" )
746 	PORT_DIPSETTING(    0x0c, "150 seconds" )
747 	PORT_DIPNAME( 0x30, 0x20, "Extended Play" )
748 	PORT_DIPSETTING(    0x10, "Liberal" )
749 	PORT_DIPSETTING(    0x20, "Medium" )
750 	PORT_DIPSETTING(    0x30, "Conservative" )
751 	PORT_DIPSETTING(    0x00, "Never" )
752 	PORT_DIPNAME( 0xc0, 0x00, "Language" )
753 	PORT_DIPSETTING(    0x00, "English" )
754 	PORT_DIPSETTING(    0x40, "French" )
755 	PORT_DIPSETTING(    0x80, "Spanish" )
756 	PORT_DIPSETTING(    0xc0, "German" )
757 
758 	PORT_START /* bit 0 */
759 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 2 */
760 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1, "Gas", IP_KEY_DEFAULT, IP_JOY_DEFAULT)
761 	PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR */
762 	PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7, "Hiscore Reset", KEYCODE_H, IP_JOY_DEFAULT)
763 	PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
764 	PORT_SERVICE( 0x20, IP_ACTIVE_HIGH)
765 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID */
766 	PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_TILT)
767 
768 	PORT_START /* bit 6 */
769 	PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
770 
771 	PORT_START /* bit 7 */
772 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 3 */
773 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 1 */
774 	PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG */
775 	PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_COIN1)
776 	PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN2)
777 	PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_START1)
778 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* CRASH */
779 	PORT_BITX(0x80, IP_ACTIVE_HIGH, IPT_BUTTON6, "Track Select", KEYCODE_SPACE, IP_JOY_DEFAULT )
780 
781 	PORT_START
782 	PORT_BITX(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2, "Gear 1", KEYCODE_Z, IP_JOY_DEFAULT )
783 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON3, "Gear 2", KEYCODE_X, IP_JOY_DEFAULT )
784 	PORT_BITX(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4, "Gear 3", KEYCODE_C, IP_JOY_DEFAULT )
785 	PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5, "Gear 4", KEYCODE_V, IP_JOY_DEFAULT )
786 INPUT_PORTS_END
787 
788 
789 INPUT_PORTS_START( montecar )
790 	PORT_START
791 	PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_PLAYER1, 25, 10, 0, 0 )
792 
793 	PORT_START
794 	PORT_BIT (0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
795 
796 	PORT_START
797 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
798 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* other DIPs connect here */
799 	PORT_DIPNAME( 0x0c, 0x0c, "Coin 3 Multiplier" )
800 	PORT_DIPSETTING(    0x0c, "1" )
801 	PORT_DIPSETTING(    0x08, "4" )
802 	PORT_DIPSETTING(    0x04, "5" )
803 	PORT_DIPSETTING(    0x00, "6" )
804 	PORT_DIPNAME( 0x10, 0x10, "Coin 2 Multiplier" )
805 	PORT_DIPSETTING(    0x10, "1" )
806 	PORT_DIPSETTING(    0x00, "2" )
807 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ))
808 	PORT_DIPSETTING(    0x20, DEF_STR( Off ))
809 	PORT_DIPSETTING(    0x00, DEF_STR( On ))
810 
811 	PORT_START
812 	PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ))
813 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ))
814 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ))
815 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
816 	PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ))
817 	PORT_DIPNAME( 0x0c, 0x08, "Extended Play" )
818 	PORT_DIPSETTING(    0x04, "Liberal" )
819 	PORT_DIPSETTING(    0x08, "Medium" )
820 	PORT_DIPSETTING(    0x00, "Conservative" )
821 	PORT_DIPSETTING(    0x0c, "Never" )
822 	PORT_DIPNAME( 0x30, 0x20, "Play Time" )
823 	PORT_DIPSETTING(    0x30, "60 Seconds" )
824 	PORT_DIPSETTING(    0x10, "90 Seconds" )
825 	PORT_DIPSETTING(    0x20, "120 Seconds" )
826 	PORT_DIPSETTING(    0x00, "150 Seconds" )
827 	PORT_DIPNAME( 0xc0, 0xc0, "Language" )
828 	PORT_DIPSETTING(    0xc0, "English" )
829 	PORT_DIPSETTING(    0x80, "Spanish" )
830 	PORT_DIPSETTING(    0x40, "French" )
831 	PORT_DIPSETTING(    0x00, "German" )
832 
833 	PORT_START /* bit 0 */
834 	PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED)
835 
836 	PORT_START /* bit 6 */
837 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 1 */
838 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 2 */
839 	PORT_BIT (0x04, IP_ACTIVE_HIGH, IPT_UNUSED) /* GEAR 3 */
840 	PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_BUTTON6, "Track Select", KEYCODE_SPACE, IP_JOY_DEFAULT )
841 	PORT_BITX(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1, "Gas", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
842 	PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_VBLANK)
843 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER DIR */
844 	PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID 1 */
845 
846 	PORT_START /* bit 7 */
847 	PORT_BIT (0x01, IP_ACTIVE_HIGH, IPT_START1)
848 	PORT_BIT (0x02, IP_ACTIVE_HIGH, IPT_TILT)
849 	PORT_SERVICE(0x04, IP_ACTIVE_HIGH)
850 	PORT_BIT (0x08, IP_ACTIVE_HIGH, IPT_COIN1)
851 	PORT_BIT (0x10, IP_ACTIVE_HIGH, IPT_COIN2)
852 	PORT_BIT (0x20, IP_ACTIVE_HIGH, IPT_COIN3)
853 	PORT_BIT (0x40, IP_ACTIVE_HIGH, IPT_UNUSED) /* STEER FLAG */
854 	PORT_BIT (0x80, IP_ACTIVE_HIGH, IPT_UNUSED) /* SKID 0 */
855 
856 	PORT_START
857 	PORT_BITX(0x01, IP_ACTIVE_HIGH, IPT_BUTTON2, "Gear 1", KEYCODE_Z, IP_JOY_DEFAULT )
858 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON3, "Gear 2", KEYCODE_X, IP_JOY_DEFAULT )
859 	PORT_BITX(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4, "Gear 3", KEYCODE_C, IP_JOY_DEFAULT )
860 	PORT_BITX(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5, "Gear 4", KEYCODE_V, IP_JOY_DEFAULT )
861 INPUT_PORTS_END
862 
863 
864 static struct GfxLayout firetrk_text_layout =
865 {
866 	16, 16, /* width, height */
867 	32,     /* total         */
868 	1,      /* planes        */
869 	{ 0 },  /* plane offsets */
870 	{
871 		0x1C, 0x1D, 0x1E, 0x1F, 0x04, 0x05, 0x06, 0x07,
872 		0x0C, 0x0D, 0x0E, 0x0F, 0x14, 0x15, 0x16, 0x17
873 	},
874 	{
875 		0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0,
876 		0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0
877 	},
878 	0x200
879 };
880 
881 
882 static struct GfxLayout superbug_text_layout =
883 {
884 	16, 16, /* width, height */
885 	32,     /* total         */
886 	1,      /* planes        */
887 	{ 0 },  /* plane offsets */
888 	{
889 		0x0C, 0x0D, 0x0E, 0x0F, 0x14, 0x15, 0x16, 0x17,
890 		0x1C, 0x1D, 0x1E, 0x1F, 0x04, 0x05, 0x06, 0x07
891 	},
892 	{
893 		0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0,
894 		0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0
895 	},
896 	0x200
897 };
898 
899 
900 static struct GfxLayout montecar_text_layout =
901 {
902 	8, 8,   /* width, height */
903 	64,     /* total         */
904 	1,      /* planes        */
905 	{ 0 },  /* plane offsets */
906 	{
907 		0xC, 0xD, 0xE, 0xF, 0x4, 0x5, 0x6, 0x7
908 	},
909 	{
910 		0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70
911 	},
912 	0x80
913 };
914 
915 
916 static struct GfxLayout firetrk_tile_layout =
917 {
918 	16, 16, /* width, height */
919 	64,     /* total         */
920 	1,      /* planes        */
921 	{ 0 },  /* plane offsets */
922 	{
923 		0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
924 		0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF
925 	},
926 	{
927 		0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
928 		0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0
929 	},
930 	0x100
931 };
932 
933 
934 static struct GfxLayout superbug_tile_layout =
935 {
936 	16, 16, /* width, height */
937 	64,     /* total         */
938 	1,      /* planes        */
939 	{ 0 },  /* plane offsets */
940 	{
941 		0x07, 0x06, 0x05, 0x04, 0x0F, 0x0E, 0x0D, 0x0C,
942 		0x17, 0x16, 0x15, 0x14, 0x1F, 0x1E, 0x1D, 0x1C
943 	},
944 	{
945 		0x000, 0x020, 0x040, 0x060, 0x080, 0x0A0, 0x0C0, 0x0E0,
946 		0x100, 0x120, 0x140, 0x160, 0x180, 0x1A0, 0x1C0, 0x1E0
947 	},
948 	0x200
949 };
950 
951 
952 static struct GfxLayout firetrk_car_layout1 =
953 {
954 	32, 32, /* width, height */
955 	4,      /* total         */
956 	1,      /* planes        */
957 	{ 0 },  /* plane offsets */
958 	{
959 		0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0,
960 		0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0,
961 		0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0,
962 		0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0
963 	},
964 	{
965 		0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
966 		0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F,
967 		0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F,
968 		0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3B
969 	},
970 	0x800
971 };
972 
973 
974 static struct GfxLayout superbug_car_layout1 =
975 {
976 	32, 32, /* width, height */
977 	4,      /* total         */
978 	1,      /* planes        */
979 	{ 0 },  /* plane offsets */
980 	{
981 		0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700,
982 		0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00,
983 		0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700,
984 		0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00
985 	},
986 	{
987 		0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C,
988 		0x44, 0x4C, 0x54, 0x5C, 0x64, 0x6C, 0x74, 0x7C,
989 		0x84, 0x8C, 0x94, 0x9C, 0xA4, 0xAC, 0xB4, 0xBC,
990 		0xC4, 0xCC, 0xD4, 0xDC, 0xE4, 0xEC, 0xF4, 0xFC
991 	},
992 	0x001
993 };
994 
995 
996 static struct GfxLayout montecar_car_layout =
997 {
998 	32, 32, /* width, height */
999 	8,      /* total         */
1000 	2,      /* planes        */
1001 	        /* plane offsets */
1002 	{ 1, 0 },
1003 	{
1004 		0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
1005 		0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E,
1006 		0x20, 0x22, 0x24, 0x26, 0x28, 0x2A, 0x2C, 0x2E,
1007 		0x30, 0x32, 0x34, 0x36, 0x38, 0x3A, 0x3C, 0x3E
1008 	},
1009 	{
1010 		0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0,
1011 		0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0,
1012 		0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0,
1013 		0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0
1014 	},
1015 	0x800
1016 };
1017 
1018 
1019 static struct GfxLayout firetrk_car_layout2 =
1020 {
1021 	32, 32, /* width, height */
1022 	4,      /* total         */
1023 	1,      /* planes        */
1024 	{ 0 },  /* plane offsets */
1025 	{
1026 		0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
1027 		0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F,
1028 		0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F,
1029 		0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3B
1030 	},
1031 	{
1032 		0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0,
1033 		0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0,
1034 		0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0,
1035 		0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0
1036 	},
1037 	0x800
1038 };
1039 
1040 
1041 static struct GfxLayout superbug_car_layout2 =
1042 {
1043 	32, 32, /* width, height */
1044 	4,      /* total         */
1045 	1,      /* planes        */
1046 	{ 0 },  /* plane offsets */
1047 	{
1048 		0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C,
1049 		0x44, 0x4C, 0x54, 0x5C, 0x64, 0x6C, 0x74, 0x7C,
1050 		0x84, 0x8C, 0x94, 0x9C, 0xA4, 0xAC, 0xB4, 0xBC,
1051 		0xC4, 0xCC, 0xD4, 0xDC, 0xE4, 0xEC, 0xF4, 0xFC
1052 	},
1053 	{
1054 		0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700,
1055 		0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00,
1056 		0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700,
1057 		0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00
1058 	},
1059 	0x001
1060 };
1061 
1062 
1063 static struct GfxLayout firetrk_trailer_layout =
1064 {
1065 	64, 64, /* width, height */
1066 	8,      /* total         */
1067 	1,      /* planes        */
1068 	{ 0 },  /* plane offsets */
1069 	{
1070 		0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1071 		0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
1072 		0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1073 		0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
1074 		0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
1075 		0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
1076 		0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
1077 		0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F
1078 	},
1079 	{
1080 		0x000, 0x040, 0x080, 0x0C0, 0x100, 0x140, 0x180, 0x1C0,
1081 		0x200, 0x240, 0x280, 0x2C0, 0x300, 0x340, 0x380, 0x3C0,
1082 		0x400, 0x440, 0x480, 0x4C0, 0x500, 0x540, 0x580, 0x5C0,
1083 		0x600, 0x640, 0x680, 0x6C0, 0x700, 0x740, 0x780, 0x7C0,
1084 		0x800, 0x840, 0x880, 0x8C0, 0x900, 0x940, 0x980, 0x9C0,
1085 		0xA00, 0xA40, 0xA80, 0xAC0, 0xB00, 0xB40, 0xB80, 0xBC0,
1086 		0xC00, 0xC40, 0xC80, 0xCC0, 0xD00, 0xD40, 0xD80, 0xDC0,
1087 		0xE00, 0xE40, 0xE80, 0xEC0, 0xF00, 0xF40, 0xF80, 0xFC0
1088 	},
1089 	0x1000
1090 };
1091 
1092 
1093 static struct GfxDecodeInfo firetrk_gfxdecodeinfo[] =
1094 {
1095 	{ REGION_GFX1, 0, &firetrk_text_layout, 26, 1 },
1096 	{ REGION_GFX2, 0, &firetrk_tile_layout, 0, 8 },
1097 	{ REGION_GFX2, 0, &firetrk_tile_layout, 16, 3 },
1098 	{ REGION_GFX3, 0, &firetrk_car_layout1, 22, 2 },
1099 	{ REGION_GFX3, 0, &firetrk_car_layout2, 22, 2 },
1100 	{ REGION_GFX4, 0, &firetrk_trailer_layout, 22, 2 },
1101 	{ -1 }
1102 };
1103 
1104 
1105 static struct GfxDecodeInfo superbug_gfxdecodeinfo[] =
1106 {
1107 	{ REGION_GFX1, 0, &superbug_text_layout, 26, 1 },
1108 	{ REGION_GFX2, 0, &superbug_tile_layout, 0, 8 },
1109 	{ REGION_GFX2, 0, &superbug_tile_layout, 16, 3 },
1110 	{ REGION_GFX3, 0, &superbug_car_layout1, 22, 2 },
1111 	{ REGION_GFX3, 0, &superbug_car_layout2, 22, 2 },
1112 	{ -1 }
1113 };
1114 
1115 
1116 static struct GfxDecodeInfo montecar_gfxdecodeinfo[] =
1117 {
1118 	{ REGION_GFX1, 0, &montecar_text_layout, 44, 1 },
1119 	{ REGION_GFX2, 0, &firetrk_tile_layout, 0, 8 },
1120 	{ REGION_GFX2, 0, &firetrk_tile_layout, 16, 4 },
1121 	{ REGION_GFX3, 0, &montecar_car_layout, 24, 1 },
1122 	{ REGION_GFX4, 0, &montecar_car_layout, 28, 4 },
1123 	{ -1 }
1124 };
1125 
1126 
1127 /************************************************************************/
1128 /* firetrk Sound System Analog emulation by K.Wilkins Feb 2001          */
1129 /* Questions/Suggestions to mame@dysfunction.demon.co.uk                */
1130 /* Modified and added superbug/montecar sounds.  Jan 2003 D.R.          */
1131 /************************************************************************/
1132 
1133 const struct discrete_lfsr_desc firetrk_lfsr={
1134 	16,			/* Bit Length */
1135 	0,			/* Reset Value */
1136 	0,			/* Use Bit 0 as XOR input 0 */
1137 	14,			/* Use Bit 14 as XOR input 1 */
1138 	DISC_LFSR_XNOR,		/* Feedback stage1 is XNOR */
1139 	DISC_LFSR_OR,		/* Feedback stage2 is just stage 1 output OR with external feed */
1140 	DISC_LFSR_REPLACE,	/* Feedback stage3 replaces the shifted register contents */
1141 	0x000001,		/* Everything is shifted into the first bit only */
1142 	0,			/* Output is not inverted */
1143 	15			/* Output bit */
1144 };
1145 
1146 /* Nodes - Inputs */
1147 #define FIRETRUCK_MOTORSND_DATA		NODE_01
1148 #define FIRETRUCK_HORNSND_EN		NODE_02
1149 #define FIRETRUCK_SIRENSND_DATA		NODE_03
1150 #define FIRETRUCK_CRASHSND_DATA		NODE_04
1151 #define FIRETRUCK_SKIDSND_EN		NODE_05
1152 #define FIRETRUCK_BELLSND_EN		NODE_06
1153 #define FIRETRUCK_ATTRACT_EN		NODE_07
1154 #define FIRETRUCK_XTNDPLY_EN		NODE_08
1155 /* Nodes - Sounds */
1156 #define FIRETRUCK_MOTORSND		NODE_11
1157 #define FIRETRUCK_HORNSND		NODE_12
1158 #define FIRETRUCK_SIRENSND		NODE_13
1159 #define FIRETRUCK_CRASHSND		NODE_14
1160 #define FIRETRUCK_SKIDSND		NODE_15
1161 #define FIRETRUCK_BELLSND		NODE_16
1162 #define FIRETRUCK_NOISE			NODE_17
1163 #define FIRETRUCK_XTNDPLY		NODE_18
1164 
1165 static DISCRETE_SOUND_START(firetrk_sound_interface)
1166 	/************************************************/
1167 	/* Firetruck sound system: 7 Sound Sources      */
1168 	/*                     Relative Volume          */
1169 	/*    1) Horn (Button)     21.36%               */
1170 	/*    2) Motor             12.70%               */
1171 	/*    3) Siren              3.13%               */
1172 	/*    4) Crash             45.22%               */
1173 	/*    5) Screech/Skid      14.24%               */
1174 	/*    6) Bell              21.36%               */
1175 	/*    7) Xtnd             100.00%               */
1176 	/* Relative volumes calculated from gain        */
1177 	/* formula for inverting amplifier.             */
1178 	/*                                              */
1179 	/*  FireTruck Discrete sound mapping via:       */
1180 	/*     discrete_sound_w($register,value)        */
1181 	/*  $00 - Motorsound frequency                  */
1182 	/*  $01 - Hornsound enable                      */
1183 	/*  $02 - Siren frequency                       */
1184 	/*  $03 - Crash volume                          */
1185 	/*  $04 - Skid enable                           */
1186 	/*  $05 - Bell enable                           */
1187 	/*  $06 - Attract mode                          */
1188 	/*  $07 - Extend sound                          */
1189 	/*                                              */
1190 	/************************************************/
1191 
1192 	/************************************************/
1193 	/* Input register mapping for firetruck         */
1194 	/************************************************/
1195 	/*                   NODE                 ADDR  MASK   GAIN    OFFSET  INIT */
1196 	DISCRETE_INPUTX(FIRETRUCK_MOTORSND_DATA  ,0x00,0x000f, -1.0   , 15.0,   0.0)
1197 	DISCRETE_INPUT (FIRETRUCK_HORNSND_EN     ,0x01,0x000f,                  0.0)
1198 	DISCRETE_INPUTX(FIRETRUCK_SIRENSND_DATA  ,0x02,0x000f, -1.0   , 15.0,   0.0)
1199 	DISCRETE_INPUTX(FIRETRUCK_CRASHSND_DATA  ,0x03,0x000f, 452.2/15.0, 0,   0.0)
1200 	DISCRETE_INPUT (FIRETRUCK_SKIDSND_EN     ,0x04,0x000f,                  0.0)
1201 	DISCRETE_INPUTX(FIRETRUCK_BELLSND_EN     ,0x05,0x000f, 213.6,    0.0,   0.0)
1202 	DISCRETE_INPUT (FIRETRUCK_ATTRACT_EN     ,0x06,0x000f,                  0.0)
1203 	DISCRETE_INPUT (FIRETRUCK_XTNDPLY_EN     ,0x07,0x000f,                  0.0)
1204 
1205 	/************************************************/
1206 	/* Motor sound circuit is based on a 556 VCO    */
1207 	/* with the input frequency set by the MotorSND */
1208 	/* latch (4 bit). This freqency is then used to */
1209 	/* driver a modulo 12 counter, with div6 & div12*/
1210 	/* summed as the output of the circuit.         */
1211 	/* VCO Output is Sq wave = 95-458Hz             */
1212 	/*  F1 freq - (Div6)                            */
1213 	/*  F2 freq = (Div12)                           */
1214 	/* To generate the frequency we take the freq.  */
1215 	/* diff. and /15 to get all the steps between   */
1216 	/* 0 - 15.  Then add the low frequency and send */
1217 	/* that value to a squarewave generator.        */
1218 	/* Also as the frequency changes, it ramps due  */
1219 	/* to a 10uf capacitor on the R-ladder.         */
1220 	/* Note the VCO freq. is controlled by a 250k   */
1221 	/* pot.  The freq. used here is for the pot set */
1222 	/* to 125k.  The low freq is allways the same.  */
1223 	/* This adjusts the high end.                   */
1224 	/* 0k = 289Hz.   250k = 4500Hz                  */
1225 	/************************************************/
1226 	DISCRETE_RCFILTER(NODE_20, 1, FIRETRUCK_MOTORSND_DATA, 123000, 10e-6)
1227 	DISCRETE_ADJUSTMENT(NODE_21, 1, (289.0-95.0)/12/15, (4500.0-95.0)/12/15, (458.0-95.0)/12/15, DISC_LOGADJ, "Motor RPM")
1228 	DISCRETE_MULTIPLY(NODE_22, 1, NODE_20, NODE_21)
1229 
1230 	DISCRETE_MULTADD(NODE_23, 1, NODE_22, 2, 95.0/6)	/* F1 = /12*2 = /6 */
1231 	DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (127.0/2), 50.0, 0, 0)
1232 	DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
1233 
1234 	DISCRETE_ADDER2(NODE_26, 1, NODE_22, 95.0/12)		/* F2 = /12 */
1235 	DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (127.0/2), 50.0, 0, 0)
1236 	DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
1237 
1238 	DISCRETE_ADDER2(FIRETRUCK_MOTORSND, FIRETRUCK_ATTRACT_EN, NODE_25, NODE_28)
1239 
1240 	/************************************************/
1241 	/* Horn, this is taken from the 64V signal.     */
1242 	/*  64V = HSYNC/128                             */
1243 	/*      = 15750/128                             */
1244 	/************************************************/
1245 	DISCRETE_SQUAREWFIX(NODE_30, FIRETRUCK_ATTRACT_EN, 15750.0/128, 213.6, 50.0, 0, 0)
1246 	DISCRETE_ONOFF(FIRETRUCK_HORNSND, FIRETRUCK_HORNSND_EN, NODE_30)
1247 
1248 	/************************************************/
1249 	/* Siren is built around a 556 based VCO, the   */
1250 	/* 4 bit input value is smoothed between trans- */
1251 	/* itions by a 10u capacitor with around a 0.5s */
1252 	/* time constant, modelled with an RC filter.   */
1253 	/* 0000 = 666Hz with 35% duty cycle             */
1254 	/* 1111 = 526Hz with 63% duty cycle             */
1255 	/* Input register does the inversion of sense   */
1256 	/* to map this to:                              */
1257 	/* 0000 = 526Hz with 37% duty cycle             */
1258 	/* 1111 = 666Hz with 65% duty cycle             */
1259 	/* Duty cycle is inverted 100-x to make things  */
1260 	/* a little simpler and it doesnt affect sound. */
1261 	/************************************************/
1262 	DISCRETE_RCFILTER(NODE_40, 1, FIRETRUCK_SIRENSND_DATA, 250000, 1e-6)	/* Input smoothing */
1263 
1264 	DISCRETE_MULTADD(NODE_41, 1, NODE_40, (666.0-526.0)/15, 526.0)	/* Frequency modeling */
1265 	DISCRETE_MULTADD(NODE_42, 1, NODE_40, (65.0-37.0)/15, 37.0)	/* Duty Cycle modeling */
1266 
1267 	DISCRETE_SQUAREWAVE(FIRETRUCK_SIRENSND, FIRETRUCK_ATTRACT_EN, NODE_41, 31.3, NODE_42, 0, 0)	/* VCO */
1268 
1269 	/************************************************/
1270 	/* Crash circuit is built around a noise        */
1271 	/* generator built from 2 shift registers that  */
1272 	/* are clocked by the 2V signal.                */
1273 	/* 2V = HSYNC/4                                 */
1274 	/*    = 15750/4                                 */
1275 	/* Output is binary weighted with 4 bits of     */
1276 	/* crash volume.                                */
1277 	/* Volume is inverted by input register mapping */
1278 	/************************************************/
1279 	DISCRETE_LFSR_NOISE(FIRETRUCK_NOISE, FIRETRUCK_ATTRACT_EN, FIRETRUCK_ATTRACT_EN, 15750.0/4, 1.0, 0, 0, &firetrk_lfsr)
1280 
1281 	DISCRETE_MULTIPLY(FIRETRUCK_CRASHSND, 1, FIRETRUCK_NOISE, FIRETRUCK_CRASHSND_DATA)
1282 
1283 	/************************************************/
1284 	/* Skid circuit takes the noise output from     */
1285 	/* the crash circuit and applies +ve feedback   */
1286 	/* to cause oscillation. There is also an RC    */
1287 	/* filter on the input to the feedback cct.     */
1288 	/* RC is 2.2K & 2.2uF                           */
1289 	/* Feedback cct is modelled by using the RC out */
1290 	/* as the frequency input on a VCO,             */
1291 	/* breadboarded freq range as:                  */
1292 	/*  0 = 1380Hz, 32% duty                        */
1293 	/*  1 =  626Hz, 13% duty                        */
1294 	/************************************************/
1295 	DISCRETE_INVERT(NODE_60, FIRETRUCK_NOISE)
1296 	DISCRETE_RCFILTER(NODE_61, 1, NODE_60, 2200, 2.2e-6)
1297 	DISCRETE_MULTADD(NODE_62, 1, NODE_61, 1380.0-626.0, 626.0+((1380.0-626.0)/2))	/* Frequency */
1298 	DISCRETE_MULTADD(NODE_63, 1, NODE_61, 32.0-13.0, 13.0+((32.0-13.0)/2))		/* Duty */
1299 	DISCRETE_SQUAREWAVE(FIRETRUCK_SKIDSND, FIRETRUCK_SKIDSND_EN, NODE_62, 142.4, NODE_63, 0, 0.0)
1300 
1301 	/************************************************/
1302 	/* Bell circuit -                               */
1303 	/* The Hsync signal is put into a div 16        */
1304 	/* counter.                                     */
1305 	/************************************************/
1306 	DISCRETE_RCDISC(NODE_70, FIRETRUCK_BELLSND_EN, 500, 33000, 1.0e-5)
1307 
1308 	DISCRETE_SQUAREWFIX(FIRETRUCK_BELLSND, 1, 15750.0/16, NODE_70, 50.0, 0, 0.0)
1309 
1310 	/************************************************/
1311 	/* Extended play circuit is just the 8V signal  */
1312 	/* 8V = HSYNC/16                                */
1313 	/*    = 15750/16                                */
1314 	/************************************************/
1315 	DISCRETE_SQUAREWFIX(FIRETRUCK_XTNDPLY, FIRETRUCK_XTNDPLY_EN, 15750.0/16, 1000.0, 50.0, 0, 0.0)
1316 
1317 	/************************************************/
1318 	/* Combine all 7 sound sources.                 */
1319 	/* Add some final gain to get to a good sound   */
1320 	/* level.                                       */
1321 	/************************************************/
1322 	DISCRETE_ADDER4(NODE_90, 1, FIRETRUCK_MOTORSND, FIRETRUCK_HORNSND, FIRETRUCK_SIRENSND, FIRETRUCK_CRASHSND)
1323 	DISCRETE_ADDER4(NODE_91, 1, NODE_90, FIRETRUCK_SKIDSND, FIRETRUCK_BELLSND, FIRETRUCK_XTNDPLY)
1324 	DISCRETE_GAIN(NODE_92, NODE_91, 65534.0/(127.0+213.6+31.3+452.2+142.4+213.6+1000))
1325 
1326 	DISCRETE_OUTPUT(NODE_92, 100)
1327 DISCRETE_SOUND_END
1328 
1329 
1330 /************************************************************************/
1331 /* superbug Sound System Analog emulation                               */
1332 /************************************************************************/
1333 
1334 /* Nodes - Inputs */
1335 #define SUPERBUG_MOTORSND_DATA		NODE_01
1336 #define SUPERBUG_CRASHSND_DATA		NODE_02
1337 #define SUPERBUG_SKIDSND_EN		NODE_03
1338 #define SUPERBUG_ATTRACT_EN		NODE_04
1339 #define SUPERBUG_ASRSND_EN		NODE_05
1340 /* Nodes - Sounds */
1341 #define SUPERBUG_MOTORSND		NODE_10
1342 #define SUPERBUG_CRASHSND		NODE_11
1343 #define SUPERBUG_SKIDSND		NODE_12
1344 #define SUPERBUG_ASRSND			NODE_13
1345 #define SUPERBUG_NOISE			NODE_14
1346 #define SUPERBUG_FINAL_MIX		NODE_15
1347 
1348 static DISCRETE_SOUND_START(superbug_sound_interface)
1349 	/************************************************/
1350 	/* Super Bug sound system: 4 Sound Sources      */
1351 	/*                     Relative Volume          */
1352 	/*    1) Motor             38.80%               */
1353 	/*    2) Crash             63.01%               */
1354 	/*    3) Screech/Skid      25.52%               */
1355 	/*    3) ASR              100.00%               */
1356 	/* Relative volumes calculated from resitor     */
1357 	/* network in combiner circuit                  */
1358 	/*                                              */
1359 	/*  Super Bug Discrete sound mapping via:       */
1360 	/*     discrete_sound_w($register,value)        */
1361 	/*  We use the same address # as firetrk        */
1362 	/*  $00 - Motorsound frequency                  */
1363 	/*  $03 - Crash volume                          */
1364 	/*  $04 - Skid enable                           */
1365 	/*  $06 - Attract mode                          */
1366 	/*  $07 - ASR                                   */
1367 	/*                                              */
1368 	/************************************************/
1369 
1370 	/************************************************/
1371 	/* Input register mapping for superbug          */
1372 	/************************************************/
1373 	/*                   NODE                 ADDR   MASK   GAIN    OFFSET  INIT */
1374 	DISCRETE_INPUT (SUPERBUG_MOTORSND_DATA  , 0x00, 0x000f,                  0.0)
1375 	DISCRETE_INPUTX(SUPERBUG_CRASHSND_DATA  , 0x03, 0x000f, 630.1/15.0, 0,   0.0)
1376 	DISCRETE_INPUT (SUPERBUG_SKIDSND_EN     , 0x04, 0x000f,                  0.0)
1377 	DISCRETE_INPUT (SUPERBUG_ATTRACT_EN     , 0x06, 0x000f,                  0.0)
1378 	DISCRETE_INPUT (SUPERBUG_ASRSND_EN      , 0x07, 0x000f,                  0.0)
1379 
1380 	/************************************************/
1381 	/* Motor sound circuit is based on a 556 VCO    */
1382 	/* with the input frequency set by the MotorSND */
1383 	/* latch (4 bit). This freqency is then used to */
1384 	/* driver a modulo 12 counter, with div6 & div4 */
1385 	/* summed as the output of the circuit.         */
1386 	/* VCO Output is Sq wave = 27-382Hz             */
1387 	/*  F1 freq - (Div6)                            */
1388 	/*  F2 freq = (Div4)                            */
1389 	/* To generate the frequency we take the freq.  */
1390 	/* diff. and /15 to get all the steps between   */
1391 	/* 0 - 15.  Then add the low frequency and send */
1392 	/* that value to a squarewave generator.        */
1393 	/* Also as the frequency changes, it ramps due  */
1394 	/* to a 10uf capacitor on the R-ladder.         */
1395 	/* Note the VCO freq. is controlled by a 250k   */
1396 	/* pot.  The freq. used here is for the pot set */
1397 	/* to 125k.  The low freq is allways the same.  */
1398 	/* This adjusts the high end.                   */
1399 	/* 0k = 214Hz.   250k = 4416Hz                  */
1400 	/************************************************/
1401 	DISCRETE_RCFILTER(NODE_20, 1, SUPERBUG_MOTORSND_DATA, 123000, 10e-6)
1402 	DISCRETE_ADJUSTMENT(NODE_21, 1, (214.0-27.0)/12/15, (4416.0-27.0)/12/15, (382.0-27.0)/12/15, DISC_LOGADJ, "Motor RPM")
1403 	DISCRETE_MULTIPLY(NODE_22, 1, NODE_20, NODE_21)
1404 
1405 	DISCRETE_MULTADD(NODE_23, 1, NODE_22, 2, 27.0/6)		/* F1 = /12*2 = /6 */
1406 	DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (388.0/2), 50.0, 0, 0)
1407 	DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
1408 
1409 	DISCRETE_MULTADD(NODE_26, 1, NODE_22, 3, 27.0/4)		/* F2 = /12*3 = /4*/
1410 	DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (388.0/2), 50.0, 0, 0)
1411 	DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
1412 
1413 	DISCRETE_ADDER2(SUPERBUG_MOTORSND, SUPERBUG_ATTRACT_EN, NODE_25, NODE_28)
1414 
1415 	/************************************************/
1416 	/* Crash circuit is built around a noise        */
1417 	/* generator built from 2 shift registers that  */
1418 	/* are clocked by the 2V signal.                */
1419 	/* 2V = HSYNC/4                                 */
1420 	/*    = 15750/4                                 */
1421 	/* Output is binary weighted with 4 bits of     */
1422 	/* crash volume.                                */
1423 	/* Volume is inverted by input register mapping */
1424 	/************************************************/
1425 	DISCRETE_LFSR_NOISE(SUPERBUG_NOISE, SUPERBUG_ATTRACT_EN, SUPERBUG_ATTRACT_EN, 15750.0/4, 1.0, 0, 0, &firetrk_lfsr)
1426 
1427 	DISCRETE_MULTIPLY(NODE_30, 1, SUPERBUG_NOISE, SUPERBUG_CRASHSND_DATA)
1428 	DISCRETE_RCFILTER(SUPERBUG_CRASHSND, 1, NODE_30, 545, 1e-7)
1429 
1430 	/************************************************/
1431 	/* Skid circuit takes the noise output from     */
1432 	/* the crash circuit and applies +ve feedback   */
1433 	/* to cause oscillation. There is also an RC    */
1434 	/* filter on the input to the feedback cct.     */
1435 	/* RC is 2.2K & 2.2uF                           */
1436 	/* Feedback cct is modelled by using the RC out */
1437 	/* as the frequency input on a VCO,             */
1438 	/* breadboarded freq range as:                  */
1439 	/*  0 = 1380Hz, 32% duty                        */
1440 	/*  1 =  626Hz, 13% duty                        */
1441 	/************************************************/
1442 	DISCRETE_INVERT(NODE_40, SUPERBUG_NOISE)
1443 	DISCRETE_RCFILTER(NODE_41, 1, NODE_40, 2200, 2.2e-6)
1444 	DISCRETE_MULTADD(NODE_42, 1, NODE_41, 1380.0-626.0, 626.0+((1380.0-626.0)/2))	/* Frequency */
1445 	DISCRETE_MULTADD(NODE_43, 1, NODE_41, 32.0-13.0, 13.0+((32.0-13.0)/2))		/* Duty */
1446 	DISCRETE_SQUAREWAVE(SUPERBUG_SKIDSND, SUPERBUG_SKIDSND_EN, NODE_42, 142.4, NODE_43, 0, 0.0)
1447 
1448 	/************************************************/
1449 	/* ASR circuit is just the 8V signal            */
1450 	/* 8V = HSYNC/16                                */
1451 	/*    = 15750/16                                */
1452 	/************************************************/
1453 	DISCRETE_SQUAREWFIX(SUPERBUG_ASRSND, SUPERBUG_ASRSND_EN, 15750.0/16, 1000.0, 50.0, 0, 0.0)
1454 
1455 	/************************************************/
1456 	/* Combine all 4 sound sources.                 */
1457 	/* Add some final gain to get to a good sound   */
1458 	/* level.                                       */
1459 	/************************************************/
1460 	DISCRETE_ADDER4(NODE_90, 1, SUPERBUG_MOTORSND, SUPERBUG_CRASHSND, SUPERBUG_SKIDSND, SUPERBUG_ASRSND)
1461 	DISCRETE_GAIN(SUPERBUG_FINAL_MIX, NODE_90, 65534.0/(388.0+630.1+255.2+1000.0))
1462 
1463 	DISCRETE_OUTPUT(SUPERBUG_FINAL_MIX, 100)
1464 DISCRETE_SOUND_END
1465 
1466 
1467 /************************************************************************/
1468 /* montecar Sound System Analog emulation                               */
1469 /************************************************************************/
1470 
1471 /* Nodes - Inputs */
1472 #define MONTECAR_MOTORSND_DATA		NODE_01
1473 #define MONTECAR_DRONE_MOTORSND_DATA	NODE_02
1474 #define MONTECAR_CRASHSND_DATA		NODE_03
1475 #define MONTECAR_SKIDSND_EN		NODE_04
1476 #define MONTECAR_DRONE_VOLUME_DATA	NODE_05
1477 #define MONTECAR_ATTRACT_EN		NODE_06
1478 #define MONTECAR_BEEPSND_EN		NODE_07
1479 /* Nodes - Sounds */
1480 #define MONTECAR_MOTORSND		NODE_10
1481 #define MONTECAR_BEEPSND		NODE_11
1482 #define MONTECAR_DRONESND		NODE_12
1483 #define MONTECAR_CRASHSND		NODE_13
1484 #define MONTECAR_SKIDSND		NODE_14
1485 #define MONTECAR_NOISE			NODE_15
1486 #define MONTECAR_FINAL_MIX		NODE_16
1487 
1488 static DISCRETE_SOUND_START(montecar_sound_interface)
1489 	/************************************************/
1490 	/* Monte Carlo sound system: 5 Sound Sources    */
1491 	/*                     Relative Volume          */
1492 	/*    1) Motor             79.55%               */
1493 	/*    2) Crash            100.00%               */
1494 	/*    3) Screech/Skid      62.31%               */
1495 	/*    4) Drone Motor       71.08%               */
1496 	/*    5) Beep              89.02%               */
1497 	/* Relative volumes calculated from gain        */
1498 	/* formula for inverting amplifier.             */
1499 	/*                                              */
1500 	/*  Monte Carlo Discrete sound mapping via:     */
1501 	/*     discrete_sound_w($register,value)        */
1502 	/*  We use the same address # as firetrk        */
1503 	/*  $00 - Motorsound frequency                  */
1504 	/*  $02 - Drone Motorsound frequency            */
1505 	/*  $03 - Crash volume                          */
1506 	/*  $04 - Skid enable                           */
1507 	/*  $05 - Drone Motorsound volume               */
1508 	/*  $06 - Attract mode                          */
1509 	/*  $07 - Beep                                  */
1510 	/*                                              */
1511 	/************************************************/
1512 
1513 	/************************************************/
1514 	/* Input register mapping for montecar          */
1515 	/************************************************/
1516 	/*                   NODE                       ADDR   MASK   GAIN    OFFSET  INIT */
1517 	DISCRETE_INPUTX(MONTECAR_MOTORSND_DATA        , 0x00, 0x000f, -1.0   , 15.0,   0.0)
1518 	DISCRETE_INPUTX(MONTECAR_DRONE_MOTORSND_DATA  , 0x02, 0x000f, -1.0   , 15.0,   0.0)
1519 	DISCRETE_INPUTX(MONTECAR_CRASHSND_DATA        , 0x03, 0x000f, 1000.0/15.0, 0,  0.0)
1520 	DISCRETE_INPUT (MONTECAR_SKIDSND_EN           , 0x04, 0x000f,                  0.0)
1521 	DISCRETE_INPUT (MONTECAR_DRONE_VOLUME_DATA    , 0x05, 0x000f,                  0.0)
1522 	DISCRETE_INPUT (MONTECAR_ATTRACT_EN           , 0x06, 0x000f,                  0.0)
1523 	DISCRETE_INPUT (MONTECAR_BEEPSND_EN           , 0x07, 0x000f,                  0.0)
1524 
1525 	/************************************************/
1526 	/* Motor sound circuit is based on a 556 VCO    */
1527 	/* with the input frequency set by the MotorSND */
1528 	/* latch (4 bit). This freqency is then used to */
1529 	/* driver a modulo 12 counter, with div6, 4 & 3 */
1530 	/* summed as the output of the circuit.         */
1531 	/* VCO Output is Sq wave = 95-458Hz             */
1532 	/*  F1 freq - (Div6)                            */
1533 	/*  F2 freq = (Div4)                            */
1534 	/*  F3 freq = (Div3) 33.3% duty, 33.3 deg phase */
1535 	/* To generate the frequency we take the freq.  */
1536 	/* diff. and /15 to get all the steps between   */
1537 	/* 0 - 15.  Then add the low frequency and send */
1538 	/* that value to a squarewave generator.        */
1539 	/* Also as the frequency changes, it ramps due  */
1540 	/* to a 4.7uf capacitor on the R-ladder.        */
1541 	/* Note the VCO freq. is controlled by a 250k   */
1542 	/* pot.  The freq. used here is for the pot set */
1543 	/* to 125k.  The low freq is allways the same.  */
1544 	/* This adjusts the high end.                   */
1545 	/* 0k = 289Hz.   250k = 4500Hz                  */
1546 	/************************************************/
1547 	DISCRETE_RCFILTER(NODE_20, 1, MONTECAR_MOTORSND_DATA, 123000, 4.7e-6)
1548 	DISCRETE_ADJUSTMENT(NODE_21, 1, (289.0-95.0)/12/15, (4500.0-95.0)/12/15, (458.0-95.0)/12/15, DISC_LOGADJ, "Motor 1 RPM")
1549 	DISCRETE_MULTIPLY(NODE_22, 1, NODE_20, NODE_21)
1550 
1551 	DISCRETE_MULTADD(NODE_23, 1, NODE_22, 2, 95.0/6)	/* F1 = /12*2 = /6 */
1552 	DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (795.5/3), 50.0, 0, 0)
1553 	DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
1554 
1555 	DISCRETE_MULTADD(NODE_26, 1, NODE_22, 3, 95.0/4)	/* F2 = /12*3 = /4 */
1556 	DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (795.5/3), 50.0, 0, 0)
1557 	DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
1558 
1559 	DISCRETE_MULTADD(NODE_29, 1, NODE_22, 4, 95.0/3)	/* F3 = /12*4 = /3 */
1560 	DISCRETE_SQUAREWAVE(NODE_30, 1, NODE_29, (795.5/3), 100.0/3, 0, 360.0/3)
1561 	DISCRETE_RCFILTER(NODE_31, 1, NODE_30, 10000, 1e-7)
1562 
1563 	DISCRETE_ADDER3(MONTECAR_MOTORSND, MONTECAR_ATTRACT_EN, NODE_25, NODE_28, NODE_31)
1564 
1565 	/************************************************/
1566 	/* Drone motor sound is basically the same as   */
1567 	/* the regular car but with a volume control.   */
1568 	/* Also I shifted the frequencies up for it to  */
1569 	/* sound different from the player's car.       */
1570 	/************************************************/
1571 	DISCRETE_RCFILTER(NODE_40, 1, MONTECAR_DRONE_MOTORSND_DATA, 123000, 4.7e-6)
1572 	DISCRETE_ADJUSTMENT(NODE_41, 1, (289.0-95.0)/12/15, (4500.0-95.0)/12/15, (650.0-95.0)/12/15, DISC_LOGADJ, "Motor 2 RPM")
1573 	DISCRETE_MULTIPLY(NODE_42, 1, NODE_40, NODE_41)
1574 
1575 	DISCRETE_MULTADD(NODE_43, 1, NODE_42, 2, 95.0/6)	/* F1 = /12*2 = /6 */
1576 	DISCRETE_SQUAREWAVE(NODE_44, 1, NODE_43, (710.8/15/3), 50.0, 0, 0)
1577 	DISCRETE_RCFILTER(NODE_45, 1, NODE_44, 10000, 1e-7)
1578 
1579 	DISCRETE_MULTADD(NODE_46, 1, NODE_42, 3, 95.0/4)	/* F2 = /12*3 = /4 */
1580 	DISCRETE_SQUAREWAVE(NODE_47, 1, NODE_46, (710.8/15/3), 50.0, 0, 0)
1581 	DISCRETE_RCFILTER(NODE_48, 1, NODE_47, 10000, 1e-7)
1582 
1583 	DISCRETE_MULTADD(NODE_49, 1, NODE_42, 4, 95.0/3)	/* F3 = /12*4 = /3 */
1584 	DISCRETE_SQUAREWAVE(NODE_50, 1, NODE_49, (710.8/15/3), 100.0/3, 0, 360.0/3)
1585 	DISCRETE_RCFILTER(NODE_51, 1, NODE_50, 10000, 1e-7)
1586 
1587 	DISCRETE_ADDER3(NODE_52, MONTECAR_ATTRACT_EN, NODE_45, NODE_48, NODE_51)
1588 	DISCRETE_MULTIPLY(MONTECAR_DRONESND, 1, NODE_52, MONTECAR_DRONE_VOLUME_DATA)
1589 
1590 	/************************************************/
1591 	/* Crash circuit is built around a noise        */
1592 	/* generator built from 2 shift registers that  */
1593 	/* are clocked by the 2V signal.                */
1594 	/* 2V = HSYNC/4                                 */
1595 	/*    = 15750/4                                 */
1596 	/* Output is binary weighted with 4 bits of     */
1597 	/* crash volume.                                */
1598 	/* Volume is inverted by input register mapping */
1599 	/************************************************/
1600 	DISCRETE_LFSR_NOISE(MONTECAR_NOISE, MONTECAR_ATTRACT_EN, MONTECAR_ATTRACT_EN, 15750.0/4, 1.0, 0, 0, &firetrk_lfsr)
1601 
1602 	DISCRETE_MULTIPLY(MONTECAR_CRASHSND, 1, MONTECAR_NOISE, MONTECAR_CRASHSND_DATA)
1603 
1604 	/************************************************/
1605 	/* Skid circuit takes the noise output from     */
1606 	/* the crash circuit and applies +ve feedback   */
1607 	/* to cause oscillation. There is also an RC    */
1608 	/* filter on the input to the feedback cct.     */
1609 	/* RC is 2.2K & 2.2uF                           */
1610 	/* Feedback cct is modelled by using the RC out */
1611 	/* as the frequency input on a VCO,             */
1612 	/* breadboarded freq range as:                  */
1613 	/*  0 = 1380Hz, 32% duty                        */
1614 	/*  1 =  626Hz, 13% duty                        */
1615 	/************************************************/
1616 	DISCRETE_INVERT(NODE_70, MONTECAR_NOISE)
1617 	DISCRETE_RCFILTER(NODE_71, 1, NODE_70, 2200, 2.2e-6)
1618 	DISCRETE_MULTADD(NODE_72, 1, NODE_71, 1380.0-626.0, 626.0+((1380.0-626.0)/2))	/* Frequency */
1619 	DISCRETE_MULTADD(NODE_73, 1, NODE_71, 32.0-13.0, 13.0+((32.0-13.0)/2))		/* Duty */
1620 	DISCRETE_SQUAREWAVE(MONTECAR_SKIDSND, MONTECAR_SKIDSND_EN, NODE_72, 142.4, NODE_73, 0, 0.0)
1621 
1622 	/************************************************/
1623 	/* Beep circuit is just the 8V signal           */
1624 	/* 8V = HSYNC/16                                */
1625 	/*    = 15750/16                                */
1626 	/************************************************/
1627 	DISCRETE_SQUAREWFIX(MONTECAR_BEEPSND, MONTECAR_BEEPSND_EN, 15750.0/16, 890.2, 50.0, 0, 0.0)
1628 
1629 	/************************************************/
1630 	/* Combine all 5 sound sources.                 */
1631 	/* Add some final gain to get to a good sound   */
1632 	/* level.                                       */
1633 	/************************************************/
1634 	DISCRETE_ADDER3(NODE_90, 1, MONTECAR_MOTORSND, MONTECAR_CRASHSND, MONTECAR_SKIDSND)
1635 	DISCRETE_ADDER3(NODE_91, 1, NODE_90, MONTECAR_BEEPSND, MONTECAR_DRONESND)
1636 	DISCRETE_GAIN(MONTECAR_FINAL_MIX, NODE_91, 65534.0/(795.5+710.8+1000.0+623.1+890.2))
1637 
1638 	DISCRETE_OUTPUT(MONTECAR_FINAL_MIX, 100)
1639 DISCRETE_SOUND_END
1640 
1641 
1642 static MACHINE_DRIVER_START( firetrk )
1643 
1644 	/* basic machine hardware */
1645 	MDRV_CPU_ADD_TAG("main", M6800, 12096000 / 12)	/* 750Khz during service mode */
1646 	MDRV_CPU_MEMORY(firetrk_readmem, firetrk_writemem)
1647 	MDRV_CPU_VBLANK_INT(firetrk_interrupt, 1)
1648 
1649 	MDRV_FRAMES_PER_SECOND(60)
1650 	MDRV_VBLANK_DURATION((int) ((22. * 1000000) / (262. * 60) + 0.5))
1651 
1652 	MDRV_MACHINE_INIT(firetrk)
1653 
1654 	/* video hardware */
1655 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1656 	MDRV_SCREEN_SIZE(320, 240)
1657 	MDRV_VISIBLE_AREA(0, 319, 0, 239)
1658 	MDRV_GFXDECODE(firetrk_gfxdecodeinfo)
1659 
1660 	MDRV_PALETTE_INIT(firetrk)
1661 	MDRV_PALETTE_LENGTH(4)
1662 	MDRV_COLORTABLE_LENGTH(28)
1663 
1664 	MDRV_VIDEO_START(firetrk)
1665 	MDRV_VIDEO_EOF(firetrk)
1666 	MDRV_VIDEO_UPDATE(firetrk)
1667 
1668 	/* sound hardware */
1669 	MDRV_SOUND_ADD_TAG("discrete", DISCRETE, firetrk_sound_interface)
1670 MACHINE_DRIVER_END
1671 
1672 
1673 static MACHINE_DRIVER_START( superbug )
1674 
1675 	/* basic machine hardware */
1676 	MDRV_IMPORT_FROM(firetrk)
1677 	MDRV_CPU_REPLACE("main", M6800, 12096000 / 16)
1678 	MDRV_CPU_MEMORY(superbug_readmem, superbug_writemem)
1679 
1680 	/* video hardware */
1681 	MDRV_GFXDECODE(superbug_gfxdecodeinfo)
1682 
1683 	MDRV_PALETTE_INIT(firetrk)
1684 	MDRV_PALETTE_LENGTH(4)
1685 	MDRV_COLORTABLE_LENGTH(28)
1686 
1687 	/* sound hardware */
1688 	MDRV_SOUND_REPLACE("discrete", DISCRETE, superbug_sound_interface)
1689 MACHINE_DRIVER_END
1690 
1691 
1692 static MACHINE_DRIVER_START( montecar )
1693 
1694 	/* basic machine hardware */
1695 	MDRV_IMPORT_FROM(firetrk)
1696 	MDRV_CPU_REPLACE("main", M6800, 12096000 / 12)	/* 750Khz during service mode */
1697 	MDRV_CPU_MEMORY(montecar_readmem, montecar_writemem)
1698 
1699 	/* video hardware */
1700 	MDRV_GFXDECODE(montecar_gfxdecodeinfo)
1701 
1702 	MDRV_PALETTE_INIT(montecar)
1703 	MDRV_PALETTE_LENGTH(26)
1704 	MDRV_COLORTABLE_LENGTH(46)
1705 
1706 	/* sound hardware */
1707 	MDRV_SOUND_REPLACE("discrete", DISCRETE, montecar_sound_interface)
1708 MACHINE_DRIVER_END
1709 
1710 
1711 ROM_START( firetrk )
1712 	ROM_REGION( 0x10000, REGION_CPU1, 0 )
1713 	ROM_LOAD(          "32823-02.c1", 0x2000, 0x800, CRC(9570bdd3) SHA1(4d26a9490d05d53da55fc59459a4dce5bca6c761) )
1714 	ROM_LOAD(          "32824-01.d1", 0x2800, 0x800, CRC(a5fc5629) SHA1(bf20510d8623eda2740ff296a7813a3e6f7ec76e) )
1715 	ROM_LOAD_NIB_HIGH( "32816-01.k1", 0x3000, 0x800, CRC(c0535598) SHA1(15cb6985b0b22140b7fae1e050e0b63dd4d0f793) )
1716 	ROM_LOAD_NIB_LOW ( "32820-01.k2", 0x3000, 0x800, CRC(5733f9ed) SHA1(0f19a40793dadfb7de2c2b54a44929b414d0f4ed) )
1717 	ROM_LOAD_NIB_HIGH( "32815-01.j1", 0x3800, 0x800, CRC(506ee759) SHA1(d111356c84f3d9942a27fbe243e716d14c258a16) )
1718 	ROM_RELOAD(                       0xF800, 0x800 )
1719 	ROM_LOAD_NIB_LOW ( "32819-01.j2", 0x3800, 0x800, CRC(f1c3fa87) SHA1(d75cf4ad0bcac3289c068837fc24cfe84ce7542a) )
1720 	ROM_RELOAD(                       0xF800, 0x800 )
1721 
1722 	ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE ) /* text */
1723 	ROM_LOAD( "32827-01.r3", 0x000, 0x800, CRC(cca31d2b) SHA1(78235176c9cb2abd73a5778b54560b87634ca0e4) )
1724 
1725 	ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE ) /* tiles */
1726 	ROM_LOAD( "32828-02.f5", 0x000, 0x800, CRC(68ef5f19) SHA1(df227d6a57bba6298ebdeb5a118878da21d889f6) )
1727 
1728 	ROM_REGION( 0x0400, REGION_GFX3, ROMREGION_DISPOSE ) /* car */
1729 	ROM_LOAD( "32831-01.p7", 0x000, 0x400, CRC(bb8d144f) SHA1(9a1355ea6f88e96926c32e0e36ac0525b0243906) )
1730 
1731 	ROM_REGION( 0x1000, REGION_GFX4, ROMREGION_DISPOSE ) /* trailer */
1732 	ROM_LOAD( "32829-01.j5", 0x000, 0x800, CRC(e7267d71) SHA1(7132b98622e899227a378ba8c010dde39c479978) )
1733 	ROM_LOAD( "32830-01.l5", 0x800, 0x800, CRC(e4d8b685) SHA1(30978658899c83e32dabdf554a13cf5e5235c725) )
1734 
1735 	ROM_REGION( 0x100, REGION_PROMS, 0 )
1736 	ROM_LOAD( "9114.prm", 0x0000, 0x100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* sync */
1737 ROM_END
1738 
1739 
1740 ROM_START( superbug )
1741 	ROM_REGION( 0x10000, REGION_CPU1, 0 )
1742 	ROM_LOAD( "9121.d1", 0x0800, 0x800, CRC(350df308) SHA1(b957c830bb95e0752ea9793e3edcfdd52235e0ab) )
1743 	ROM_LOAD( "9122.c1", 0x1000, 0x800, CRC(eb6e3e37) SHA1(5237f6bd3a7a3eca737c728296230cf0d1f436b0) )
1744 	ROM_LOAD( "9123.a1", 0x1800, 0x800, CRC(f42c6bbe) SHA1(41470984fe951eac9f6dc77862b00ecfe8aaa51d) )
1745 	ROM_RELOAD(          0xF800, 0x800 )
1746 
1747 	ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE ) /* text */
1748 	ROM_LOAD( "9124.m3", 0x0000, 0x400, CRC(f8af8dd5) SHA1(49ab85550f546f85048e2f73163837c602dde568) )
1749 	ROM_LOAD( "9471.n3", 0x0400, 0x400, CRC(52250698) SHA1(cc55254c54dbcd3fd1465c82a715f2e567f44951) )
1750 
1751 	ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE ) /* tiles */
1752 	ROM_LOAD( "9126.f5", 0x0000, 0x400, CRC(ee695137) SHA1(295fdfef88e0c841fe8ad505151ca0837e77ef83) )
1753 	ROM_LOAD( "9472.h5", 0x0400, 0x400, CRC(5ddb80ac) SHA1(bdbbbba6efdd4cca75630d203f7c7eaf41b1a32d) )
1754 	ROM_LOAD( "9127.e5", 0x0800, 0x400, CRC(be1386b4) SHA1(17e92df58b25075ec7a383a958db02b42066578a) )
1755 	ROM_RELOAD(          0x0C00, 0x400 )
1756 
1757 	ROM_REGION( 0x0400, REGION_GFX3, ROMREGION_DISPOSE ) /* car */
1758 	ROM_LOAD( "9125.k6", 0x0000, 0x400, CRC(a3c835df) SHA1(e9b6dba1919c389bb55a8fe3c074b6702322e4e5) )
1759 
1760 	ROM_REGION( 0x0100, REGION_PROMS, 0 )
1761 	ROM_LOAD( "9114.prm", 0x0000, 0x100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* sync */
1762 ROM_END
1763 
1764 
1765 ROM_START( montecar )
1766 	ROM_REGION( 0x10000, REGION_CPU1, 0 )
1767 	ROM_LOAD( "35766-01.h1", 0x2000, 0x800, CRC(d3695f09) SHA1(8aa3b3921acd0d2c3230d610843042613defcba9) )
1768     ROM_LOAD( "35765-01.f1", 0x2800, 0x800, CRC(9491a7ee) SHA1(712959c5f97be3db7be1d5bd70c780d4da2f6d47) )
1769     ROM_LOAD( "35764-01.d1", 0x3000, 0x800, CRC(899aaf4e) SHA1(84fab58d135ffc6e4b076d438b4d588b394364b6) )
1770 	ROM_LOAD( "35763-01.c1", 0x3800, 0x800, CRC(378bfe47) SHA1(fd6b28907340a2ffc82a4e634273c3f03ab76642) )
1771 	ROM_RELOAD(              0xF800, 0x800 )
1772 
1773 	ROM_REGION( 0x0400, REGION_GFX1, ROMREGION_DISPOSE ) /* text */
1774 	ROM_LOAD( "35778-01.m4", 0x0000, 0x400, CRC(294ee08e) SHA1(fbb0656468a027b2795073d811affc93c50994ec) )
1775 
1776 	ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE ) /* tiles */
1777 	ROM_LOAD( "35775-01.e6", 0x0000, 0x800, CRC(504106e9) SHA1(33eae2cf39b24eaf5b438a2af3060b2fdc0012b5) )
1778 
1779 	ROM_REGION( 0x0800, REGION_GFX3, ROMREGION_DISPOSE ) /* car */
1780 	ROM_LOAD( "35779-01.m6", 0x0000, 0x800, CRC(4fbb3fe1) SHA1(4267cd098a19892322d21f8fa7b55896158f8d6a) )
1781 
1782 	ROM_REGION( 0x0800, REGION_GFX4, ROMREGION_DISPOSE ) /* drone */
1783 	ROM_LOAD( "35780-01.b6", 0x0000, 0x800, CRC(9d0f1374) SHA1(52d1130d48dc877e1e47e26b2e4548633ed91b21) )
1784 
1785 	ROM_REGION( 0x300, REGION_PROMS, 0 )
1786 	ROM_LOAD( "35785-01.e7", 0x0000, 0x200, CRC(386c543a) SHA1(04edda180e6ff432b438947ffa46621ca0a823b4) ) /* color */
1787     ROM_LOAD( "9114.prm",    0x0200, 0x100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* sync */
1788 ROM_END
1789 
1790 
1791 GAME( 1977, superbug, 0, superbug, superbug, superbug, ROT270, "Atari", "Super Bug" )
1792 GAME( 1978, firetrk,  0, firetrk,  firetrk,  firetrk,  ROT270, "Atari", "Fire Truck" )
1793 GAME( 1979, montecar, 0, montecar, montecar, montecar, ROT270, "Atari", "Monte Carlo" )
1794