1 #include "../vidhrdw/gottlieb.c"
2 #include "../sndhrdw/gottlieb.c"
3 
4 /***************************************************************************
5 
6 Gottlieb driver : dedicated to Warren Davis, Jeff Lee, Tim Skelly & David Thiel
7 
8 driver by Fabrice Frances
9 
10 Notes:
11 There was a bug in the hardware of the GG1 and GG2 boards, which is not
12 emulated. The bug seems to have disappeared with the later revision of the
13 board, e.g the board used by 3Stooges and Mach3 don't seem to have it).
14 The bug was affecting the first character column (on horizontal games):
15 screen memory could be used, but whatever was stored in this column, always
16 the same character was displayed.
17 This led to two consequences:
18 - the image on the monitor had to be stretched so that the column was not
19   visible
20 - game designers were not using the first column. In fact, when the first
21   column was ejected from the screen, the last one was usually out too,
22   so it wasn't used either...
23 
24 ****************************************************************************
25 
26 Reactor: earlier version of the board, with a different memory map
27 
28 Main processor (8088 minimum mode)
29 0000-1fff RAM (NOT battery backed unlike all the others)
30 2000-2fff sprites
31 3000-37ff video ram
32 4000-4fff char generator ram
33 6000-67ff palette ram (palette of 16 colors)
34 7000-77ff i/o ports
35 8000-ffff ROM
36 
37 memory mapped ports:
38 
39 read:
40 7000    Dip switch
41 7001    Inputs 10-17
42 7002    trackball H
43 7003    trackball V
44 7004    Inputs 40-47
45 
46 write:
47 7000    watchdog reset
48 7001    trackball clear
49 7002    Outputs 20-27
50 7003    Flipflop outputs:
51 		b0: F/B priority
52 		b1: horiz. flip
53 		b2: vert. flip
54 		b3: Output 33
55 		b4: coin counter
56 		b5: left lamp (1P/3Lives start)
57 		b6: middle lamps (2P/3Lives start, 1P/7Lives start)
58 		b7: right lamp (2P/7Lives start)
59 7004    Outputs 40-47
60 
61 interrupts:
62 INTR not connected
63 NMI connected to vertical blank
64 
65 
66 
67 Gottlieb games memory map
68 
69 Main processor (8088 minimum mode)
70 0000-0fff RAM (battery backed)
71 1000-1fff RAM or ROM (selected with jumpers on the board)
72 2000-2fff RAM or ROM (selected with jumpers on the board)
73 3000-37ff sprites. The manual says there are 63 sprites (NOT 64),
74           but the Q*Bert object priority test leaves sprite #63 dangling, so
75 		  they are probably only 62.
76 3800-3fff video RAM
77 4000-4fff char generator RAM (can be replaced by a ROM twice as large,
78           selection made with jumpers on the board. If it's ROM, the CPU
79 		  cannot fully access it, I think it could read half the data if it
80 		  wanted to but none of the games do that)
81 5000-57ff palette ram (palette of 16 colors)
82 5800-5fff i/o ports
83 6000-ffff ROM (not necessarily fully populated)
84 
85 memory mapped ports:
86 
87 read:
88 5800    Dip switch
89 5801    Inputs 10-17
90 5802    trackball H (optional)
91 5803    trackball V (optional)
92 5804    Inputs 40-47
93 
94 write:
95 5800    watchdog reset
96 5801    trackball clear (optional)
97 5802    Outputs 20-27
98 5803    Flipflop outputs:
99 		b0: F/B priority
100 		b1: horiz. flip (sprite bank in Us vs. Them)
101 		b2: vert. flip (maybe genlock control in the laser disc games)
102 		b3: Output 33
103 		b4: coin counter (sprite bank in Q*Bert Qubes)
104 		b5: Q*Bert: kicker; Q*Bert Qubes: coin counter
105 		b5/b6: 3 Stooges: joystick input multiplexer
106 		b7: ?
107 5804    Outputs 40-47
108 
109 interrupts:
110 INTR not connected
111 NMI connected to vertical blank
112 
113 
114 
115 Sound processor (6502) memory map (earlier revision, used by games up to Krull):
116 0000-0fff RIOT (6532)
117 1000-1fff amplitude DAC
118 2000-2fff SC01 voice chip
119 3000-3fff voice clock DAC
120 4000-4fff expansion socket
121 5000-5fff expansion socket
122 6000-6fff expansion socket or ROM (selected with jumpers on the board)
123 7000-7fff ROM
124 (repeated in 8000-ffff, A15 only used in expansion socket)
125 
126 Use of I/Os on the RIOT:
127 both ports A and B are programmed as inputs, A is connected to the main
128 motherboard, and B has SW1 (test) connected on bit 6.
129 
130 interrupts:
131 INTR is connected to the RIOT, so an INTR can be generated by a variety
132 of sources, e.g active edge detection on PA7, or timer countdown.
133 It seems that all gottlieb games program the interrupt conditions so that
134 a positive active edge on PA7 triggers an interrupt, so the
135 main board ensures a command is correctly received by sending nul (0)
136 commands between two commands. Also, the timer interrupt is enabled but
137 doesn't seem to serve any purpose...(?)
138 
139 
140 In the later revision of the sound board, used from M.A.C.H. 3 onwards, there
141 are two 6502, two 8910, a DAC and a GI SP-0250 speech chip.
142 
143 
144 Video timings:
145 XTAL = 20 MHz
146 Horizontal video frequency: HSYNC = XTAL/4/318 = 15.72327 kHz
147 Video frequency: VSYNC = HSYNC/256 = 61.41903 Hz
148 VBlank duration: 1/VSYNC * (16/256) = 1017.6 us
149 
150 ***************************************************************************/
151 
152 #include "driver.h"
153 #include "vidhrdw/generic.h"
154 
155 
156 
157 int gottlieb_vh_start(void);
158 void gottlieb_vh_stop(void);
159 WRITE_HANDLER( gottlieb_characterram_w );
160 WRITE_HANDLER( gottlieb_video_outputs_w );
161 WRITE_HANDLER( usvsthem_video_outputs_w );
162 extern unsigned char *gottlieb_characterram;
163 WRITE_HANDLER( gottlieb_paletteram_w );
164 void gottlieb_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
165 
166 WRITE_HANDLER( gottlieb_sh_w );
167 
168 extern unsigned char *riot_ram;
169 READ_HANDLER( riot_ram_r );
170 READ_HANDLER( gottlieb_riot_r );
171 WRITE_HANDLER( riot_ram_w );
172 WRITE_HANDLER( gottlieb_riot_w );
173 WRITE_HANDLER( gottlieb_speech_w );
174 WRITE_HANDLER( gottlieb_speech_clock_DAC_w );
175 void gottlieb_sound_init(void);
176 READ_HANDLER( stooges_sound_input_r );
177 WRITE_HANDLER( stooges_8910_latch_w );
178 WRITE_HANDLER( stooges_sound_control_w );
179 WRITE_HANDLER( gottlieb_nmi_rate_w );
180 WRITE_HANDLER( gottlieb_cause_dac_nmi_w );
181 
182 
init_machine(void)183 static void init_machine(void)
184 {
185 	UINT8 *ram = memory_region(REGION_CPU1);
186 	cpu_setbank(1, &ram[0x8000]);
187 	cpu_setbank(2, &ram[0x0000]);
188 }
189 
190 
191 static int track[2];
192 
READ_HANDLER(gottlieb_track_0_r)193 READ_HANDLER( gottlieb_track_0_r )
194 {
195 	return input_port_2_r(offset) - track[0];
196 }
197 
READ_HANDLER(gottlieb_track_1_r)198 READ_HANDLER( gottlieb_track_1_r )
199 {
200 	return input_port_3_r(offset) - track[1];
201 }
202 
WRITE_HANDLER(gottlieb_track_reset_w)203 WRITE_HANDLER( gottlieb_track_reset_w )
204 {
205 	/* reset the trackball counters */
206 	track[0] = input_port_2_r(offset);
207 	track[1] = input_port_3_r(offset);
208 }
209 
210 static int joympx;
211 
READ_HANDLER(stooges_IN4_r)212 READ_HANDLER( stooges_IN4_r )
213 {
214 	int joy;
215 
216 
217 	switch (joympx)
218 	{
219 		case 0:
220 		default:
221 			joy = ((readinputport(4) >> 0) & 0x0f);	/* joystick 1 */
222 			break;
223 		case 1:
224 			joy = ((readinputport(5) >> 0) & 0x0f);	/* joystick 2 */
225 			break;
226 		case 2:
227 			joy = ((readinputport(5) >> 4) & 0x0f);	/* joystick 3 */
228 			break;
229 	}
230 
231 	return joy | (readinputport(4) & 0xf0);
232 }
233 
WRITE_HANDLER(reactor_output_w)234 WRITE_HANDLER( reactor_output_w )
235 {
236 	osd_led_w(0,(data & 0x20) >> 5);
237 	osd_led_w(1,(data & 0x40) >> 6);
238 	osd_led_w(2,(data & 0x80) >> 7);
239 	gottlieb_video_outputs_w(offset,data);
240 }
241 
WRITE_HANDLER(stooges_output_w)242 WRITE_HANDLER( stooges_output_w )
243 {
244 	joympx = (data >> 5) & 0x03;
245 	gottlieb_video_outputs_w(offset,data);
246 }
247 
248 
249 static int current_frame = 0x00001;
250 static int laserdisc_playing;
251 static int lasermpx;
252 
READ_HANDLER(gottlieb_laserdisc_status_r)253 READ_HANDLER( gottlieb_laserdisc_status_r )
254 {
255 	switch (offset)
256 	{
257 		case 0:
258 			return (current_frame >> 0) & 0xff;
259 			break;
260 		case 1:
261 			return (current_frame >> 8) & 0xff;
262 			break;
263 		case 2:
264 			if (lasermpx == 1)
265 				/* bits 0-2 frame number MSN */
266 				/* bit 3 audio buffer ready */
267 				/* bit 4 ready to send new laserdisc command? */
268 				/* bit 5 disc ready */
269 				/* bit 6 break in audio trasmission */
270 				/* bit 7 missing audio clock */
271 				return ((current_frame >> 16) & 0x07) | 0x10 | (rand() & 0x28);
272 			else	/* read audio buffer */
273 				return rand();
274 			break;
275 	}
276 
277 	return 0;
278 }
279 
WRITE_HANDLER(gottlieb_laserdisc_mpx_w)280 WRITE_HANDLER( gottlieb_laserdisc_mpx_w )
281 {
282 	lasermpx = data & 1;
283 }
284 
WRITE_HANDLER(gottlieb_laserdisc_command_w)285 WRITE_HANDLER( gottlieb_laserdisc_command_w )
286 {
287 	static int loop;
288 	int cmd;
289 	static int lastcmd;
290 
291 
292 	/* commands are written in three steps, the first two the command is */
293 	/* written (maybe one to load the latch, the other to start the send), */
294 	/* the third 0 (maybe to clear the latch) */
295 	if (data == 0) return;
296 	if (loop++ & 1) return;
297 
298 	if ((data & 0xe0) != 0x20)
299 	{
300 //logerror("error: laserdisc command %02x\n",data);
301 		return;
302 	}
303 
304 	cmd =	((data & 0x10) >> 4) |
305 			((data & 0x08) >> 2) |
306 			((data & 0x04) >> 0) |
307 			((data & 0x02) << 2) |
308 			((data & 0x01) << 4);
309 
310 //logerror("laserdisc command %02x -> %02x\n",data,cmd);
311 	if (lastcmd == 0x0b && (cmd & 0x10))	/* seek frame # */
312 	{
313 		current_frame = (current_frame << 4) | (cmd & 0x0f);
314 	}
315 	else
316 	{
317 		if (cmd == 0x04)	/* step forward */
318 		{
319 			laserdisc_playing = 0;
320 			current_frame++;
321 		}
322 		if (cmd == 0x05) laserdisc_playing = 1;	/* play */
323 		if (cmd == 0x0f) laserdisc_playing = 0;	/* stop */
324 		if (cmd == 0x0b) laserdisc_playing = 0;	/* seek frame */
325 		lastcmd = cmd;
326 	}
327 }
328 
gottlieb_interrupt(void)329 int gottlieb_interrupt(void)
330 {
331 	if (laserdisc_playing) current_frame++;
332 
333 	return nmi_interrupt();
334 }
335 
336 
337 static unsigned char *nvram;
338 static size_t nvram_size;
339 
nvram_handler(void * file,int read_or_write)340 static void nvram_handler(void *file,int read_or_write)
341 {
342 	if (read_or_write)
343 		osd_fwrite(file,nvram,nvram_size);
344 	else
345 	{
346 		if (file)
347 			osd_fread(file,nvram,nvram_size);
348 		else
349 			memset(nvram,0xff,nvram_size);
350 	}
351 }
352 
353 
354 
355 static struct MemoryReadAddress reactor_readmem[] =
356 {
357 	{ 0x00000, 0x01fff, MRA_RAM },
358 	{ 0x03000, 0x033ff, MRA_RAM },
359 	{ 0x04000, 0x04fff, MRA_RAM },
360 	{ 0x07000, 0x07000, input_port_0_r },	/* DSW */
361 	{ 0x07001, 0x07001, input_port_1_r },	/* buttons */
362 	{ 0x07002, 0x07002, gottlieb_track_0_r },	/* trackball H */
363 	{ 0x07003, 0x07003, gottlieb_track_1_r },	/* trackball V */
364 	{ 0x07004, 0x07004, input_port_4_r },	/* joystick */
365 	{ 0x08000, 0x0ffff, MRA_ROM },
366 	/* map the ROM into Fxxxx so we can boot */
367 	{ 0xf8000, 0xfffff, MRA_BANK1 },
368 	{ -1 }  /* end of table */
369 };
370 
371 static struct MemoryWriteAddress reactor_writemem[] =
372 {
373 	{ 0x00000, 0x01fff, MWA_RAM },
374 	{ 0x02000, 0x020ff, MWA_RAM, &spriteram, &spriteram_size },
375 	{ 0x03000, 0x033ff, videoram_w, &videoram, &videoram_size },
376 	{ 0x03400, 0x037ff, videoram_w },	/* mirror address, some games write to it */
377 	{ 0x04000, 0x04fff, gottlieb_characterram_w, &gottlieb_characterram },
378 	{ 0x06000, 0x0601f, gottlieb_paletteram_w, &paletteram },
379 	{ 0x07000, 0x07000, watchdog_reset_w },
380 	{ 0x07001, 0x07001, gottlieb_track_reset_w },
381 	{ 0x07002, 0x07002, gottlieb_sh_w }, /* sound/speech command */
382 	{ 0x07003, 0x07003, reactor_output_w },       /* OUT1 */
383 	{ 0x08000, 0x0ffff, MWA_ROM },
384 	{ -1 }  /* end of table */
385 };
386 
387 static struct MemoryReadAddress gottlieb_readmem[] =
388 {
389 	{ 0x00000, 0x00fff, MRA_RAM },
390 	{ 0x01000, 0x01fff, MRA_RAM },	/* or ROM */
391 	{ 0x02000, 0x02fff, MRA_RAM },	/* or ROM */
392 	{ 0x03800, 0x03bff, MRA_RAM },
393 	{ 0x04000, 0x04fff, MRA_RAM },
394 	{ 0x05800, 0x05800, input_port_0_r },	/* DSW */
395 	{ 0x05801, 0x05801, input_port_1_r },	/* buttons */
396 	{ 0x05802, 0x05802, gottlieb_track_0_r },	/* trackball H */
397 	{ 0x05803, 0x05803, gottlieb_track_1_r },	/* trackball V */
398 	{ 0x05804, 0x05804, input_port_4_r },	/* joystick */
399 	{ 0x05805, 0x05807, gottlieb_laserdisc_status_r },
400 	{ 0x06000, 0x0ffff, MRA_ROM },
401 	/* Us vs Them and Q*bert Qubes use the Exxxx address space */
402 	{ 0xe5800, 0xe5800, input_port_0_r },	/* DSW */
403 	{ 0xe5801, 0xe5801, input_port_1_r },	/* buttons */
404 	{ 0xe5802, 0xe5802, gottlieb_track_0_r },	/* trackball H */
405 	{ 0xe5803, 0xe5803, gottlieb_track_1_r },	/* trackball V */
406 	{ 0xe5804, 0xe5804, input_port_4_r },	/* joystick */
407 	{ 0xe5805, 0xe5807, gottlieb_laserdisc_status_r },
408 	{ 0xe0000, 0xeffff, MRA_BANK2 },
409 	/* map the ROM into Fxxxx so we can boot */
410 	{ 0xf8000, 0xfffff, MRA_BANK1 },
411 	{ -1 }  /* end of table */
412 };
413 
414 static struct MemoryWriteAddress gottlieb_writemem[] =
415 {
416 	{ 0x00000, 0x00fff, MWA_RAM, &nvram, &nvram_size },
417 	{ 0x01000, 0x01fff, MWA_RAM },	/* ROM in Krull */
418 	{ 0x02000, 0x02fff, MWA_RAM },	/* ROM in Krull and 3 Stooges */
419 	{ 0x03000, 0x030ff, MWA_RAM, &spriteram, &spriteram_size },
420 	{ 0x03800, 0x03bff, videoram_w, &videoram, &videoram_size },
421 	{ 0x03c00, 0x03fff, videoram_w },	/* mirror address, some games write to it */
422 	{ 0x04000, 0x04fff, gottlieb_characterram_w, &gottlieb_characterram },
423 	{ 0x05000, 0x0501f, gottlieb_paletteram_w, &paletteram },
424 	{ 0x05800, 0x05800, watchdog_reset_w },
425 	{ 0x05801, 0x05801, gottlieb_track_reset_w },
426 	{ 0x05802, 0x05802, gottlieb_sh_w }, /* sound/speech command */
427 	{ 0x05803, 0x05803, gottlieb_video_outputs_w },       /* OUT1 */
428 	{ 0x06000, 0x0ffff, MWA_ROM },
429 	/* Q*bert Qubes uses the Exxxx address space */
430 	{ 0xe0000, 0xe37ff, MWA_BANK2 },
431 	{ 0xe3800, 0xe3bff, videoram_w },
432 	{ 0xe3c00, 0xe3fff, videoram_w },	/* mirror address, some games write to it */
433 	{ 0xe4000, 0xe4fff, gottlieb_characterram_w },
434 	{ 0xe5000, 0xe501f, gottlieb_paletteram_w },
435 	{ 0xe5800, 0xe5800, watchdog_reset_w },
436 	{ 0xe5801, 0xe5801, gottlieb_track_reset_w },
437 	{ 0xe5802, 0xe5802, gottlieb_sh_w }, /* sound/speech command */
438 	{ 0xe5803, 0xe5803, gottlieb_video_outputs_w },       /* OUT1 */
439 	{ -1 }  /* end of table */
440 };
441 
442 
443 /* same as above, different video_outputs plus laser disc control outputs */
444 static struct MemoryWriteAddress usvsthem_writemem[] =
445 {
446 	{ 0x00000, 0x00fff, MWA_RAM, &nvram, &nvram_size },
447 	{ 0x01000, 0x01fff, MWA_RAM },	/* ROM in Krull */
448 	{ 0x02000, 0x02fff, MWA_RAM },	/* ROM in Krull and 3 Stooges */
449 	{ 0x03000, 0x030ff, MWA_RAM, &spriteram, &spriteram_size },
450 	{ 0x03800, 0x03bff, videoram_w, &videoram, &videoram_size },
451 	{ 0x03c00, 0x03fff, videoram_w },	/* mirror address, some games write to it */
452 	{ 0x04000, 0x04fff, gottlieb_characterram_w, &gottlieb_characterram },
453 	{ 0x05000, 0x0501f, gottlieb_paletteram_w, &paletteram },
454 	{ 0x05800, 0x05800, watchdog_reset_w },
455 	{ 0x05801, 0x05801, gottlieb_track_reset_w },
456 	{ 0x05802, 0x05802, gottlieb_sh_w }, /* sound/speech command */
457 	{ 0x05803, 0x05803, usvsthem_video_outputs_w },       /* OUT1 */
458 	{ 0x05805, 0x05805, gottlieb_laserdisc_command_w },	/* command for the player */
459 	{ 0x05806, 0x05806, gottlieb_laserdisc_mpx_w },
460 	{ 0x06000, 0x0ffff, MWA_ROM },
461 	/* Us vs Them uses the Exxxx address space */
462 	{ 0xe0000, 0xe37ff, MWA_BANK2 },
463 	{ 0xe3800, 0xe3bff, videoram_w },
464 	{ 0xe3c00, 0xe3fff, videoram_w },	/* mirror address, some games write to it */
465 	{ 0xe4000, 0xe4fff, gottlieb_characterram_w },
466 	{ 0xe5000, 0xe501f, gottlieb_paletteram_w },
467 	{ 0xe5800, 0xe5800, watchdog_reset_w },
468 	{ 0xe5801, 0xe5801, gottlieb_track_reset_w },
469 	{ 0xe5802, 0xe5802, gottlieb_sh_w }, /* sound/speech command */
470 	{ 0xe5803, 0xe5803, usvsthem_video_outputs_w },       /* OUT1 */
471 	{ 0xe5805, 0xe5805, gottlieb_laserdisc_command_w },	/* command for the player */
472 	{ 0xe5806, 0xe5806, gottlieb_laserdisc_mpx_w },
473 	{ -1 }  /* end of table */
474 };
475 
476 /* same as above, different IN4 */
477 static struct MemoryReadAddress stooges_readmem[] =
478 {
479 	{ 0x00000, 0x00fff, MRA_RAM },
480 	{ 0x01000, 0x01fff, MRA_RAM },
481 	{ 0x02000, 0x02fff, MRA_ROM },
482 	{ 0x03800, 0x03bff, MRA_RAM },
483 	{ 0x04000, 0x04fff, MRA_RAM },
484 	{ 0x05800, 0x05800, input_port_0_r },	/* DSW */
485 	{ 0x05801, 0x05801, input_port_1_r },	/* buttons */
486 	{ 0x05802, 0x05802, gottlieb_track_0_r },	/* trackball H */
487 	{ 0x05803, 0x05803, gottlieb_track_1_r },	/* trackball V */
488 	{ 0x05804, 0x05804, stooges_IN4_r },	/* joystick */
489 	{ 0x06000, 0x0ffff, MRA_ROM },
490 	/* map the ROM into Fxxxx so we can boot */
491 	{ 0xf8000, 0xfffff, MRA_BANK1 },
492 	{ -1 }  /* end of table */
493 };
494 
495 /* same as above, different video_outputs */
496 static struct MemoryWriteAddress stooges_writemem[] =
497 {
498 	{ 0x00000, 0x00fff, MWA_RAM, &nvram, &nvram_size },
499 	{ 0x01000, 0x01fff, MWA_RAM },
500 	{ 0x02000, 0x02fff, MWA_ROM },
501 	{ 0x03000, 0x030ff, MWA_RAM, &spriteram, &spriteram_size },
502 	{ 0x03800, 0x03bff, videoram_w, &videoram, &videoram_size },
503 	{ 0x03c00, 0x03fff, videoram_w },	/* mirror address, some games write to it */
504 	{ 0x04000, 0x04fff, gottlieb_characterram_w, &gottlieb_characterram },
505 	{ 0x05000, 0x0501f, gottlieb_paletteram_w, &paletteram },
506 	{ 0x05800, 0x05800, watchdog_reset_w },
507 	{ 0x05801, 0x05801, gottlieb_track_reset_w },
508 	{ 0x05802, 0x05802, gottlieb_sh_w }, /* sound/speech command */
509 	{ 0x05803, 0x05803, stooges_output_w },       /* OUT1 */
510 	{ 0x06000, 0x0ffff, MWA_ROM },
511 	{ -1 }  /* end of table */
512 };
513 
514 
515 
516 struct MemoryReadAddress gottlieb_sound_readmem[] =
517 {
518 	{ 0x0000, 0x01ff, riot_ram_r },
519 	{ 0x0200, 0x03ff, gottlieb_riot_r },
520 	{ 0x6000, 0x7fff, MRA_ROM },
521 			 /* A15 not decoded except in expansion socket */
522 	{ 0x8000, 0x81ff, riot_ram_r },
523 	{ 0x8200, 0x83ff, gottlieb_riot_r },
524 	{ 0xe000, 0xffff, MRA_ROM },
525 	{ -1 }  /* end of table */
526 };
527 
528 struct MemoryWriteAddress gottlieb_sound_writemem[] =
529 {
530 	{ 0x0000, 0x01ff, riot_ram_w, &riot_ram },
531 	{ 0x0200, 0x03ff, gottlieb_riot_w },
532 	{ 0x1000, 0x1000, DAC_0_data_w },
533 	{ 0x2000, 0x2000, gottlieb_speech_w },
534 	{ 0x3000, 0x3000, gottlieb_speech_clock_DAC_w },
535 	{ 0x6000, 0x7fff, MWA_ROM },
536 			 /* A15 not decoded except in expansion socket */
537 	{ 0x8000, 0x81ff, riot_ram_w },
538 	{ 0x8200, 0x83ff, gottlieb_riot_w },
539 	{ 0x9000, 0x9000, DAC_0_data_w },
540 	{ 0xa000, 0xa000, gottlieb_speech_w },
541 	{ 0xb000, 0xb000, gottlieb_speech_clock_DAC_w },
542 	{ 0xe000, 0xffff, MWA_ROM },
543 	{ -1 }  /* end of table */
544 };
545 
546 
547 static struct MemoryReadAddress stooges_sound_readmem[] =
548 {
549 	{ 0x0000, 0x03ff, MRA_RAM },
550 	{ 0x8000, 0x8000, soundlatch_r },
551 	{ 0xe000, 0xffff, MRA_ROM },
552 	{ -1 }  /* end of table */
553 };
554 
555 struct MemoryWriteAddress stooges_sound_writemem[] =
556 {
557 	{ 0x0000, 0x03ff, MWA_RAM },
558 	{ 0x4000, 0x4001, DAC_0_data_w },
559 	{ 0xe000, 0xffff, MWA_ROM },
560 	{ -1 }  /* end of table */
561 };
562 
563 
564 static struct MemoryReadAddress stooges_sound2_readmem[] =
565 {
566 	{ 0x0000, 0x03ff, MRA_RAM },
567 	{ 0x6000, 0x6000, stooges_sound_input_r },	/* various signals */
568 	{ 0xa800, 0xa800, soundlatch_r },
569 	{ 0xc000, 0xffff, MRA_ROM },
570 	{ -1 }  /* end of table */
571 };
572 
573 struct MemoryWriteAddress stooges_sound2_writemem[] =
574 {
575 	{ 0x0000, 0x03ff, MWA_RAM },
576 	{ 0x2000, 0x2000, MWA_NOP },	/* speech chip. The game sends strings */
577 									/* of 15 bytes (clocked by 4000). The chip also */
578 									/* checks a DATA REQUEST bit in 6000. */
579 	{ 0x4000, 0x4000, stooges_sound_control_w },
580 	{ 0x8000, 0x8000, stooges_8910_latch_w },
581 	{ 0xa000, 0xa000, gottlieb_nmi_rate_w },	/* the timer generates NMIs */
582 	{ 0xb000, 0xb000, gottlieb_cause_dac_nmi_w },
583 	{ 0xc000, 0xffff, MWA_ROM },
584 	{ -1 }  /* end of table */
585 };
586 
587 
588 
589 INPUT_PORTS_START( reactor )
590 	PORT_START	/* DSW */
591 	PORT_DIPNAME( 0x01, 0x01, "Sound with Logos" )
592 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
593 	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
594 	PORT_DIPNAME( 0x02, 0x02, "Bounce Chambers Points" )
595 	PORT_DIPSETTING(    0x00, "10" )
596 	PORT_DIPSETTING(    0x02, "15" )
597 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )
598 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
599 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
600 	PORT_DIPNAME( 0x08, 0x08, "Sound with Instructions" )
601 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
602 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
603 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
604 	PORT_DIPSETTING(    0x10, DEF_STR( Upright ) )
605 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
606 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Coinage ) )
607 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
608 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_1C ) )
609 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) )
610 	PORT_DIPSETTING(    0x00, "10000" )
611 	PORT_DIPSETTING(    0x40, "12000" )
612 	PORT_DIPSETTING(    0xc0, "15000" )
613 	PORT_DIPSETTING(    0x80, "20000" )
614 
615 	PORT_START	/* IN1 */
616 	PORT_BITX(0x01, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
617 	PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
618 	PORT_BIT ( 0xfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
619 
620 	PORT_START	/* trackball H */
621 	PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_X, 15, 20, 0, 0 )
622 
623 	PORT_START	/* trackball V */
624 	PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_Y, 15, 20, 0, 0 )
625 
626 	PORT_START	/* IN4 */
627 	PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
628 	PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
629 	PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
630 	PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
631 	PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
632 	PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
633 	PORT_BIT ( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
634 INPUT_PORTS_END
635 
636 INPUT_PORTS_START( mplanets )
637 	PORT_START	/* DSW */
638 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
639 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
640 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
641 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Bonus_Life ) )
642 	PORT_DIPSETTING(    0x00, "10000" )
643 	PORT_DIPSETTING(    0x02, "12000" )
644 	PORT_DIPNAME( 0x08, 0x00, "Allow Round Select" )
645 	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
646 	PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
647 	PORT_DIPNAME( 0x14, 0x00, DEF_STR( Coinage ) )
648 	PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
649 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
650 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
651 	PORT_DIPSETTING(    0x14, DEF_STR( Free_Play ) )
652 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives ) )
653 	PORT_DIPSETTING(    0x00, "3" )
654 	PORT_DIPSETTING(    0x20, "5" )
655 	PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) )
656 	PORT_DIPSETTING(    0x40, "Easy" )
657 	PORT_DIPSETTING(    0x00, "Medium" )
658 	PORT_DIPSETTING(    0x80, "Hard" )
659 	PORT_DIPSETTING(    0xc0, "Hardest" )
660 
661 	PORT_START	/* IN1 */
662 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
663 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
664 	PORT_BIT( 0x3c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
665 	PORT_BITX(0x40, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
666 	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
667 
668 	PORT_START	/* trackball H not used */
669 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
670 
671 	PORT_START	/* trackball V (dial) */
672 	PORT_ANALOGX( 0xff, 0x00, IPT_DIAL, 5, 10, 0, 0, JOYCODE_1_BUTTON5, JOYCODE_1_BUTTON6, 0, 0 )
673 
674 	PORT_START	/* IN3 */
675 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
676 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
677 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
678 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
679 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
680 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
681 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
682 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 )
683 INPUT_PORTS_END
684 
685 INPUT_PORTS_START( qbert )
686 	PORT_START      /* DSW */
687 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
688 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
689 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
690 	PORT_DIPNAME( 0x02, 0x02, "Kicker" )
691 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
692 	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
693 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
694 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
695 	PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
696 	PORT_BITX( 0x08, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Auto Round Advance", IP_KEY_NONE, IP_JOY_NONE )
697 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
698 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
699 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Free_Play ) )
700 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
701 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
702 	PORT_DIPNAME( 0x20, 0x00, "SW5" )
703 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
704 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
705 	PORT_DIPNAME( 0x40, 0x00, "SW7" )
706 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
707 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
708 	PORT_DIPNAME( 0x80, 0x00, "SW8" )
709 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
710 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
711 	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
712 /* 0x40 must be connected to the IP16 line */
713 
714 	PORT_START      /* buttons */
715 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
716 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
717 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
718 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
719 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
720 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
721 	PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
722 	PORT_BITX(0x80, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
723 
724 	PORT_START	/* trackball H not used */
725 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
726 
727 	PORT_START	/* trackball V not used */
728 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
729 
730 	PORT_START      /* joystick */
731 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
732 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
733 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_4WAY )
734 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY )
735 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
736 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
737 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
738 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
739 INPUT_PORTS_END
740 
741 INPUT_PORTS_START( qbertqub )
742 	PORT_START      /* DSW */
743 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
744 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
745 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
746 	PORT_DIPNAME( 0x35, 0x00, DEF_STR( Coinage ) )
747 	PORT_DIPSETTING(    0x24, "A 2/1 B 2/1" )
748 	PORT_DIPSETTING(    0x14, "A 1/1 B 4/1" )
749 	PORT_DIPSETTING(    0x30, "A 1/1 B 3/1" )
750 	PORT_DIPSETTING(    0x10, "A 1/1 B 2/1" )
751 	PORT_DIPSETTING(    0x00, "A 1/1 B 1/1" )
752 	PORT_DIPSETTING(    0x11, "A 2/3 B 2/1" )
753 	PORT_DIPSETTING(    0x15, "A 1/2 B 3/1" )
754 	PORT_DIPSETTING(    0x20, "A 1/2 B 2/1" )
755 	PORT_DIPSETTING(    0x21, "A 1/2 B 1/1" )
756 	PORT_DIPSETTING(    0x31, "A 1/2 B 1/5" )
757 	PORT_DIPSETTING(    0x04, "A 1/3 B 2/1" )
758 	PORT_DIPSETTING(    0x05, "A 1/3 B 1/1" )
759 	PORT_DIPSETTING(    0x35, DEF_STR( Free_Play ) )
760 /* 0x25 DEF_STR( 2C_1C )
761    0x01 DEF_STR( 1C_1C )
762    0x34 DEF_STR( Free_Play ) */
763 	PORT_DIPNAME( 0x02, 0x00, "1st Bonus Life" )
764 	PORT_DIPSETTING(    0x00, "10000" )
765 	PORT_DIPSETTING(    0x02, "15000" )
766 	PORT_DIPNAME( 0x40, 0x00, "Additional Bonus Life" )
767 	PORT_DIPSETTING(    0x00, "20000" )
768 	PORT_DIPSETTING(    0x40, "25000" )
769 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Difficulty ) )
770 	PORT_DIPSETTING(    0x00, "Normal" )
771 	PORT_DIPSETTING(    0x80, "Hard" )
772 
773 	PORT_START      /* buttons */
774 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
775 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
776 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
777 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
778 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
779 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
780 	PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
781 	PORT_BITX(0x80, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
782 
783 	PORT_START	/* trackball H not used */
784 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
785 
786 	PORT_START	/* trackball V not used */
787 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
788 
789 	PORT_START      /* joystick */
790 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
791 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
792 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_4WAY )
793 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY )
794 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
795 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
796 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
797 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
798 INPUT_PORTS_END
799 
800 INPUT_PORTS_START( krull )
801 	PORT_START      /* DSW0 */
802 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
803 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
804 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
805 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
806 	PORT_DIPSETTING(    0x00, "Normal" )
807 	PORT_DIPSETTING(    0x02, "Hard" )
808 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
809 	PORT_DIPSETTING(    0x00, "3" )
810 	PORT_DIPSETTING(    0x08, "5" )
811 	PORT_DIPNAME( 0x14, 0x00, DEF_STR( Coinage ) )
812 	PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
813 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
814 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
815 	PORT_DIPSETTING(    0x14, DEF_STR( Free_Play ) )
816 	PORT_DIPNAME( 0x20, 0x00, "Hexagon" )
817 	PORT_DIPSETTING(    0x00, "Roving" )
818 	PORT_DIPSETTING(    0x20, "Stationary" )
819 	PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) )
820 	PORT_DIPSETTING(    0x40, "30000 30000" )
821 	PORT_DIPSETTING(    0x00, "30000 50000" )
822 	PORT_DIPSETTING(    0x80, "40000 50000" )
823 	PORT_DIPSETTING(    0xc0, "50000 75000" )
824 
825 	PORT_START      /* IN0 */
826 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
827 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
828 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
829 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
830 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
831 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
832 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
833 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
834 
835 	PORT_START	/* trackball H not used */
836 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
837 
838 	PORT_START	/* trackball V not used */
839 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
840 
841 	PORT_START      /* IN3 */
842 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
843 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
844 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
845 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
846 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP     | IPF_8WAY )
847 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT  | IPF_8WAY )
848 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY )
849 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT   | IPF_8WAY )
850 INPUT_PORTS_END
851 
852 INPUT_PORTS_START( mach3 )
853 	PORT_START      /* DSW0 */
854 	/* TODO: values are different for 5 lives */
855 	PORT_DIPNAME( 0x09, 0x08, DEF_STR( Coinage ) )
856 	PORT_DIPSETTING(    0x09, DEF_STR( 4C_1C ) )
857 	PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
858 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
859 	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
860 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
861 	PORT_DIPSETTING(    0x00, "Normal" )
862 	PORT_DIPSETTING(    0x02, "Hard" )
863 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
864 	PORT_DIPSETTING(    0x00, "3" )
865 	PORT_DIPSETTING(    0x10, "5" )
866 	PORT_DIPNAME( 0x24, 0x00, DEF_STR( Bonus_Life ) )
867 	PORT_DIPSETTING(    0x00, "10000 10000" )
868 	PORT_DIPSETTING(    0x04, "10000 20000" )
869 	PORT_DIPSETTING(    0x20, "10000 40000" )
870 	PORT_DIPSETTING(    0x24, "20000 60000" )
871 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
872 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
873 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
874 	PORT_BITX(    0x80, 0x80, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Infinite Lives", IP_KEY_NONE, IP_JOY_NONE )
875 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
876 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
877 
878 	PORT_START      /* IN0 */
879 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
880 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
881 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
882 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
883 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
884 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
885 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
886 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
887 
888 	PORT_START	/* trackball H not used */
889 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
890 
891 	PORT_START	/* trackball V not used */
892 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
893 
894 	PORT_START      /* IN3 */
895 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
896 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
897 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
898 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
899 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
900 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
901 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
902 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
903 INPUT_PORTS_END
904 
905 INPUT_PORTS_START( usvsthem )
906 	PORT_START      /* DSW0 */
907 	/* TODO: values are different for 5 lives */
908 	PORT_DIPNAME( 0x09, 0x00, DEF_STR( Coinage ) )
909 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
910 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
911 	PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
912 /*	PORT_DIPSETTING(    0x09, DEF_STR( Free_Play ) ) */
913 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
914 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
915 	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
916 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) )
917 	PORT_DIPSETTING(    0x00, "Normal" )
918 	PORT_DIPSETTING(    0x04, "Hard" )
919 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
920 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
921 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
922 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
923 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
924 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
925 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
926 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
927 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
928 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
929 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
930 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
931 
932 	PORT_START      /* IN0 */
933 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
934 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
935 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
936 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
937 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
938 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
939 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
940 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
941 
942 	PORT_START	/* trackball H not used */
943 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
944 
945 	PORT_START	/* trackball V not used */
946 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
947 
948 	PORT_START      /* IN3 */
949 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
950 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
951 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
952 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
953 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
954 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
955 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
956 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
957 INPUT_PORTS_END
958 
959 INPUT_PORTS_START( 3stooges )
960 	PORT_START	/* DSW */
961 	PORT_DIPNAME (0x01, 0x00, DEF_STR( Demo_Sounds ) )
962 	PORT_DIPSETTING (   0x01, DEF_STR( Off ) )
963 	PORT_DIPSETTING (   0x00, DEF_STR( On ) )
964 	PORT_DIPNAME (0x02, 0x00, DEF_STR( Difficulty ) )
965 	PORT_DIPSETTING (   0x00, "Normal" )
966 	PORT_DIPSETTING (   0x02, "Hard" )
967 	PORT_DIPNAME (0x08, 0x00, DEF_STR( Lives ) )
968 	PORT_DIPSETTING (   0x00, "3" )
969 	PORT_DIPSETTING (   0x08, "5" )
970 	PORT_DIPNAME (0x14, 0x00, DEF_STR( Coinage ) )
971 	PORT_DIPSETTING (   0x04, DEF_STR( 2C_1C ) )
972 	PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
973 	PORT_DIPSETTING (   0x10, DEF_STR( 1C_2C ) )
974 	PORT_DIPSETTING (   0x14, DEF_STR( Free_Play ) )
975 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
976 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
977 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
978 	PORT_DIPNAME (0x40, 0x00, "1st Bonus Life at" )
979 	PORT_DIPSETTING (   0x40, "10000" )
980 	PORT_DIPSETTING (   0x00, "20000" )
981 	PORT_DIPNAME (0x80, 0x00, "And Bonus Life Every" )
982 	PORT_DIPSETTING (   0x80, "10000" )
983 	PORT_DIPSETTING (   0x00, "20000" )
984 
985 	PORT_START	/* IN1 */
986 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
987 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
988 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
989 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
990 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
991 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
992 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
993 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
994 
995 	PORT_START	/* trackball H not used */
996 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
997 
998 	PORT_START	/* trackball V not used */
999 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1000 
1001 	PORT_START	/* joystick 2 (Moe) */
1002 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_PLAYER2 | IPF_8WAY )
1003 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 | IPF_8WAY )
1004 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 | IPF_8WAY )
1005 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 | IPF_8WAY )
1006 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
1007 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
1008 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER3 )
1009 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1010 
1011 	/* the bottom four bits of the previous port are multiplexed among */
1012 	/* three joysticks - the following port contains settings for the other two */
1013 	PORT_START
1014 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_PLAYER3 | IPF_8WAY )
1015 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_PLAYER3 | IPF_8WAY )
1016 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_PLAYER3 | IPF_8WAY )
1017 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_PLAYER3 | IPF_8WAY )
1018 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_PLAYER1 | IPF_8WAY )
1019 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 | IPF_8WAY )
1020 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_PLAYER1 | IPF_8WAY )
1021 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_PLAYER1 | IPF_8WAY )
1022 INPUT_PORTS_END
1023 
1024 INPUT_PORTS_START( curvebal )
1025 	PORT_START      /* DSW0 */
1026 	PORT_DIPNAME( 0x08, 0x00, "2 Players Game" )
1027 	PORT_DIPSETTING(    0x08, "1 Credit" )
1028 	PORT_DIPSETTING(    0x00, "2 Credits" )
1029 	PORT_DIPNAME( 0x11, 0x00, DEF_STR( Difficulty ) )
1030 	PORT_DIPSETTING(    0x00, "Easy" )
1031 	PORT_DIPSETTING(    0x10, "Medium" )
1032 	PORT_DIPSETTING(    0x01, "Hard" )
1033 	PORT_DIPSETTING(    0x11, "Hardest" )
1034 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
1035 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1036 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1037 	PORT_DIPNAME( 0x20, 0x00, "Coins" )
1038 	PORT_DIPSETTING(    0x00, "Normal" )
1039 	PORT_DIPSETTING(    0x20, "French" )
1040 	/* TODO: coinage is different when French is selected */
1041 /* PORT_DIPNAME( 0xc2, 0x00, "French Coinage" )
1042 PORT_DIPSETTING(    0x42, "A 3/1 B 1/2" )
1043 PORT_DIPSETTING(    0x82, "A 1/5 B 1/2" )
1044 PORT_DIPSETTING(    0x02, "A 2/1 B 2/3" )
1045 PORT_DIPSETTING(    0xc0, "A 2/1 B 2/1" )
1046 PORT_DIPSETTING(    0x80, "A 1/1 B 1/2" )
1047 PORT_DIPSETTING(    0x40, "A 1/1 B 1/3" )
1048 PORT_DIPSETTING(    0x00, "A 1/1 B 1/1" )
1049 PORT_DIPSETTING(    0xc2, DEF_STR( Free_Play ) ) */
1050 	PORT_DIPNAME( 0xc2, 0x00, DEF_STR( Coinage ) )
1051 	PORT_DIPSETTING(    0x42, "A 4/1 B 1/1" )
1052 	PORT_DIPSETTING(    0x82, "A 3/1 B 1/1" )
1053 	PORT_DIPSETTING(    0x02, "A 2/1 B 1/1" )
1054 	PORT_DIPSETTING(    0xc0, "A 2/1 B 2/1" )
1055 	PORT_DIPSETTING(    0x80, "A 2/1 B 1/2" )
1056 	PORT_DIPSETTING(    0x40, "A 2/1 B 1/3" )
1057 	PORT_DIPSETTING(    0x00, "A 1/1 B 1/1" )
1058 	PORT_DIPSETTING(    0xc2, DEF_STR( Free_Play ) )
1059 
1060 	PORT_START      /* IN0 */
1061 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
1062 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
1063 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
1064 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
1065 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1066 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1067 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1068 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1069 
1070 	PORT_START	/* trackball H not used */
1071 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1072 
1073 	PORT_START	/* trackball V not used */
1074 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1075 
1076 	PORT_START      /* IN3 */
1077 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1078 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1, "Swing", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1079 	PORT_BITX(0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2, "Pitch Left", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1080 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1081 	PORT_BITX(0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2, "Pitch Right", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1082 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1083 	PORT_BITX(0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1, "Bunt", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1084 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1085 INPUT_PORTS_END
1086 
1087 INPUT_PORTS_START( screwloo )
1088 	PORT_START      /* DSW0 */
1089 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
1090 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1091 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1092 	PORT_DIPNAME( 0x02, 0x00, "Demo mode" )
1093 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1094 	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1095 	PORT_DIPNAME( 0x04, 0x00, "1st Bonus Atom at" )
1096 	PORT_DIPSETTING(    0x00, "5000" )
1097 	PORT_DIPSETTING(    0x04, "20000" )
1098 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )
1099 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1100 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1101 	PORT_DIPNAME( 0x50, 0x40, DEF_STR( Coinage ) )
1102 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1103 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_2C ) )
1104 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1105 	PORT_DIPSETTING(    0x50, DEF_STR( 1C_2C ) )
1106 	PORT_DIPNAME( 0x20, 0x00, "1st Bonus Hand at" )
1107 	PORT_DIPSETTING(    0x00, "25000" )
1108 	PORT_DIPSETTING(    0x20, "50000" )
1109 	PORT_DIPNAME( 0x80, 0x00, "Hands" )
1110 	PORT_DIPSETTING(    0x00, "3" )
1111 	PORT_DIPSETTING(    0x80, "5" )
1112 
1113 	PORT_START      /* IN0 */
1114 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
1115 	PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_SERVICE, "Select in Service Mode", KEYCODE_F1, IP_JOY_NONE )
1116 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
1117 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
1118 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
1119 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
1120 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
1121 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
1122 
1123 	PORT_START	/* trackball H not used */
1124 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1125 
1126 	PORT_START	/* trackball V not used */
1127 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1128 
1129 	PORT_START      /* IN3 */
1130 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
1131 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
1132 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
1133 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
1134 	PORT_BITX(0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1, "Start 2P", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1135 	PORT_BITX(0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER1, "Start 1P", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
1136 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1137 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1138 INPUT_PORTS_END
1139 
1140 INPUT_PORTS_START( insector )
1141 	PORT_START      /* DSW0 */
1142 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
1143 	PORT_DIPSETTING(    0x00, "25000" )
1144 	PORT_DIPSETTING(    0x01, "30000" )
1145 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1146 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1147 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1148 	PORT_DIPNAME( 0x04, 0x00, "Demo mode" )
1149 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1150 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1151 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
1152 	PORT_DIPSETTING(    0x08, "3" )
1153 	PORT_DIPSETTING(    0x00, "5" )
1154 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Coinage ) )
1155 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1156 	PORT_DIPSETTING(    0x50, DEF_STR( 2C_2C ) )
1157 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1158 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
1159 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Free_Play ) )
1160 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1161 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1162 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1163 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1164 	PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1165 
1166 	PORT_START      /* IN0 */
1167 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1168 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1169 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
1170 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
1171 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
1172 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
1173 	PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1174 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1175 
1176 	PORT_START	/* trackball H not used */
1177 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1178 
1179 	PORT_START	/* trackball V not used */
1180 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1181 
1182 	PORT_START      /* IN3 */
1183 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
1184 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
1185 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
1186 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
1187 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
1188 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
1189 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
1190 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
1191 INPUT_PORTS_END
1192 
1193 
1194 
1195 /* the games can store char gfx data in either a 4k RAM area (128 chars), or */
1196 /* a 8k ROM area (256 chars). */
1197 static struct GfxLayout charRAMlayout =
1198 {
1199 	8,8,    /* 8*8 characters */
1200 	128,    /* 128 characters */
1201 	4,      /* 4 bits per pixel */
1202 	{ 0, 1, 2, 3 },
1203 	{ 0, 4, 8, 12, 16, 20, 24, 28},
1204 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
1205 	32*8    /* every char takes 32 consecutive bytes */
1206 };
1207 
1208 static struct GfxLayout charROMlayout =
1209 {
1210 	8,8,    /* 8*8 characters */
1211 	256,    /* 256 characters */
1212 	4,      /* 4 bits per pixel */
1213 	{ 0, 1, 2, 3 },
1214 	{ 0, 4, 8, 12, 16, 20, 24, 28},
1215 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
1216 	32*8    /* every char takes 32 consecutive bytes */
1217 };
1218 
1219 static struct GfxLayout spritelayout =
1220 {
1221 	16,16,  /* 16*16 sprites */
1222 	256,    /* 256 sprites */
1223 	4,      /* 4 bits per pixel */
1224 	{ 0, 256*32*8, 2*256*32*8, 3*256*32*8 },
1225 	{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
1226 	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
1227 			8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
1228 	32*8    /* every sprite takes 32 consecutive bytes */
1229 };
1230 
1231 static struct GfxLayout qbertqub_spritelayout =
1232 {
1233 	16,16,  /* 16*16 sprites */
1234 	512,    /* 512 sprites */
1235 	4,      /* 4 bits per pixel */
1236 	{ 0, 512*32*8, 2*512*32*8, 3*512*32*8 },
1237 	{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
1238 	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
1239 			8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
1240 	32*8    /* every sprite takes 32 consecutive bytes */
1241 };
1242 
1243 static struct GfxDecodeInfo charRAM_gfxdecodeinfo[] =
1244 {
1245 	{ 0,           0x4000, &charRAMlayout, 0, 1 },	/* the game dynamically modifies this */
1246 	{ REGION_GFX2, 0x0000, &spritelayout,  0, 1 },
1247 	{ -1 } /* end of array */
1248 };
1249 
1250 static struct GfxDecodeInfo charROM_gfxdecodeinfo[] =
1251 {
1252 	{ REGION_GFX1, 0x0000, &charROMlayout, 0, 1 },
1253 	{ REGION_GFX2, 0x0000, &spritelayout,  0, 1 },
1254 	{ -1 } /* end of array */
1255 };
1256 
1257 static struct GfxDecodeInfo qbertqub_gfxdecodeinfo[] =
1258 {
1259 	{ REGION_GFX1, 0x0000, &charROMlayout,         0, 1 },
1260 	{ REGION_GFX2, 0x0000, &qbertqub_spritelayout, 0, 1 },
1261 	{ -1 } /* end of array */
1262 };
1263 
1264 
1265 
1266 static struct DACinterface dac1_interface =
1267 {
1268 	1,
1269 	{ 50 }
1270 };
1271 
1272 static struct DACinterface dac2_interface =
1273 {
1274 	2,
1275 	{ 25, 25 }
1276 };
1277 
1278 static const char *reactor_sample_names[] =
1279 {
1280 	"*reactor",
1281 	"fx_53.wav", /* "8 left" */
1282 	"fx_54.wav", /* "16 left" */
1283 	"fx_55.wav", /* "24 left" */
1284 	"fx_56.wav", /* "32 left" */
1285 	"fx_57.wav", /* "40 left" */
1286 	"fx_58.wav", /* "warning, core unstable" */
1287 	"fx_59.wav", /* "bonus" */
1288 	"fx_31.wav", /* "chamber activated" */
1289 	"fx_39a.wav", /* "2000" */
1290 	"fx_39b.wav", /* "5000" */
1291 	"fx_39c.wav", /* "10000" */
1292 	"fx_39d.wav", /* "15000" */
1293 	"fx_39e.wav", /* "20000" */
1294 	"fx_39f.wav", /* "25000" */
1295 	"fx_39g.wav", /* "30000" */
1296 	"fx_39h.wav", /* "35000" */
1297 	"fx_39i.wav", /* "40000" */
1298 	"fx_39j.wav", /* "45000" */
1299 	"fx_39k.wav", /* "50000" */
1300 	"fx_39l.wav", /* "55000" */
1301      0	/* end of array */
1302 };
1303 
1304 static const char *qbert_sample_names[] =
1305 {
1306 	"*qbert",
1307 	"fx_17a.wav", /* random speech, voice clock 255 */
1308 	"fx_17b.wav", /* random speech, voice clock 255 */
1309 	"fx_17c.wav", /* random speech, voice clock 255 */
1310 	"fx_17d.wav", /* random speech, voice clock 255 */
1311 	"fx_17e.wav", /* random speech, voice clock 255 */
1312 	"fx_17f.wav", /* random speech, voice clock 255 */
1313 	"fx_17g.wav", /* random speech, voice clock 255 */
1314 	"fx_17h.wav", /* random speech, voice clock 255 */
1315 	"fx_18a.wav", /* random speech, voice clock 176 */
1316 	"fx_18b.wav", /* random speech, voice clock 176 */
1317 	"fx_18c.wav", /* random speech, voice clock 176 */
1318 	"fx_18d.wav", /* random speech, voice clock 176 */
1319 	"fx_18e.wav", /* random speech, voice clock 176 */
1320 	"fx_18f.wav", /* random speech, voice clock 176 */
1321 	"fx_18g.wav", /* random speech, voice clock 176 */
1322 	"fx_18h.wav", /* random speech, voice clock 176 */
1323 	"fx_19a.wav", /* random speech, voice clock 128 */
1324 	"fx_19b.wav", /* random speech, voice clock 128 */
1325 	"fx_19c.wav", /* random speech, voice clock 128 */
1326 	"fx_19d.wav", /* random speech, voice clock 128 */
1327 	"fx_19e.wav", /* random speech, voice clock 128 */
1328 	"fx_19f.wav", /* random speech, voice clock 128 */
1329 	"fx_19g.wav", /* random speech, voice clock 128 */
1330 	"fx_19h.wav", /* random speech, voice clock 128 */
1331 	"fx_20a.wav", /* random speech, voice clock 96 */
1332 	"fx_20b.wav", /* random speech, voice clock 96 */
1333 	"fx_20c.wav", /* random speech, voice clock 96 */
1334 	"fx_20d.wav", /* random speech, voice clock 96 */
1335 	"fx_20e.wav", /* random speech, voice clock 96 */
1336 	"fx_20f.wav", /* random speech, voice clock 96 */
1337 	"fx_20g.wav", /* random speech, voice clock 96 */
1338 	"fx_20h.wav", /* random speech, voice clock 96 */
1339 	"fx_21a.wav", /* random speech, voice clock 62 */
1340 	"fx_21b.wav", /* random speech, voice clock 62 */
1341 	"fx_21c.wav", /* random speech, voice clock 62 */
1342 	"fx_21d.wav", /* random speech, voice clock 62 */
1343 	"fx_21e.wav", /* random speech, voice clock 62 */
1344 	"fx_21f.wav", /* random speech, voice clock 62 */
1345 	"fx_21g.wav", /* random speech, voice clock 62 */
1346 	"fx_21h.wav", /* random speech, voice clock 62 */
1347 	"fx_22.wav", /* EH2 with decreasing voice clock */
1348 	"fx_23.wav", /* O1 with varying voice clock */
1349 	"fx_28.wav", /* "hello, I'm ready" */
1350 	"fx_36.wav", /* "byebye" */
1351 	"knocker.wav",
1352 	0	/* end of array */
1353 };
1354 
1355 static struct Samplesinterface samples_interface =
1356 {
1357 	1,	/* one channel */
1358 	100	/* volume */
1359 };
1360 
1361 static struct AY8910interface ay8910_interface =
1362 {
1363 	2,	/* 2 chips */
1364 	2000000,	/* 2 MHz */
1365 	{ 25, 25 },
1366 	{ 0 },
1367 	{ 0 },
1368 	{ 0 },
1369 	{ 0 }
1370 };
1371 
1372 
1373 
1374 /********************************************************************
1375 *
1376 *  Machine Driver macro
1377 *  ====================
1378 *
1379 *  There are two versions of the machine driver,
1380 *  one for revision 1 sound board (1x6502 + DAC + Votrax),
1381 *  one for revision 2 (2x6502 + DAC + GI SP-0250 speech chip + 2x8910).
1382 *  They are identical apart form the sound CPU subsections.
1383 *
1384 ********************************************************************/
1385 
1386 #define MACHINE_DRIVER_SOUND_1(GAMENAME,READMEM,WRITEMEM,GFX,NVRAM)	\
1387 static struct MachineDriver machine_driver_##GAMENAME =             \
1388 {                                                                   \
1389 	/* basic machine hardware */                                	\
1390 	{		                                                        \
1391 		{	  	                                                    \
1392 			CPU_I86,												\
1393 			5000000,        /* 5 Mhz */								\
1394 			READMEM,WRITEMEM,0,0,									\
1395 			gottlieb_interrupt,1									\
1396 		},		                                                    \
1397 		{		                                                    \
1398 			CPU_M6502 | CPU_AUDIO_CPU ,								\
1399 			3579545/4,	/* the board can be set to /2 as well */	\
1400 			gottlieb_sound_readmem,gottlieb_sound_writemem,0,0,		\
1401 			ignore_interrupt,1	/* IRQs are triggered by the main CPU */		\
1402 								/* NMIs are triggered by the Votrax SC-01 */	\
1403 		}                                                   		\
1404 	},                                                          	\
1405 	61, 1018,	/* frames per second, vblank duration */			\
1406 	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */ \
1407 	init_machine,			                                    	\
1408 																	\
1409 	/* video hardware */                                        	\
1410 	32*8, 32*8, { 0*8, 32*8-1, 0*8, 30*8-1 },						\
1411 	GFX,                                                        	\
1412 	16, 16,		                                                	\
1413 	0,									                           	\
1414 																	\
1415 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,	\
1416 	0,                                                          	\
1417 	gottlieb_vh_start,												\
1418 	gottlieb_vh_stop,												\
1419 	gottlieb_vh_screenrefresh,										\
1420 																	\
1421 	/* sound hardware */                                        	\
1422 	0,0,0,0,                                                    	\
1423 	{                                                           	\
1424 		{                                                   		\
1425 			SOUND_DAC,												\
1426 			&dac1_interface											\
1427 		},															\
1428 		{															\
1429 			SOUND_SAMPLES,	/* for Votrax simulation */				\
1430 			&samples_interface										\
1431 		}                                                   		\
1432 	},                                                           	\
1433 																	\
1434 	NVRAM															\
1435 }
1436 
1437 #define MACHINE_DRIVER_SOUND_2(GAMENAME,READMEM,WRITEMEM,GFX,NVRAM)	\
1438 static struct MachineDriver machine_driver_##GAMENAME =				\
1439 {																	\
1440 	/* basic machine hardware */									\
1441 	{																\
1442 		{															\
1443 			CPU_I86,												\
1444 			5000000,        /* 5 Mhz */								\
1445 			READMEM,WRITEMEM,0,0,									\
1446 			gottlieb_interrupt,1									\
1447 		},															\
1448 		{															\
1449 			CPU_M6502 | CPU_AUDIO_CPU ,								\
1450 			1000000,	/* 1 MHz */									\
1451 			stooges_sound_readmem,stooges_sound_writemem,0,0,		\
1452 			ignore_interrupt,1	/* IRQs are triggered by the main CPU */			\
1453 								/* NMIs are triggered by the second sound CPU */	\
1454 		},															\
1455 		{															\
1456 			CPU_M6502 | CPU_AUDIO_CPU ,								\
1457 			1000000,	/* 1 MHz */									\
1458 			stooges_sound2_readmem,stooges_sound2_writemem,0,0,		\
1459 			ignore_interrupt,1	/* IRQs are triggered by the main CPU */			\
1460 								/* NMIs are triggered by a programmable timer */	\
1461 		}															\
1462 	},																\
1463 	61, 1018,	/* frames per second, vblank duration */			\
1464 	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */ \
1465 	init_machine,													\
1466 																	\
1467 	/* video hardware */											\
1468 	32*8, 32*8, { 0*8, 32*8-1, 0*8, 30*8-1 },						\
1469 	GFX,															\
1470 	16, 16,															\
1471 	0,																\
1472 																	\
1473 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,	\
1474 	0,																\
1475 	gottlieb_vh_start,												\
1476 	gottlieb_vh_stop,												\
1477 	gottlieb_vh_screenrefresh,										\
1478 																	\
1479 	/* sound hardware */											\
1480 	0,0,0,0,														\
1481 	{																\
1482 		{															\
1483 			SOUND_DAC,												\
1484 			&dac2_interface											\
1485 		},															\
1486 		{															\
1487 			SOUND_AY8910,											\
1488 			&ay8910_interface										\
1489 		}															\
1490 	},																\
1491 																	\
1492 	NVRAM															\
1493 }
1494 
1495 /* games using the revision 1 sound board */
1496 MACHINE_DRIVER_SOUND_1(reactor,  reactor_readmem, reactor_writemem, charRAM_gfxdecodeinfo, 0);
1497 MACHINE_DRIVER_SOUND_1(gottlieb, gottlieb_readmem,gottlieb_writemem,charROM_gfxdecodeinfo, nvram_handler);
1498 MACHINE_DRIVER_SOUND_1(qbertqub, gottlieb_readmem,gottlieb_writemem,qbertqub_gfxdecodeinfo,nvram_handler);
1499 MACHINE_DRIVER_SOUND_1(krull,    gottlieb_readmem,gottlieb_writemem,charRAM_gfxdecodeinfo, nvram_handler);
1500 /* games using the revision 2 sound board */
1501 MACHINE_DRIVER_SOUND_2(mach3,    gottlieb_readmem,usvsthem_writemem,charROM_gfxdecodeinfo, nvram_handler);
1502 MACHINE_DRIVER_SOUND_2(usvsthem, gottlieb_readmem,usvsthem_writemem,qbertqub_gfxdecodeinfo,nvram_handler);
1503 MACHINE_DRIVER_SOUND_2(stooges,  stooges_readmem, stooges_writemem, charRAM_gfxdecodeinfo, nvram_handler);
1504 MACHINE_DRIVER_SOUND_2(gottlieb2,gottlieb_readmem,gottlieb_writemem,charROM_gfxdecodeinfo, nvram_handler);
1505 
1506 
1507 /***************************************************************************
1508 
1509   Game driver(s)
1510 
1511 ***************************************************************************/
1512 
1513 ROM_START( reactor )
1514 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1515 	ROM_LOAD( "rom7",         0x8000, 0x1000, 0xa62d86fd )
1516 	ROM_LOAD( "rom6",         0x9000, 0x1000, 0x6ed841f3 )
1517 	ROM_LOAD( "rom5",         0xa000, 0x1000, 0xd90576a3 )
1518 	ROM_LOAD( "rom4",         0xb000, 0x1000, 0x0155daae )
1519 	ROM_LOAD( "rom3",         0xc000, 0x1000, 0xf8881385 )
1520 	ROM_LOAD( "rom2",         0xd000, 0x1000, 0x3caba35b )
1521 	ROM_LOAD( "rom1",         0xe000, 0x1000, 0x944e1ddf )
1522 	ROM_LOAD( "rom0",         0xf000, 0x1000, 0x55930aed )
1523 
1524 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1525 	ROM_LOAD( "snd1",         0xf000, 0x800, 0xd958a0fd )
1526 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1527 	ROM_LOAD( "snd2",         0xf800, 0x800, 0x5dc86942 )
1528 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1529 
1530 	/* no gfx1 (RAM is used) */
1531 
1532 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1533 	/* 0000-0fff empty */
1534 	ROM_LOAD( "fg3",          0x1000, 0x1000, 0x8416ad53 )	/* sprites */
1535 	/* 2000-2fff empty */
1536 	ROM_LOAD( "fg2",          0x3000, 0x1000, 0x5489605a )
1537 	/* 4000-4fff empty */
1538 	ROM_LOAD( "fg1",          0x5000, 0x1000, 0x18396c57 )
1539 	/* 6000-6fff empty */
1540 	ROM_LOAD( "fg0",          0x7000, 0x1000, 0xd1f20e15 )
1541 ROM_END
1542 
ROM_START(mplanets)1543 ROM_START( mplanets )
1544 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1545 	ROM_LOAD( "rom4",         0x6000, 0x2000, 0x5402077f )
1546 	ROM_LOAD( "rom3",         0x8000, 0x2000, 0x5d18d740 )
1547 	ROM_LOAD( "rom2",         0xa000, 0x2000, 0x960c3bb1 )
1548 	ROM_LOAD( "rom1",         0xc000, 0x2000, 0xeb515f10 )
1549 	ROM_LOAD( "rom0",         0xe000, 0x2000, 0x74de78aa )
1550 
1551 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1552 	ROM_LOAD( "snd1",         0xf000, 0x800, 0x453193a1 )
1553 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1554 	ROM_LOAD( "snd2",         0xf800, 0x800, 0xf5ffc98f )
1555 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1556 
1557 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1558 	ROM_LOAD( "bg0",          0x0000, 0x1000, 0x709aa24c )	/* chars */
1559 	ROM_LOAD( "bg1",          0x1000, 0x1000, 0x4921e345 )
1560 
1561 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1562 	ROM_LOAD( "fg3",          0x0000, 0x2000, 0xc990b39f )	/* sprites */
1563 	ROM_LOAD( "fg2",          0x2000, 0x2000, 0x735e2522 )
1564 	ROM_LOAD( "fg1",          0x4000, 0x2000, 0x6456cc1c )
1565 	ROM_LOAD( "fg0",          0x6000, 0x2000, 0xa920e325 )
1566 ROM_END
1567 
1568 ROM_START( qbert )
1569 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1570 	ROM_LOAD( "qb-rom2.bin",  0xa000, 0x2000, 0xfe434526 )
1571 	ROM_LOAD( "qb-rom1.bin",  0xc000, 0x2000, 0x55635447 )
1572 	ROM_LOAD( "qb-rom0.bin",  0xe000, 0x2000, 0x8e318641 )
1573 
1574 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1575 	ROM_LOAD( "qb-snd1.bin",  0xf000, 0x800, 0x15787c07 )
1576 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1577 	ROM_LOAD( "qb-snd2.bin",  0xf800, 0x800, 0x58437508 )
1578 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1579 
1580 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1581 	ROM_LOAD( "qb-bg0.bin",   0x0000, 0x1000, 0x7a9ba824 )	/* chars */
1582 	ROM_LOAD( "qb-bg1.bin",   0x1000, 0x1000, 0x22e5b891 )
1583 
1584 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1585 	ROM_LOAD( "qb-fg3.bin",   0x0000, 0x2000, 0xdd436d3a )	/* sprites */
1586 	ROM_LOAD( "qb-fg2.bin",   0x2000, 0x2000, 0xf69b9483 )
1587 	ROM_LOAD( "qb-fg1.bin",   0x4000, 0x2000, 0x224e8356 )
1588 	ROM_LOAD( "qb-fg0.bin",   0x6000, 0x2000, 0x2f695b85 )
1589 ROM_END
1590 
1591 ROM_START( qbertjp )
1592 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1593 	ROM_LOAD( "qbj-rom2.bin", 0xa000, 0x2000, 0x67bb1cb2 )
1594 	ROM_LOAD( "qbj-rom1.bin", 0xc000, 0x2000, 0xc61216e7 )
1595 	ROM_LOAD( "qbj-rom0.bin", 0xe000, 0x2000, 0x69679d5c )
1596 
1597 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1598 	ROM_LOAD( "qb-snd1.bin",  0xf000, 0x800, 0x15787c07 )
1599 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1600 	ROM_LOAD( "qb-snd2.bin",  0xf800, 0x800, 0x58437508 )
1601 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1602 
1603 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1604 	ROM_LOAD( "qb-bg0.bin",   0x0000, 0x1000, 0x7a9ba824 )	/* chars */
1605 	ROM_LOAD( "qb-bg1.bin",   0x1000, 0x1000, 0x22e5b891 )
1606 
1607 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1608 	ROM_LOAD( "qb-fg3.bin",   0x0000, 0x2000, 0xdd436d3a )	/* sprites */
1609 	ROM_LOAD( "qb-fg2.bin",   0x2000, 0x2000, 0xf69b9483 )
1610 	ROM_LOAD( "qb-fg1.bin",   0x4000, 0x2000, 0x224e8356 )
1611 	ROM_LOAD( "qb-fg0.bin",   0x6000, 0x2000, 0x2f695b85 )
1612 ROM_END
1613 
1614 ROM_START( insector )
1615 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1616 	ROM_LOAD( "rom3",         0x8000, 0x2000, 0x640881fd )
1617 	ROM_LOAD( "rom2",         0xa000, 0x2000, 0x456bc3f4 )
1618 	ROM_LOAD( "rom1",         0xc000, 0x2000, 0x706962af )
1619 	ROM_LOAD( "rom0",         0xe000, 0x2000, 0x31cee24b )
1620 
1621 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1622 	ROM_LOAD( "sound",        0xf000, 0x1000, 0x00000000 )
1623 
1624 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1625 	ROM_LOAD( "bg0",          0x0000, 0x1000, 0x0dc2037e )	/* chars */
1626 	ROM_LOAD( "bg1",          0x1000, 0x1000, 0x3dd73b94 )
1627 
1628 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1629 	ROM_LOAD( "fg3",          0x0000, 0x2000, 0x9bbf5b6b )	/* sprites */
1630 	ROM_LOAD( "fg2",          0x2000, 0x2000, 0x5adf9986 )
1631 	ROM_LOAD( "fg1",          0x4000, 0x2000, 0x4bb16111 )
1632 	ROM_LOAD( "fg0",          0x6000, 0x2000, 0x965f6b76 )
1633 ROM_END
1634 
1635 ROM_START( screwloo )
1636 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1637 	ROM_LOAD( "rom4",         0x6000, 0x2000, 0x744a2513 )
1638 	ROM_LOAD( "rom3",         0x8000, 0x2000, 0xffde5b5d )
1639 	ROM_LOAD( "rom2",         0xa000, 0x2000, 0x97932b05 )
1640 	ROM_LOAD( "rom1",         0xc000, 0x2000, 0x571b65ca )
1641 	ROM_LOAD( "rom0",         0xe000, 0x2000, 0x6447fe54 )
1642 
1643 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1644 	ROM_LOAD( "drom1",        0xe000, 0x2000, 0xae965ade )
1645 
1646 	ROM_REGION( 0x10000, REGION_CPU3 )	/* 64k for second sound cpu */
1647 	ROM_LOAD( "yrom1",        0xe000, 0x2000, 0x3719b0b5 )
1648 
1649 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1650 	ROM_LOAD( "bg0",          0x0000, 0x1000, 0x1fd5b649 )	/* chars */
1651 	ROM_LOAD( "bg1",          0x1000, 0x1000, 0xc8ddb8ba )
1652 
1653 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1654 	ROM_LOAD( "fg3",          0x0000, 0x2000, 0x97d4e63b )	/* sprites */
1655 	ROM_LOAD( "fg2",          0x2000, 0x2000, 0xf76e56ca )
1656 	ROM_LOAD( "fg1",          0x4000, 0x2000, 0x698c395f )
1657 	ROM_LOAD( "fg0",          0x6000, 0x2000, 0xf23269fb )
1658 ROM_END
1659 
1660 ROM_START( sqbert )
1661 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1662 	ROM_LOAD( "qb-rom2.bin",  0xa000, 0x2000, 0x1e3d4038 )
1663 	ROM_LOAD( "qb-rom1.bin",  0xc000, 0x2000, 0xeaf3076c )
1664 	ROM_LOAD( "qb-rom0.bin",  0xe000, 0x2000, 0x61260a7e )
1665 
1666 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1667 	ROM_LOAD( "qb-snd1.bin",  0xf000, 0x800, 0x15787c07 )
1668 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1669 	ROM_LOAD( "qb-snd2.bin",  0xf800, 0x800, 0x58437508 )
1670 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1671 
1672 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1673 	ROM_LOAD( "qb-bg0.bin",   0x0000, 0x1000, 0xc3118eef )	/* chars */
1674 	ROM_LOAD( "qb-bg1.bin",   0x1000, 0x1000, 0x4f6d8075 )
1675 
1676 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1677 	ROM_LOAD( "qb-fg3.bin",   0x0000, 0x2000, 0xee595eda )	/* sprites */
1678 	ROM_LOAD( "qb-fg2.bin",   0x2000, 0x2000, 0x59884c78 )
1679 	ROM_LOAD( "qb-fg1.bin",   0x4000, 0x2000, 0x2a60e3ad )
1680 	ROM_LOAD( "qb-fg0.bin",   0x6000, 0x2000, 0xb11ad9d8 )
1681 ROM_END
1682 
1683 ROM_START( qbertqub )
1684 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1685 	ROM_LOAD( "qq-rom3.bin",  0x8000, 0x2000, 0xc4dbdcd7 )
1686 	ROM_LOAD( "qq-rom2.bin",  0xa000, 0x2000, 0x21a6c6cc )
1687 	ROM_LOAD( "qq-rom1.bin",  0xc000, 0x2000, 0x63e6c43d )
1688 	ROM_LOAD( "qq-rom0.bin",  0xe000, 0x2000, 0x8ddbe438 )
1689 
1690 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1691 	ROM_LOAD( "qb-snd1.bin",  0xf000, 0x800, 0x15787c07 )
1692 	ROM_RELOAD(               0x7000, 0x800 ) /* A15 is not decoded */
1693 	ROM_LOAD( "qb-snd2.bin",  0xf800, 0x800, 0x58437508 )
1694 	ROM_RELOAD(               0x7800, 0x800 ) /* A15 is not decoded */
1695 
1696 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1697 	ROM_LOAD( "qq-bg0.bin",   0x0000, 0x1000, 0x050badde )	/* chars */
1698 	ROM_LOAD( "qq-bg1.bin",   0x1000, 0x1000, 0x8875902f )
1699 
1700 	ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1701 	ROM_LOAD( "qq-fg3.bin",   0x0000, 0x4000, 0x91a949cc )	/* sprites */
1702 	ROM_LOAD( "qq-fg2.bin",   0x4000, 0x4000, 0x782d9431 )
1703 	ROM_LOAD( "qq-fg1.bin",   0x8000, 0x4000, 0x71c3ac4c )
1704 	ROM_LOAD( "qq-fg0.bin",   0xc000, 0x4000, 0x6192853f )
1705 ROM_END
1706 
1707 ROM_START( krull )
1708 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1709 	ROM_LOAD( "ram2.bin",     0x1000, 0x1000, 0x302feadf )
1710 	ROM_LOAD( "ram4.bin",     0x2000, 0x1000, 0x79355a60 )
1711 	ROM_LOAD( "rom4.bin",     0x6000, 0x2000, 0x2b696394 )
1712 	ROM_LOAD( "rom3.bin",     0x8000, 0x2000, 0x14b0ee42 )
1713 	ROM_LOAD( "rom2.bin",     0xa000, 0x2000, 0xb5fad94a )
1714 	ROM_LOAD( "rom1.bin",     0xc000, 0x2000, 0x1ad956a3 )
1715 	ROM_LOAD( "rom0.bin",     0xe000, 0x2000, 0xa466afae )
1716 
1717 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1718 	ROM_LOAD( "snd1.bin",     0xe000, 0x1000, 0xdd2b30b4 )
1719 	ROM_RELOAD(               0x6000, 0x1000 ) /* A15 is not decoded */
1720 	ROM_LOAD( "snd2.bin",     0xf000, 0x1000, 0x8cab901b )
1721 	ROM_RELOAD(               0x7000, 0x1000 ) /* A15 is not decoded */
1722 
1723 	/* no gfx1 (RAM is used) */
1724 
1725 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1726 	ROM_LOAD( "fg3.bin",      0x0000, 0x2000, 0x82d77a45 )	/* sprites */
1727 	ROM_LOAD( "fg2.bin",      0x2000, 0x2000, 0x25a24317 )
1728 	ROM_LOAD( "fg1.bin",      0x4000, 0x2000, 0x7e3ad7b0 )
1729 	ROM_LOAD( "fg0.bin",      0x6000, 0x2000, 0x7402dc19 )
1730 ROM_END
1731 
1732 ROM_START( mach3 )
1733 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1734 	ROM_LOAD( "m3rom4.bin",   0x6000, 0x2000, 0x8bfd5a44 )
1735 	ROM_LOAD( "m3rom3.bin",   0x8000, 0x2000, 0xb1b045af )
1736 	ROM_LOAD( "m3rom2.bin",   0xa000, 0x2000, 0xfbdfb03d )
1737 	ROM_LOAD( "m3rom1.bin",   0xc000, 0x2000, 0x3b0ba80b )
1738 	ROM_LOAD( "m3rom0.bin",   0xe000, 0x2000, 0x70c12bf4 )
1739 
1740 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1741 	ROM_LOAD( "m3drom1.bin",  0xf000, 0x1000, 0xa6e29212 )
1742 
1743 	ROM_REGION( 0x10000, REGION_CPU3 )	/* 64k for second sound cpu */
1744 	ROM_LOAD( "m3yrom1.bin",  0xf000, 0x1000, 0xeddf8872 )
1745 
1746 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1747 	ROM_LOAD( "mach3bg0.bin", 0x0000, 0x1000, 0xea2f5257 )
1748 	ROM_LOAD( "mach3bg1.bin", 0x1000, 0x1000, 0xf543e4ce )
1749 
1750 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1751 	ROM_LOAD( "mach3fg3.bin", 0x0000, 0x2000, 0x472128b4 )
1752 	ROM_LOAD( "mach3fg2.bin", 0x2000, 0x2000, 0x2a59e99e )
1753 	ROM_LOAD( "mach3fg1.bin", 0x4000, 0x2000, 0x9b88767b )
1754 	ROM_LOAD( "mach3fg0.bin", 0x6000, 0x2000, 0x0bae12a5 )
1755 ROM_END
1756 
1757 ROM_START( usvsthem )
1758 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1759 	ROM_LOAD( "usvs.rm4",     0x6000, 0x2000, 0x0d7a4072 )
1760 	ROM_LOAD( "usvs.rm3",     0x8000, 0x2000, 0x6f32a671 )
1761 	ROM_LOAD( "usvs.rm2",     0xa000, 0x2000, 0x36770716 )
1762 	ROM_LOAD( "usvs.rm1",     0xc000, 0x2000, 0x697bc989 )
1763 	ROM_LOAD( "usvs.rm0",     0xe000, 0x2000, 0x30cf6bd9 )
1764 
1765 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1766 	ROM_LOAD( "usvsdrom.1",   0xe000, 0x2000, 0xc0b5cab0 )
1767 
1768 	ROM_REGION( 0x10000, REGION_CPU3 )	/* 64k for second sound cpu */
1769 	ROM_LOAD( "usvsyrom.1",   0xe000, 0x2000, 0xc3d245ca )
1770 
1771 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1772 	ROM_LOAD( "usvs.bg0",     0x0000, 0x1000, 0x8a0de09f )
1773 	ROM_LOAD( "usvs.bg1",     0x1000, 0x1000, 0x6fb64d3c )
1774 
1775 	ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1776 	ROM_LOAD( "usvs.fg3",     0x0000, 0x4000, 0x98703015 )
1777 	ROM_LOAD( "usvs.fg2",     0x4000, 0x4000, 0xd3990707 )
1778 	ROM_LOAD( "usvs.fg1",     0x8000, 0x4000, 0xa2057430 )
1779 	ROM_LOAD( "usvs.fg0",     0xc000, 0x4000, 0x7734e53f )
1780 ROM_END
1781 
1782 ROM_START( 3stooges )
1783 	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
1784 	ROM_LOAD( "gv113ram.4",   0x2000, 0x1000, 0x533bff2a )
1785 	ROM_LOAD( "gv113rom.4",   0x6000, 0x2000, 0x8b6e52b8 )
1786 	ROM_LOAD( "gv113rom.3",   0x8000, 0x2000, 0xb816d8c4 )
1787 	ROM_LOAD( "gv113rom.2",   0xa000, 0x2000, 0xb45b2a79 )
1788 	ROM_LOAD( "gv113rom.1",   0xc000, 0x2000, 0x34ab051e )
1789 	ROM_LOAD( "gv113rom.0",   0xe000, 0x2000, 0xab124329 )
1790 
1791 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1792 	ROM_LOAD( "drom1",        0xe000, 0x2000, 0x87a9fa10 )
1793 
1794 	ROM_REGION( 0x10000, REGION_CPU3 )	/* 64k for second sound cpu */
1795 	ROM_LOAD( "yrom2",        0xc000, 0x2000, 0x90f9c940 )
1796 	ROM_LOAD( "yrom1",        0xe000, 0x2000, 0x55f8ab30 )
1797 
1798 	/* no gfx1 (RAM is used) */
1799 
1800 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1801 	ROM_LOAD( "gv113fg3",     0x0000, 0x2000, 0x28071212 )	/* sprites */
1802 	ROM_LOAD( "gv113fg2",     0x2000, 0x2000, 0x9fa3dfde )
1803 	ROM_LOAD( "gv113fg1",     0x4000, 0x2000, 0xfb223854 )
1804 	ROM_LOAD( "gv113fg0",     0x6000, 0x2000, 0x95762c53 )
1805 ROM_END
1806 
1807 ROM_START( curvebal )
1808 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1809 	ROM_LOAD( "cb-rom-3.chp", 0x8000, 0x2000, 0x72ad4d45 )
1810 	ROM_LOAD( "cb-rom-2.chp", 0xa000, 0x2000, 0xd46c3db5 )
1811 	ROM_LOAD( "cb-rom-1.chp", 0xc000, 0x2000, 0xeb1e08bd )
1812 	ROM_LOAD( "cb-rom-0.chp", 0xe000, 0x2000, 0x401fc7e3 )
1813 
1814 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for sound cpu */
1815 	ROM_LOAD( "yrom.sbd",     0xe000, 0x1000, 0x4c313d9b )
1816 	ROM_LOAD( "drom.sbd",     0xf000, 0x1000, 0xcecece88 )
1817 
1818 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1819 	ROM_LOAD( "cb-bg-0.chp",  0x0000, 0x1000, 0xd666a179 )
1820 	ROM_LOAD( "cb-bg-1.chp",  0x1000, 0x1000, 0x5e34ff4e )
1821 
1822 	ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
1823 	ROM_LOAD( "cb-fg-3.chp",  0x0000, 0x2000, 0x9c9452fe )
1824 	ROM_LOAD( "cb-fg-2.chp",  0x2000, 0x2000, 0x065131af )
1825 	ROM_LOAD( "cb-fg-1.chp",  0x4000, 0x2000, 0x1b7b7f94 )
1826 	ROM_LOAD( "cb-fg-0.chp",  0x6000, 0x2000, 0xe3a8230e )
1827 ROM_END
1828 
1829 
1830 static void init_reactor(void)
1831 {
1832 	samples_interface.samplenames = reactor_sample_names;
1833 }
1834 
init_qbert(void)1835 static void init_qbert(void)
1836 {
1837 	samples_interface.samplenames = qbert_sample_names;
1838 }
1839 
init_gottlieb(void)1840 static void init_gottlieb(void)
1841 {
1842 	gottlieb_sound_init();
1843 }
1844 
1845 
1846 GAME( 1982, reactor,  0,     reactor,  reactor,  reactor,  ROT0,   "Gottlieb", "Reactor" )
1847 GAME( 1983, mplanets, 0,     gottlieb, mplanets, 0,        ROT270, "Gottlieb", "Mad Planets" )
1848 GAME( 1982, qbert,    0,     gottlieb, qbert,    qbert,    ROT270, "Gottlieb", "Q*bert (US)" )
1849 GAME( 1982, qbertjp,  qbert, gottlieb, qbert,    qbert,    ROT270, "Gottlieb (Konami license)", "Q*bert (Japan)" )
1850 GAMEX(1982, insector, 0,     gottlieb, insector, 0,        ROT0,   "Gottlieb", "Insector (prototype)", GAME_NO_SOUND )
1851 GAME( 1983, krull,    0,     krull,    krull,    0,        ROT270, "Gottlieb", "Krull" )
1852 GAME( 1983, sqbert,   0,     gottlieb, qbert,    qbert,    ROT270, "Mylstar", "Faster, Harder, More Challenging Q*bert (prototype)" )
1853 GAMEX(1983, mach3,    0,     mach3,    mach3,    gottlieb, ROT0,   "Mylstar", "M.A.C.H. 3", GAME_NOT_WORKING )
1854 GAMEX(????, usvsthem, 0,     usvsthem, usvsthem, gottlieb, ROT0,   "Mylstar", "Us vs. Them", GAME_NOT_WORKING )
1855 GAMEX(1984, 3stooges, 0,     stooges,  3stooges, gottlieb, ROT0,   "Mylstar", "Three Stooges", GAME_IMPERFECT_SOUND )
1856 GAME( 1983, qbertqub, 0,     qbertqub, qbertqub, qbert,    ROT270, "Mylstar", "Q*bert's Qubes" )
1857 GAME( 1983, screwloo, 0,     gottlieb2,screwloo, 0,        ROT0,   "Mylstar", "Screw Loose (prototype)" )
1858 GAME( 1984, curvebal, 0,     gottlieb, curvebal, 0,        ROT270, "Mylstar", "Curve Ball" )
1859