1 /*******************************************************************
2 Rolling Thunder
3 (C) 1986 Namco
4 
5 To Do:
6 -----
7 Remove sprite lag (watch the "bullets" signs on the walls during scrolling).
8   Increasing vblank_duration does it but some sprites flicker.
9 
10 Add correct dipswitches and potentially fix controls in Wonder Momo.
11 
12 Notes:
13 -----
14 PCM roms sample tables:
15 At the beggining of each PCM sound ROM you can find a 2 byte
16 offset to the beggining of each sample in the rom. Since the
17 table is not in sequential order, it is possible that the order
18 of the table is actually the sound number. Each sample ends in
19 a 0xff mark.
20 
21 *******************************************************************/
22 
23 #include "driver.h"
24 #include "cpu/m6809/m6809.h"
25 #include "cpu/m6800/m6800.h"
26 
27 extern unsigned char *rthunder_videoram1, *rthunder_videoram2, *spriteram, *dirtybuffer;
28 
29 /*******************************************************************/
30 
31 PALETTE_INIT( namcos86 );
32 VIDEO_START( namcos86 );
33 VIDEO_UPDATE( namcos86 );
34 READ_HANDLER( rthunder_videoram1_r );
35 WRITE_HANDLER( rthunder_videoram1_w );
36 READ_HANDLER( rthunder_videoram2_r );
37 WRITE_HANDLER( rthunder_videoram2_w );
38 WRITE_HANDLER( rthunder_scroll0_w );
39 WRITE_HANDLER( rthunder_scroll1_w );
40 WRITE_HANDLER( rthunder_scroll2_w );
41 WRITE_HANDLER( rthunder_scroll3_w );
42 WRITE_HANDLER( rthunder_backcolor_w );
43 WRITE_HANDLER( rthunder_tilebank_select_0_w );
44 WRITE_HANDLER( rthunder_tilebank_select_1_w );
45 
46 
47 
48 /*******************************************************************/
49 
50 /* Sampled voices (Modified and Added by Takahiro Nogi. 1999/09/26) */
51 
52 /* signed/unsigned 8-bit conversion macros */
53 #define AUDIO_CONV(A) ((A)^0x80)
54 
55 static int rt_totalsamples[7];
56 static int rt_decode_mode;
57 
58 
rt_decode_sample(const struct MachineSound * msound)59 static int rt_decode_sample(const struct MachineSound *msound)
60 {
61 	struct GameSamples *samples;
62 	unsigned char *src, *scan, *dest, last=0;
63 	int size, n = 0, j;
64 	int decode_mode;
65 
66 	j = memory_region_length(REGION_SOUND1);
67 	if (j == 0) return 0;	/* no samples in this game */
68 	else if (j == 0x80000)	/* genpeitd */
69 		rt_decode_mode = 1;
70 	else
71 		rt_decode_mode = 0;
72 
73 	logerror("pcm decode mode:%d\n", rt_decode_mode );
74 	if (rt_decode_mode != 0) {
75 		decode_mode = 6;
76 	} else {
77 		decode_mode = 4;
78 	}
79 
80 	/* get amount of samples */
81 	for ( j = 0; j < decode_mode; j++ ) {
82 		src = memory_region(REGION_SOUND1)+ ( j * 0x10000 );
83 		rt_totalsamples[j] = ( ( src[0] << 8 ) + src[1] ) / 2;
84 		n += rt_totalsamples[j];
85 		logerror("rt_totalsamples[%d]:%d\n", j, rt_totalsamples[j] );
86 	}
87 
88 	/* calculate the amount of headers needed */
89 	size = sizeof( struct GameSamples ) + n * sizeof( struct GameSamples * );
90 
91 	/* allocate */
92 	if ( ( Machine->samples = auto_malloc( size ) ) == NULL )
93 		return 1;
94 
95 	samples = Machine->samples;
96 	samples->total = n;
97 
98 	for ( n = 0; n < samples->total; n++ ) {
99 		int indx, start, offs;
100 
101 		if ( n < rt_totalsamples[0] ) {
102 			src = memory_region(REGION_SOUND1);
103 			indx = n;
104 		} else
105 			if ( ( n - rt_totalsamples[0] ) < rt_totalsamples[1] ) {
106 				src = memory_region(REGION_SOUND1)+0x10000;
107 				indx = n - rt_totalsamples[0];
108 			} else
109 				if ( ( n - ( rt_totalsamples[0] + rt_totalsamples[1] ) ) < rt_totalsamples[2] ) {
110 					src = memory_region(REGION_SOUND1)+0x20000;
111 					indx = n - ( rt_totalsamples[0] + rt_totalsamples[1] );
112 				} else
113 					if ( ( n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] ) ) < rt_totalsamples[3] ) {
114 						src = memory_region(REGION_SOUND1)+0x30000;
115 						indx = n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] );
116 					} else
117 						if ( ( n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] ) ) < rt_totalsamples[4] ) {
118 							src = memory_region(REGION_SOUND1)+0x40000;
119 							indx = n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] );
120 						} else
121 							if ( ( n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4] ) ) < rt_totalsamples[5] ) {
122 								src = memory_region(REGION_SOUND1)+0x50000;
123 								indx = n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4] );
124 							} else {
125 								src = memory_region(REGION_SOUND1)+0x60000;
126 								indx = n - ( rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4] + rt_totalsamples[5] );
127 							}
128 
129 		/* calculate header offset */
130 		offs = indx * 2;
131 
132 		/* get sample start offset */
133 		start = ( src[offs] << 8 ) + src[offs+1];
134 
135 		/* calculate the sample size */
136 		scan = &src[start];
137 		size = 0;
138 
139 		while ( *scan != 0xff ) {
140 			if ( *scan == 0x00 ) { /* run length encoded data start tag */
141 				/* get RLE size */
142 				size += scan[1] + 1;
143 				scan += 2;
144 			} else {
145 				size++;
146 				scan++;
147 			}
148 		}
149 
150 		/* allocate sample */
151 		if ( ( samples->sample[n] = auto_malloc( sizeof( struct GameSample ) + size * sizeof( unsigned char ) ) ) == NULL )
152 			return 1;
153 
154 		/* fill up the sample info */
155 		samples->sample[n]->length = size;
156 		samples->sample[n]->smpfreq = 6000;	/* 6 kHz */
157 		samples->sample[n]->resolution = 8;	/* 8 bit */
158 
159 		/* unpack sample */
160 		dest = (unsigned char *)samples->sample[n]->data;
161 		scan = &src[start];
162 
163 		while ( *scan != 0xff ) {
164 			if ( *scan == 0x00 ) { /* run length encoded data start tag */
165 				int i;
166 				for ( i = 0; i <= scan[1]; i++ ) /* unpack RLE */
167 					*dest++ = last;
168 
169 				scan += 2;
170 			} else {
171 				last = AUDIO_CONV( scan[0] );
172 				*dest++ = last;
173 				scan++;
174 			}
175 		}
176 	}
177 
178 	return 0; /* no errors */
179 }
180 
181 
182 /* play voice sample (Modified and Added by Takahiro Nogi. 1999/09/26) */
183 static int voice[2];
184 
namco_voice_play(int offset,int data,int ch)185 static void namco_voice_play( int offset, int data, int ch ) {
186 
187 	if ( voice[ch] == -1 )
188 		sample_stop( ch );
189 	else
190 		sample_start( ch, voice[ch], 0 );
191 }
192 
WRITE_HANDLER(namco_voice0_play_w)193 static WRITE_HANDLER( namco_voice0_play_w ) {
194 
195 	namco_voice_play(offset, data, 0);
196 }
197 
WRITE_HANDLER(namco_voice1_play_w)198 static WRITE_HANDLER( namco_voice1_play_w ) {
199 
200 	namco_voice_play(offset, data, 1);
201 }
202 
203 /* select voice sample (Modified and Added by Takahiro Nogi. 1999/09/26) */
namco_voice_select(int offset,int data,int ch)204 static void namco_voice_select( int offset, int data, int ch ) {
205 
206 	logerror("Voice %d mode: %d select: %02x\n", ch, rt_decode_mode, data );
207 
208 	if ( data == 0 )
209 		sample_stop( ch );
210 
211 	if (rt_decode_mode != 0) {
212 		switch ( data & 0xe0 ) {
213 			case 0x00:
214 			break;
215 
216 			case 0x20:
217 				data &= 0x1f;
218 				data += rt_totalsamples[0];
219 			break;
220 
221 			case 0x40:
222 				data &= 0x1f;
223 				data += rt_totalsamples[0] + rt_totalsamples[1];
224 			break;
225 
226 			case 0x60:
227 				data &= 0x1f;
228 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2];
229 			break;
230 
231 			case 0x80:
232 				data &= 0x1f;
233 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3];
234 			break;
235 
236 			case 0xa0:
237 				data &= 0x1f;
238 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4];
239 			break;
240 
241 			case 0xc0:
242 				data &= 0x1f;
243 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4] + rt_totalsamples[5];
244 			break;
245 
246 			case 0xe0:
247 				data &= 0x1f;
248 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2] + rt_totalsamples[3] + rt_totalsamples[4] + rt_totalsamples[5] + rt_totalsamples[6];
249 			break;
250 		}
251 	} else {
252 		switch ( data & 0xc0 ) {
253 			case 0x00:
254 			break;
255 
256 			case 0x40:
257 				data &= 0x3f;
258 				data += rt_totalsamples[0];
259 			break;
260 
261 			case 0x80:
262 				data &= 0x3f;
263 				data += rt_totalsamples[0] + rt_totalsamples[1];
264 			break;
265 
266 			case 0xc0:
267 				data &= 0x3f;
268 				data += rt_totalsamples[0] + rt_totalsamples[1] + rt_totalsamples[2];
269 			break;
270 		}
271 	}
272 
273 	voice[ch] = data - 1;
274 }
275 
WRITE_HANDLER(namco_voice0_select_w)276 static WRITE_HANDLER( namco_voice0_select_w ) {
277 
278 	namco_voice_select(offset, data, 0);
279 }
280 
WRITE_HANDLER(namco_voice1_select_w)281 static WRITE_HANDLER( namco_voice1_select_w ) {
282 
283 	namco_voice_select(offset, data, 1);
284 }
285 /*******************************************************************/
286 
287 /* shared memory area with the mcu */
288 static unsigned char *shared1;
READ_HANDLER(shared1_r)289 static READ_HANDLER( shared1_r ) { return shared1[offset]; }
WRITE_HANDLER(shared1_w)290 static WRITE_HANDLER( shared1_w ) { shared1[offset] = data; }
291 
292 
293 
WRITE_HANDLER(spriteram_w)294 static WRITE_HANDLER( spriteram_w )
295 {
296 	spriteram[offset] = data;
297 }
READ_HANDLER(spriteram_r)298 static READ_HANDLER( spriteram_r )
299 {
300 	return spriteram[offset];
301 }
302 
WRITE_HANDLER(bankswitch1_w)303 static WRITE_HANDLER( bankswitch1_w )
304 {
305 	unsigned char *base = memory_region(REGION_CPU1) + 0x10000;
306 
307 	/* if the ROM expansion module is available, don't do anything. This avoids conflict */
308 	/* with bankswitch1_ext_w() in wndrmomo */
309 	if (memory_region(REGION_USER1)) return;
310 
311 	cpu_setbank(1,base + ((data & 0x03) * 0x2000));
312 }
313 
WRITE_HANDLER(bankswitch1_ext_w)314 static WRITE_HANDLER( bankswitch1_ext_w )
315 {
316 	unsigned char *base = memory_region(REGION_USER1);
317 
318 	if (base == 0) return;
319 
320 	cpu_setbank(1,base + ((data & 0x1f) * 0x2000));
321 }
322 
WRITE_HANDLER(bankswitch2_w)323 static WRITE_HANDLER( bankswitch2_w )
324 {
325 	unsigned char *base = memory_region(REGION_CPU2) + 0x10000;
326 
327 	cpu_setbank(2,base + ((data & 0x03) * 0x2000));
328 }
329 
330 /* Stubs to pass the correct Dip Switch setup to the MCU */
READ_HANDLER(dsw0_r)331 static READ_HANDLER( dsw0_r )
332 {
333 	int rhi, rlo;
334 
335 	rhi = ( readinputport( 2 ) & 0x01 ) << 4;
336 	rhi |= ( readinputport( 2 ) & 0x04 ) << 3;
337 	rhi |= ( readinputport( 2 ) & 0x10 ) << 2;
338 	rhi |= ( readinputport( 2 ) & 0x40 ) << 1;
339 
340 	rlo = ( readinputport( 3 ) & 0x01 );
341 	rlo |= ( readinputport( 3 ) & 0x04 ) >> 1;
342 	rlo |= ( readinputport( 3 ) & 0x10 ) >> 2;
343 	rlo |= ( readinputport( 3 ) & 0x40 ) >> 3;
344 
345 	return ~( rhi | rlo ) & 0xff; /* Active Low */
346 }
347 
READ_HANDLER(dsw1_r)348 static READ_HANDLER( dsw1_r )
349 {
350 	int rhi, rlo;
351 
352 	rhi = ( readinputport( 2 ) & 0x02 ) << 3;
353 	rhi |= ( readinputport( 2 ) & 0x08 ) << 2;
354 	rhi |= ( readinputport( 2 ) & 0x20 ) << 1;
355 	rhi |= ( readinputport( 2 ) & 0x80 );
356 
357 	rlo = ( readinputport( 3 ) & 0x02 ) >> 1;
358 	rlo |= ( readinputport( 3 ) & 0x08 ) >> 2;
359 	rlo |= ( readinputport( 3 ) & 0x20 ) >> 3;
360 	rlo |= ( readinputport( 3 ) & 0x80 ) >> 4;
361 
362 	return ~( rhi | rlo ) & 0xff; /* Active Low */
363 }
364 
365 static int int_enabled[2];
366 
WRITE_HANDLER(int_ack1_w)367 static WRITE_HANDLER( int_ack1_w )
368 {
369 	int_enabled[0] = 1;
370 }
371 
WRITE_HANDLER(int_ack2_w)372 static WRITE_HANDLER( int_ack2_w )
373 {
374 	int_enabled[1] = 1;
375 }
376 
INTERRUPT_GEN(namco86_interrupt1)377 static INTERRUPT_GEN( namco86_interrupt1 )
378 {
379 	if (int_enabled[0])
380 	{
381 		int_enabled[0] = 0;
382 		cpu_set_irq_line(0, 0, HOLD_LINE);
383 	}
384 }
385 
INTERRUPT_GEN(namco86_interrupt2)386 static INTERRUPT_GEN( namco86_interrupt2 )
387 {
388 	if (int_enabled[1])
389 	{
390 		int_enabled[1] = 0;
391 		cpu_set_irq_line(1, 0, HOLD_LINE);
392 	}
393 }
394 
WRITE_HANDLER(namcos86_coin_w)395 static WRITE_HANDLER( namcos86_coin_w )
396 {
397 	coin_lockout_global_w(data & 1);
398 	coin_counter_w(0,~data & 2);
399 	coin_counter_w(1,~data & 4);
400 }
401 
WRITE_HANDLER(namcos86_led_w)402 static WRITE_HANDLER( namcos86_led_w )
403 {
404 	set_led_status(0,data & 0x08);
405 	set_led_status(1,data & 0x10);
406 }
407 
408 
409 /*******************************************************************/
410 
MEMORY_READ_START(readmem1)411 static MEMORY_READ_START( readmem1 )
412 	{ 0x0000, 0x1fff, rthunder_videoram1_r },
413 	{ 0x2000, 0x3fff, rthunder_videoram2_r },
414 	{ 0x4000, 0x40ff, namcos1_wavedata_r }, /* PSG device, shared RAM */
415 	{ 0x4100, 0x413f, namcos1_sound_r }, /* PSG device, shared RAM */
416 	{ 0x4000, 0x43ff, shared1_r },
417 	{ 0x4400, 0x5fff, spriteram_r },
418 	{ 0x6000, 0x7fff, MRA_BANK1 },
419 	{ 0x8000, 0xffff, MRA_ROM },
420 MEMORY_END
421 
422 static MEMORY_WRITE_START( writemem1 )
423 	{ 0x0000, 0x1fff, rthunder_videoram1_w, &rthunder_videoram1 },
424 	{ 0x2000, 0x3fff, rthunder_videoram2_w, &rthunder_videoram2 },
425 
426 	{ 0x4000, 0x40ff, namcos1_wavedata_w, &namco_wavedata }, /* PSG device, shared RAM */
427 	{ 0x4100, 0x413f, namcos1_sound_w, &namco_soundregs }, /* PSG device, shared RAM */
428 	{ 0x4000, 0x43ff, shared1_w, &shared1 },
429 
430 	{ 0x4400, 0x5fff, spriteram_w, &spriteram },
431 
432 	{ 0x6000, 0x6000, namco_voice0_play_w },
433 	{ 0x6200, 0x6200, namco_voice0_select_w },
434 	{ 0x6400, 0x6400, namco_voice1_play_w },
435 	{ 0x6600, 0x6600, namco_voice1_select_w },
436 	{ 0x6800, 0x6800, bankswitch1_ext_w },
437 //	{ 0x6c00, 0x6c00, MWA_NOP }, /* ??? */
438 //	{ 0x6e00, 0x6e00, MWA_NOP }, /* ??? */
439 
440 	{ 0x8000, 0x8000, watchdog_reset_w },
441 	{ 0x8400, 0x8400, int_ack1_w }, /* IRQ acknowledge */
442 	{ 0x8800, 0x8800, rthunder_tilebank_select_0_w },
443 	{ 0x8c00, 0x8c00, rthunder_tilebank_select_1_w },
444 
445 	{ 0x9000, 0x9002, rthunder_scroll0_w },	/* scroll + priority */
446 	{ 0x9003, 0x9003, bankswitch1_w },
447 	{ 0x9004, 0x9006, rthunder_scroll1_w },	/* scroll + priority */
448 
449 	{ 0x9400, 0x9402, rthunder_scroll2_w },	/* scroll + priority */
450 //	{ 0x9403, 0x9403 } sub CPU rom bank select would be here
451 	{ 0x9404, 0x9406, rthunder_scroll3_w },	/* scroll + priority */
452 
453 	{ 0xa000, 0xa000, rthunder_backcolor_w },
454 
455 	{ 0x8000, 0xffff, MWA_ROM },
456 MEMORY_END
457 
458 
459 #define CPU2_MEMORY(NAME,ADDR_SPRITE,ADDR_VIDEO1,ADDR_VIDEO2,ADDR_ROM,ADDR_BANK,ADDR_WDOG,ADDR_INT)	\
460 static MEMORY_READ_START( NAME##_readmem2 )											\
461 	{ ADDR_SPRITE+0x0000, ADDR_SPRITE+0x03ff, MRA_RAM },							\
462 	{ ADDR_SPRITE+0x0400, ADDR_SPRITE+0x1fff, spriteram_r },						\
463 	{ ADDR_VIDEO1+0x0000, ADDR_VIDEO1+0x1fff, rthunder_videoram1_r },				\
464 	{ ADDR_VIDEO2+0x0000, ADDR_VIDEO2+0x1fff, rthunder_videoram2_r },				\
465 	{ ADDR_ROM+0x0000, ADDR_ROM+0x1fff, MRA_BANK2 },								\
466 	{ 0x8000, 0xffff, MRA_ROM },													\
467 MEMORY_END																			\
468 																					\
469 static MEMORY_WRITE_START( NAME##_writemem2 )										\
470 	{ ADDR_SPRITE+0x0000, ADDR_SPRITE+0x03ff, MWA_RAM },							\
471 	{ ADDR_SPRITE+0x0400, ADDR_SPRITE+0x1fff, spriteram_w },						\
472 	{ ADDR_VIDEO1+0x0000, ADDR_VIDEO1+0x1fff, rthunder_videoram1_w },				\
473 	{ ADDR_VIDEO2+0x0000, ADDR_VIDEO2+0x1fff, rthunder_videoram2_w },				\
474 /*	{ ADDR_BANK+0x00, ADDR_BANK+0x02 } layer 2 scroll registers would be here */	\
475 	{ ADDR_BANK+0x03, ADDR_BANK+0x03, bankswitch2_w },								\
476 /*	{ ADDR_BANK+0x04, ADDR_BANK+0x06 } layer 3 scroll registers would be here */	\
477 	{ ADDR_WDOG, ADDR_WDOG, watchdog_reset_w },										\
478 	{ ADDR_INT, ADDR_INT, int_ack2_w },	/* IRQ acknowledge */						\
479 	{ ADDR_ROM+0x0000, ADDR_ROM+0x1fff, MWA_ROM },									\
480 	{ 0x8000, 0xffff, MWA_ROM },													\
481 MEMORY_END
482 
483 #define UNUSED 0x4000
484 /*                     SPRITE  VIDEO1  VIDEO2  ROM     BANK    WDOG    IRQACK */
485 CPU2_MEMORY( hopmappy, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 0x9000, UNUSED )
486 CPU2_MEMORY( skykiddx, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 0x9000, 0x9400 )
487 CPU2_MEMORY( roishtar, 0x0000, 0x6000, 0x4000, UNUSED, UNUSED, 0xa000, 0xb000 )
488 CPU2_MEMORY( genpeitd, 0x4000, 0x0000, 0x2000, UNUSED, UNUSED, 0xb000, 0x8800 )
489 CPU2_MEMORY( rthunder, 0x0000, 0x2000, 0x4000, 0x6000, 0xd800, 0x8000, 0x8800 )
490 CPU2_MEMORY( wndrmomo, 0x2000, 0x4000, 0x6000, UNUSED, UNUSED, 0xc000, 0xc800 )
491 #undef UNUSED
492 
493 
494 #define MCU_MEMORY(NAME,ADDR_LOWROM,ADDR_INPUT,ADDR_UNK1,ADDR_UNK2)			\
495 static MEMORY_READ_START( NAME##_mcu_readmem )								\
496 	{ 0x0000, 0x001f, hd63701_internal_registers_r },						\
497 	{ 0x0080, 0x00ff, MRA_RAM },											\
498 	{ 0x1000, 0x10ff, namcos1_wavedata_r }, /* PSG device, shared RAM */	\
499 	{ 0x1100, 0x113f, namcos1_sound_r }, /* PSG device, shared RAM */		\
500 	{ 0x1000, 0x13ff, shared1_r },											\
501 	{ 0x1400, 0x1fff, MRA_RAM },											\
502 	{ ADDR_INPUT+0x00, ADDR_INPUT+0x01, YM2151_status_port_0_r },			\
503 	{ ADDR_INPUT+0x20, ADDR_INPUT+0x20, input_port_0_r },					\
504 	{ ADDR_INPUT+0x21, ADDR_INPUT+0x21, input_port_1_r },					\
505 	{ ADDR_INPUT+0x30, ADDR_INPUT+0x30, dsw0_r },							\
506 	{ ADDR_INPUT+0x31, ADDR_INPUT+0x31, dsw1_r },							\
507 	{ ADDR_LOWROM, ADDR_LOWROM+0x3fff, MRA_ROM },							\
508 	{ 0x8000, 0xbfff, MRA_ROM },											\
509 	{ 0xf000, 0xffff, MRA_ROM },											\
510 MEMORY_END																	\
511 																			\
512 static MEMORY_WRITE_START( NAME##_mcu_writemem )							\
513 	{ 0x0000, 0x001f, hd63701_internal_registers_w },						\
514 	{ 0x0080, 0x00ff, MWA_RAM },											\
515 	{ 0x1000, 0x10ff, namcos1_wavedata_w }, /* PSG device, shared RAM */	\
516 	{ 0x1100, 0x113f, namcos1_sound_w }, /* PSG device, shared RAM */		\
517 	{ 0x1000, 0x13ff, shared1_w },											\
518 	{ 0x1400, 0x1fff, MWA_RAM },											\
519 	{ ADDR_INPUT+0x00, ADDR_INPUT+0x00, YM2151_register_port_0_w },			\
520 	{ ADDR_INPUT+0x01, ADDR_INPUT+0x01, YM2151_data_port_0_w },				\
521 	{ ADDR_UNK1, ADDR_UNK1, MWA_NOP }, /* ??? written (not always) at end of interrupt */	\
522 	{ ADDR_UNK2, ADDR_UNK2, MWA_NOP }, /* ??? written (not always) at end of interrupt */	\
523 	{ ADDR_LOWROM, ADDR_LOWROM+0x3fff, MWA_ROM },							\
524 	{ 0x8000, 0xbfff, MWA_ROM },											\
525 	{ 0xf000, 0xffff, MWA_ROM },											\
526 MEMORY_END
527 
528 #define UNUSED 0x4000
529 /*                    LOWROM   INPUT    UNK1    UNK2 */
530 MCU_MEMORY( hopmappy, UNUSED, 0x2000, 0x8000, 0x8800 )
531 MCU_MEMORY( skykiddx, UNUSED, 0x2000, 0x8000, 0x8800 )
532 MCU_MEMORY( roishtar, 0x0000, 0x6000, 0x8000, 0x9800 )
533 MCU_MEMORY( genpeitd, 0x4000, 0x2800, 0xa000, 0xa800 )
534 MCU_MEMORY( rthunder, 0x4000, 0x2000, 0xb000, 0xb800 )
535 MCU_MEMORY( wndrmomo, 0x4000, 0x3800, 0xc000, 0xc800 )
536 #undef UNUSED
537 
538 
539 static READ_HANDLER( readFF )
540 {
541 	return 0xff;
542 }
543 
PORT_READ_START(mcu_readport)544 static PORT_READ_START( mcu_readport )
545 	{ HD63701_PORT1, HD63701_PORT1, input_port_4_r },
546 	{ HD63701_PORT2, HD63701_PORT2, readFF },	/* leds won't work otherwise */
547 PORT_END
548 
549 static PORT_WRITE_START( mcu_writeport )
550 	{ HD63701_PORT1, HD63701_PORT1, namcos86_coin_w },
551 	{ HD63701_PORT2, HD63701_PORT2, namcos86_led_w },
552 PORT_END
553 
554 
555 /*******************************************************************/
556 
557 INPUT_PORTS_START( hopmappy )
558 	PORT_START
559 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
560 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 2 player 1 */
561 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
562 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
563 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
564 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
565 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
566 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
567 
568 	PORT_START
569 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
570 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 2 player 2 */
571 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
572 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
573 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
574 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
575 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
576 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
577 
578 	PORT_START      /* DSWA */
579 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
580 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
581 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
582 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
583 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
584 	PORT_DIPNAME( 0x04, 0x00, "Allow Continue" )
585 	PORT_DIPSETTING(    0x04, DEF_STR( No ) )
586 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
587 	PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) )
588 	PORT_DIPSETTING(    0x08, "1" )
589 	PORT_DIPSETTING(    0x10, "2" )
590 	PORT_DIPSETTING(    0x00, "3" )
591 	PORT_DIPSETTING(    0x18, "5" )
592 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
593 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
594 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
595 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
596 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
597 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
598 
599 	PORT_START      /* DSWB */
600 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
601 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
602 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
603 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
604 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
605 	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
606 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
607 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
608 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
609 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
610 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
611 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
612 	PORT_BITX(    0x10, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Level Select", IP_KEY_NONE, IP_JOY_NONE )
613 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
614 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
615 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ) )
616 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
617 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
618 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
619 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
620 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
621 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Difficulty ) )
622 	PORT_DIPSETTING(    0x00, "Easy" )
623 	PORT_DIPSETTING(    0x80, "Hard" )
624 
625 	PORT_START
626 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
627 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
628 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
629 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
630 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
631 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
632 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
633 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
634 INPUT_PORTS_END
635 
636 INPUT_PORTS_START( skykiddx )
637 	PORT_START
638 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
639 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
640 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
641 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
642 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
643 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
644 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
645 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
646 
647 	PORT_START
648 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
649 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
650 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
651 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
652 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
653 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
654 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
655 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
656 
657 	PORT_START      /* DSWA */
658 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
659 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
660 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
661 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
662 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
663 	PORT_DIPNAME( 0x04, 0x00, "Freeze" )
664 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
665 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
666 	PORT_BITX(    0x08, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Level Select", IP_KEY_NONE, IP_JOY_NONE )
667 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
668 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
669 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
670 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
671 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
672 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
673 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
674 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
675 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
676 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
677 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
678 
679 	PORT_START      /* DSWB */
680 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
681 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
682 	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
683 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
684 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
685 	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
686 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
687 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
688 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
689 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
690 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
691 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
692 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
693 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
694 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
695 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Bonus_Life ) )
696 	PORT_DIPSETTING(    0x20, "20000 80000" )
697 	PORT_DIPSETTING(    0x00, "30000 90000" )
698 	PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
699 	PORT_DIPSETTING(    0x40, "1" )
700 	PORT_DIPSETTING(    0x80, "2" )
701 	PORT_DIPSETTING(    0x00, "3" )
702 	PORT_DIPSETTING(    0xc0, "5" )
703 
704 	PORT_START
705 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
706 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
707 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
708 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
709 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
710 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
711 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
712 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
713 INPUT_PORTS_END
714 
715 INPUT_PORTS_START( roishtar )
716 	PORT_START
717 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
718 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
719 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_8WAY )
720 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
721 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
722 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
723 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
724 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
725 
726 	PORT_START
727 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
728 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
729 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP  | IPF_8WAY )
730 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP | IPF_8WAY )
731 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
732 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
733 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
734 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
735 
736 	PORT_START      /* DSWA */
737 	PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
738 	PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
739 	PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
740 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
741 	PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
742 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
743 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
744 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
745 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
746 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
747 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
748 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
749 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
750 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
751 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
752 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
753 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
754 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
755 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
756 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
757 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
758 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
759 
760 	PORT_START      /* DSWB */
761 	PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_B ) )
762 	PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
763 	PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
764 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
765 	PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
766 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
767 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
768 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
769 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
770 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
771 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
772 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
773 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
774 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
775 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
776 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
777 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
778 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
779 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
780 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
781 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
782 	PORT_DIPNAME( 0x80, 0x00, "Freeze" )
783 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
784 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
785 
786 	PORT_START
787 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
788 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
789 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
790 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
791 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
792 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
793 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
794 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT | IPF_8WAY )
795 INPUT_PORTS_END
796 
797 INPUT_PORTS_START( genpeitd )
798 	PORT_START
799 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
800 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
801 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
802 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
803 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
804 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
805 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
806 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
807 
808 	PORT_START
809 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
810 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
811 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
812 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
813 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
814 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
815 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
816 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
817 
818 	PORT_START      /* DSWA */
819 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
820 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
821 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
822 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
823 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
824 	PORT_DIPNAME( 0x04, 0x00, "Freeze" )
825 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
826 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
827 	PORT_DIPNAME( 0x08, 0x00, "Allow Continue" )
828 	PORT_DIPSETTING(    0x08, DEF_STR( No ) )
829 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
830 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
831 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
832 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
833 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
834 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
835 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
836 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
837 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
838 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
839 
840 	PORT_START      /* DSWB */
841 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
842 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
843 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
844 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
845 	PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
846 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
847 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
848 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
849 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
850 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
851 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
852 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
853 	PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) )
854 	PORT_DIPSETTING(    0x10, "Easy" )
855 	PORT_DIPSETTING(    0x00, "Normal" )
856 	PORT_DIPSETTING(    0x20, "Hard" )
857 	PORT_DIPSETTING(    0x30, "Hardest" )
858 	PORT_DIPNAME( 0xc0, 0x00, "Candle" )
859 	PORT_DIPSETTING(    0x40, "40" )
860 	PORT_DIPSETTING(    0x00, "50" )
861 	PORT_DIPSETTING(    0x80, "60" )
862 	PORT_DIPSETTING(    0xc0, "70" )
863 
864 	PORT_START
865 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
866 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
867 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
868 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
869 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
870 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
871 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
872 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
873 INPUT_PORTS_END
874 
875 INPUT_PORTS_START( rthunder )
876 	PORT_START
877 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
878 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
879 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
880 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_PLAYER2 )
881 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
882 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
883 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
884 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
885 
886 	PORT_START
887 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
888 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
889 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
890 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_PLAYER2 )
891 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
892 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
893 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
894 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
895 
896 	PORT_START      /* DSWA */
897 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
898 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
899 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
900 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
901 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
902 	PORT_DIPNAME( 0x04, 0x00, "Freeze" )
903 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
904 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
905 	PORT_BITX(    0x08, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
906 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
907 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
908 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
909 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
910 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
911 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
912 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
913 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
914 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
915 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
916 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
917 
918 	PORT_START      /* DSWB */
919 	PORT_DIPNAME( 0x01, 0x00, "Continues" )
920 	PORT_DIPSETTING(    0x01, "3" )
921 	PORT_DIPSETTING(    0x00, "6" )
922 	PORT_DIPNAME( 0x06, 0x00, DEF_STR( Cabinet ) )
923 	PORT_DIPSETTING(    0x00, "Upright 1 Player" )
924 /*	PORT_DIPSETTING(    0x04, "Upright 1 Player" ) */
925 	PORT_DIPSETTING(    0x02, "Upright 2 Players" )
926 	PORT_DIPSETTING(    0x06, DEF_STR( Cocktail ) )
927 	PORT_DIPNAME( 0x08, 0x08, "Level Select" )
928 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
929 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
930 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Difficulty ) )
931 	PORT_DIPSETTING(    0x00, "Normal" )
932 	PORT_DIPSETTING(    0x10, "Easy" )
933 	PORT_DIPNAME( 0x20, 0x20, "Timer value" )
934 	PORT_DIPSETTING(    0x00, "120 secs" )
935 	PORT_DIPSETTING(    0x20, "150 secs" )
936 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
937 	PORT_DIPSETTING(    0x00, "70k, 200k" )
938 	PORT_DIPSETTING(    0x40, "100k, 300k" )
939 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
940 	PORT_DIPSETTING(    0x00, "3" )
941 	PORT_DIPSETTING(    0x80, "5" )
942 
943 	PORT_START
944 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
945 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
946 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
947 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
948 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
949 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
950 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
951 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_PLAYER2 )
952 INPUT_PORTS_END
953 
954 INPUT_PORTS_START( rthundro )
955 	PORT_START
956 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
957 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
958 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
959 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_PLAYER2 )
960 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
961 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
962 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
963 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
964 
965 	PORT_START
966 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
967 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
968 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
969 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_PLAYER2 )
970 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
971 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
972 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
973 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
974 
975 	PORT_START      /* DSWA */
976 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
977 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
978 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
979 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
980 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
981 	PORT_DIPNAME( 0x04, 0x00, "Freeze" )
982 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
983 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
984 	PORT_BITX(    0x08, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
985 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
986 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
987 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
988 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
989 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
990 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
991 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
992 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
993 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
994 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
995 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
996 
997 	PORT_START      /* DSWB */
998 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
999 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1000 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1001 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
1002 	PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
1003 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1004 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1005 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1006 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1007 	PORT_BITX(    0x08, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Level Select", IP_KEY_NONE, IP_JOY_NONE )
1008 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1009 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1010 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1011 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1012 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1013 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1014 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1015 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1016 	PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
1017 	PORT_DIPSETTING(    0x40, "1" )
1018 	PORT_DIPSETTING(    0x80, "2" )
1019 	PORT_DIPSETTING(    0x00, "3" )
1020 	PORT_DIPSETTING(    0xc0, "5" )
1021 
1022 	PORT_START
1023 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
1024 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
1025 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
1026 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1027 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
1028 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
1029 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
1030 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
1031 INPUT_PORTS_END
1032 
1033 INPUT_PORTS_START( wndrmomo )
1034 	PORT_START
1035 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 2 */
1036 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1037 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
1038 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
1039 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
1040 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1041 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
1042 	PORT_BITX( 0x80, 0x80, IPT_SERVICE, "Service Switch", KEYCODE_F1, IP_JOY_NONE )
1043 
1044 	PORT_START
1045 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* button 3 player 1 */
1046 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
1047 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
1048 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_PLAYER2 )
1049 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
1050 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1051 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1052 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1053 
1054 	PORT_START      /* DSWA */
1055 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
1056 	PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
1057 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1058 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1059 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
1060 	PORT_DIPNAME( 0x04, 0x00, "Freeze" )
1061 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1062 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1063 	PORT_DIPNAME( 0x08, 0x08, "Level Select" )
1064 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1065 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1066 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
1067 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1068 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1069 	PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coin_A ) )
1070 	PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
1071 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1072 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1073 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
1074 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
1075 
1076 	PORT_START      /* DSWB */
1077 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1078 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1079 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1080 	PORT_DIPNAME( 0x06, 0x00, DEF_STR( Cabinet ) )
1081 	PORT_DIPSETTING(    0x00, "Type A" )
1082 	PORT_DIPSETTING(    0x02, "Type B" )
1083 	PORT_DIPSETTING(    0x04, "Type C" )
1084 //	PORT_DIPSETTING(    0x06, "Type A" )
1085 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1086 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1087 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1088 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1089 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1090 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1091 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1092 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1093 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1094 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1095 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1096 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1097 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1098 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1099 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1100 
1101 	PORT_START
1102 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin lockout */
1103 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 1 */
1104 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )	/* OUT:coin counter 2 */
1105 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1106 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
1107 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
1108 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
1109 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
1110 INPUT_PORTS_END
1111 
1112 
1113 /*******************************************************************/
1114 
1115 static struct GfxLayout tilelayout =
1116 {
1117 	8,8,
1118 	RGN_FRAC(1,3),
1119 	3,
1120 	{ RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
1121 	{ 0, 1, 2, 3, 4, 5, 6, 7 },
1122 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1123 	8*8
1124 };
1125 
1126 #define SPRITELAYOUT(NUM) static struct GfxLayout spritelayout_##NUM =         \
1127 {																			   \
1128 	16,16,	/* 16*16 sprites */												   \
1129 	NUM,	/* NUM sprites */												   \
1130 	4,	/* 4 bits per pixel */												   \
1131 	{ 0, 1, 2, 3 },															   \
1132 	{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,								   \
1133 			8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },					   \
1134 	{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,						   \
1135 			8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },			   \
1136 	16*64																	   \
1137 }
1138 
1139 SPRITELAYOUT(256);
1140 SPRITELAYOUT(512);
1141 SPRITELAYOUT(1024);
1142 
1143 
1144 #define GFXDECODE(SPRITE)													\
1145 static struct GfxDecodeInfo gfxdecodeinfo_##SPRITE[] =						\
1146 {																			\
1147 	{ REGION_GFX1, 0x00000,      &tilelayout,            2048*0, 256 },		\
1148 	{ REGION_GFX2, 0x00000,      &tilelayout,            2048*0, 256 },		\
1149 	{ REGION_GFX3, 0*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1150 	{ REGION_GFX3, 1*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1151 	{ REGION_GFX3, 2*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1152 	{ REGION_GFX3, 3*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1153 	{ REGION_GFX3, 4*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1154 	{ REGION_GFX3, 5*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1155 	{ REGION_GFX3, 6*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1156 	{ REGION_GFX3, 7*128*SPRITE, &spritelayout_##SPRITE, 2048*1, 128 },		\
1157 	{ -1 }																	\
1158 };
1159 
1160 GFXDECODE( 256)
1161 GFXDECODE( 512)
1162 GFXDECODE(1024)
1163 
1164 /*******************************************************************/
1165 
1166 static struct YM2151interface ym2151_interface =
1167 {
1168 	1,                      /* 1 chip */
1169 	3579580,                /* 3.579580 MHz ? */
1170 	{ YM3012_VOL(0,MIXER_PAN_CENTER,60,MIXER_PAN_CENTER) },	/* only right channel is connected */
1171 	{ 0 },
1172 	{ 0 }
1173 };
1174 
1175 static struct namco_interface namco_interface =
1176 {
1177 	49152000/2048, 		/* 24000Hz */
1178 	8,		/* number of voices */
1179 	50,     /* playback volume */
1180 	-1,		/* memory region */
1181 	0		/* stereo */
1182 };
1183 
1184 static struct Samplesinterface samples_interface =
1185 {
1186 	2,	/* 2 channels for voice effects */
1187 	40	/* volume */
1188 };
1189 
1190 static struct CustomSound_interface custom_interface =
1191 {
1192 	rt_decode_sample,
1193 	0,
1194 	0
1195 };
1196 
1197 
MACHINE_INIT(namco86)1198 static MACHINE_INIT( namco86 )
1199 {
1200 	unsigned char *base = memory_region(REGION_CPU1) + 0x10000;
1201 
1202 	cpu_setbank(1,base);
1203 
1204 	int_enabled[0] = int_enabled[1] = 1;
1205 }
1206 
1207 
1208 static MACHINE_DRIVER_START( hopmappy )
1209 
1210 	/* basic machine hardware */
1211 	MDRV_CPU_ADD_TAG("cpu1", M6809, 6000000/4)	/*49152000/32, rthunder doesn't work with this */
MDRV_CPU_MEMORY(readmem1,writemem1)1212 	MDRV_CPU_MEMORY(readmem1,writemem1)
1213 	MDRV_CPU_VBLANK_INT(namco86_interrupt1,1)
1214 
1215 	MDRV_CPU_ADD_TAG("cpu2", M6809, 49152000/32)
1216 	MDRV_CPU_MEMORY(hopmappy_readmem2,hopmappy_writemem2)
1217 	MDRV_CPU_VBLANK_INT(namco86_interrupt2,1)
1218 
1219 	MDRV_CPU_ADD_TAG("mcu", HD63701, 49152000/32)	/* or compatible 6808 with extra instructions */
1220 	MDRV_CPU_MEMORY(hopmappy_mcu_readmem,hopmappy_mcu_writemem)
1221 	MDRV_CPU_PORTS(mcu_readport,mcu_writeport)
1222 	MDRV_CPU_VBLANK_INT(irq0_line_hold,1)	/* ??? */
1223 
1224 	MDRV_FRAMES_PER_SECOND(60.606060)
1225 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
1226 	MDRV_INTERLEAVE(100)
1227 
1228 	MDRV_MACHINE_INIT(namco86)
1229 
1230 	/* video hardware */
1231 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1232 	MDRV_SCREEN_SIZE(36*8, 28*8)
1233 	MDRV_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
1234 	MDRV_GFXDECODE(gfxdecodeinfo_256)
1235 	MDRV_PALETTE_LENGTH(512)
1236 	MDRV_COLORTABLE_LENGTH(4096)
1237 
1238 	MDRV_PALETTE_INIT(namcos86)
1239 	MDRV_VIDEO_START(namcos86)
1240 	MDRV_VIDEO_UPDATE(namcos86)
1241 
1242 	/* sound hardware */
1243 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
1244 	MDRV_SOUND_ADD(NAMCO, namco_interface)
1245 	MDRV_SOUND_ADD(SAMPLES, samples_interface)
1246 	MDRV_SOUND_ADD(CUSTOM, custom_interface)
1247 MACHINE_DRIVER_END
1248 
1249 
1250 static MACHINE_DRIVER_START( skykiddx )
1251 
1252 	/* basic machine hardware */
1253 	MDRV_IMPORT_FROM(hopmappy)
1254 	MDRV_CPU_MODIFY("cpu2")
1255 	MDRV_CPU_MEMORY(skykiddx_readmem2,skykiddx_writemem2)
1256 
1257 	MDRV_CPU_MODIFY("mcu")
1258 	MDRV_CPU_MEMORY(skykiddx_mcu_readmem,skykiddx_mcu_writemem)
1259 MACHINE_DRIVER_END
1260 
1261 
1262 static MACHINE_DRIVER_START( roishtar )
1263 
1264 	/* basic machine hardware */
1265 	MDRV_IMPORT_FROM(hopmappy)
1266 	MDRV_CPU_MODIFY("cpu2")
1267 	MDRV_CPU_MEMORY(roishtar_readmem2,roishtar_writemem2)
1268 
1269 	MDRV_CPU_MODIFY("mcu")
1270 	MDRV_CPU_MEMORY(roishtar_mcu_readmem,roishtar_mcu_writemem)
1271 MACHINE_DRIVER_END
1272 
1273 
1274 static MACHINE_DRIVER_START( genpeitd )
1275 
1276 	/* basic machine hardware */
1277 	MDRV_IMPORT_FROM(hopmappy)
1278 	MDRV_CPU_MODIFY("cpu2")
1279 	MDRV_CPU_MEMORY(genpeitd_readmem2,genpeitd_writemem2)
1280 
1281 	MDRV_CPU_MODIFY("mcu")
1282 	MDRV_CPU_MEMORY(genpeitd_mcu_readmem,genpeitd_mcu_writemem)
1283 
1284 	/* video hardware */
1285 	MDRV_GFXDECODE(gfxdecodeinfo_1024)
1286 MACHINE_DRIVER_END
1287 
1288 
1289 static MACHINE_DRIVER_START( rthunder )
1290 
1291 	/* basic machine hardware */
1292 	MDRV_IMPORT_FROM(hopmappy)
1293 	MDRV_CPU_MODIFY("cpu2")
1294 	MDRV_CPU_MEMORY(rthunder_readmem2,rthunder_writemem2)
1295 
1296 	MDRV_CPU_MODIFY("mcu")
1297 	MDRV_CPU_MEMORY(rthunder_mcu_readmem,rthunder_mcu_writemem)
1298 
1299 	/* video hardware */
1300 	MDRV_GFXDECODE(gfxdecodeinfo_512)
1301 MACHINE_DRIVER_END
1302 
1303 
1304 static MACHINE_DRIVER_START( wndrmomo )
1305 
1306 	/* basic machine hardware */
1307 	MDRV_IMPORT_FROM(hopmappy)
1308 	MDRV_CPU_MODIFY("cpu2")
1309 	MDRV_CPU_MEMORY(wndrmomo_readmem2,wndrmomo_writemem2)
1310 
1311 	MDRV_CPU_MODIFY("mcu")
1312 	MDRV_CPU_MEMORY(wndrmomo_mcu_readmem,wndrmomo_mcu_writemem)
1313 
1314 	/* video hardware */
1315 	MDRV_GFXDECODE(gfxdecodeinfo_512)
1316 MACHINE_DRIVER_END
1317 
1318 
1319 
1320 /***************************************************************************
1321 
1322   Game driver(s)
1323 
1324 ***************************************************************************/
1325 
1326 ROM_START( hopmappy )
1327 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1328 	ROM_LOAD( "hm1",         0x08000, 0x8000, CRC(1a83914e) SHA1(6cb96b2518f4b867e20bd5d31ac6913d09c95f06) )
1329 	/* 9d empty */
1330 
1331 	/* the CPU1 ROM expansion board is not present in this game */
1332 
1333 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1334 	ROM_LOAD( "hm2",         0xc000, 0x4000, CRC(c46cda65) SHA1(1131b4aa0a446569e1eb9f59964548058c7993e2) )
1335 	/* 12d empty */
1336 
1337 	ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
1338 	ROM_LOAD( "hm6",         0x00000, 0x04000, CRC(fd0e8887) SHA1(b76737d22bb1c1ae4d700ea6796e8d91f6ffa275) )	/* plane 1,2 */
1339 	ROM_FILL(                0x04000, 0x02000, 0 )			/* no plane 3 */
1340 
1341 	ROM_REGION( 0x06000, REGION_GFX2, ROMREGION_DISPOSE )
1342 	ROM_LOAD( "hm5",         0x00000, 0x04000, CRC(9c4f31ae) SHA1(1c7072355d6f98b8e8554da19eab0512fdd9e2e1) )	/* plane 1,2 */
1343 	ROM_FILL(                0x04000, 0x02000, 0 )			/* no plane 3 */
1344 
1345 	ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE )
1346 	ROM_LOAD( "hm4",         0x00000, 0x8000, CRC(78719c52) SHA1(06d7bb9f29ccdbf563b3bf13c0290510b26e186f) )
1347 	/* 12k/l/m/p/r/t/u empty */
1348 
1349 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1350 	ROM_LOAD( "hm11.bpr",    0x0000, 0x0200, CRC(cc801088) SHA1(d2c39ac1694d9b8c426e253702ecd096e68c6db9) )	/* red & green components */
1351 	ROM_LOAD( "hm12.bpr",    0x0200, 0x0200, CRC(a1cb71c5) SHA1(d8c33c2e52d64ebf4a07d8a26453e7b872cae413) )	/* blue component */
1352 	ROM_LOAD( "hm13.bpr",    0x0400, 0x0800, CRC(e362d613) SHA1(16d87711c1ac4ac2b649a32a5627cbd62cc5031f) )	/* tiles colortable */
1353 	ROM_LOAD( "hm14.bpr",    0x0c00, 0x0800, CRC(678252b4) SHA1(9e2f7328532be3ac4b48bd5d52cd993108558452) )	/* sprites colortable */
1354 	ROM_LOAD( "hm15.bpr",    0x1400, 0x0020, CRC(475bf500) SHA1(7e6a91e57d3709a5c70786c8e3ed545ee6026d03) )	/* tile address decoder (used at runtime) */
1355 
1356 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1357 	ROM_LOAD( "hm3",         0x08000, 0x2000, CRC(6496e1db) SHA1(f990fb3b2f93295282e8dee4488a4c3fc5ef83d1) )
1358 	ROM_LOAD( "pl1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1359 
1360 	/* the PCM expansion board is not present in this game */
1361 ROM_END
1362 
1363 ROM_START( skykiddx )
1364 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1365 	ROM_LOAD( "sk3_1b.9c", 0x08000, 0x8000, CRC(767b3514) SHA1(7b85e520e56924235d1f4987333f183c914fafc1) )
1366 	ROM_LOAD( "sk3_2.9d",  0x10000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
1367 
1368 	/* the CPU1 ROM expansion board is not present in this game */
1369 
1370 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1371 	ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
1372 	/* 12d empty */
1373 
1374 	ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1375 	ROM_LOAD( "sk3_9.7r",  0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) )	/* plane 1,2 */
1376 	ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) )	/* plane 3 */
1377 
1378 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1379 	ROM_LOAD( "sk3_7.4r",  0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) )	/* plane 1,2 */
1380 	ROM_LOAD( "sk3_8.4s",  0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) )	/* plane 3 */
1381 
1382 	ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE )
1383 	ROM_LOAD( "sk3_5.12h",  0x00000, 0x8000, CRC(5c7d4399) SHA1(9c57e2510b1a01f618364ddaa9b9fa0ce9ae7340) )
1384 	ROM_LOAD( "sk3_6.12k",  0x08000, 0x8000, CRC(c908a3b2) SHA1(5fd5304c314443fb3351e7a2d50a72a0fede7e6d) )
1385 	/* 12l/m/p/r/t/u empty */
1386 
1387 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1388 	ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) )	/* red & green components */
1389 	ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) )	/* blue component */
1390 	ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) )	/* tiles colortable */
1391 	ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) )	/* sprites colortable */
1392 	ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1393 
1394 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1395 	ROM_LOAD( "sk3_4.6b",    0x08000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) )
1396 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1397 
1398 	/* the PCM expansion board is not present in this game */
1399 ROM_END
1400 
1401 ROM_START( skykiddo )
1402 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1403 	ROM_LOAD( "sk3-1.9c",  0x08000, 0x8000, CRC(5722a291) SHA1(0b3ca2585bf5c18214c1337dce8f92027e9d78c2) )
1404 	ROM_LOAD( "sk3_2.9d",  0x10000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
1405 
1406 	/* the CPU1 ROM expansion board is not present in this game */
1407 
1408 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1409 	ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
1410 	/* 12d empty */
1411 
1412 	ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1413 	ROM_LOAD( "sk3_9.7r",  0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) )	/* plane 1,2 */
1414 	ROM_LOAD( "sk3_10.7s", 0x08000, 0x04000, CRC(7418465a) SHA1(e8236c3d077af147a7d5f8f9cd519d030c073aaf) )	/* plane 3 */
1415 
1416 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1417 	ROM_LOAD( "sk3_7.4r",  0x00000, 0x08000, CRC(4036b735) SHA1(4177f3f37feb83fab63a1160a939c8d566bbe16c) )	/* plane 1,2 */
1418 	ROM_LOAD( "sk3_8.4s",  0x08000, 0x04000, CRC(044bfd21) SHA1(4fbb72fbf041cb256377952d860147376fc1d05b) )	/* plane 3 */
1419 
1420 	ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE )
1421 	ROM_LOAD( "sk3_5.12h",  0x00000, 0x8000, CRC(5c7d4399) SHA1(9c57e2510b1a01f618364ddaa9b9fa0ce9ae7340) )
1422 	ROM_LOAD( "sk3_6.12k",  0x08000, 0x8000, CRC(c908a3b2) SHA1(5fd5304c314443fb3351e7a2d50a72a0fede7e6d) )
1423 	/* 12l/m/p/r/t/u empty */
1424 
1425 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1426 	ROM_LOAD( "sk3-1.3r", 0x0000, 0x0200, CRC(9e81dedd) SHA1(9d2ddf51788d22ed65db9070684e586b2f64f99e) )	/* red & green components */
1427 	ROM_LOAD( "sk3-2.3s", 0x0200, 0x0200, CRC(cbfec4dd) SHA1(98adf5db270a853ab2a2e1cdd9edfd5657287a96) )	/* blue component */
1428 	ROM_LOAD( "sk3-3.4v", 0x0400, 0x0800, CRC(81714109) SHA1(577e513369a4368b7dd29dff80904eb0ac2004ff) )	/* tiles colortable */
1429 	ROM_LOAD( "sk3-4.5v", 0x0c00, 0x0800, CRC(1bf25acc) SHA1(a8db254ba4cbb85efc232a5bf9b268534455ad4a) )	/* sprites colortable */
1430 	ROM_LOAD( "sk3-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1431 
1432 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1433 	ROM_LOAD( "sk3_4.6b",    0x08000, 0x4000, CRC(e6cae2d6) SHA1(b6598aaee0136b0980e13326cb2835aadadd9543) )
1434 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1435 
1436 	/* the PCM expansion board is not present in this game */
1437 ROM_END
1438 
1439 ROM_START( roishtar )
1440 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1441 	ROM_LOAD( "ri1-1c.9c", 0x08000, 0x8000, CRC(14acbacb) SHA1(3c6130f9e5a4ba84be0cc3547c1086707ee3b8e9) )
1442 	ROM_LOAD( "ri1-2.9d",  0x14000, 0x2000, CRC(fcd58d91) SHA1(e7b6d7afd7cf6c374ee90d6499ea0f205e742b21) )
1443 
1444 	/* the CPU1 ROM expansion board is not present in this game */
1445 
1446 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1447 	ROM_LOAD( "ri1-3.12c", 0x8000, 0x8000, CRC(a39829f7) SHA1(e08114d5154367a3cc36f1485253f18044a1888d) )
1448 	/* 12d empty */
1449 
1450 	ROM_REGION( 0x06000, REGION_GFX1, ROMREGION_DISPOSE )
1451 	ROM_LOAD( "ri1-14.7r", 0x00000, 0x04000, CRC(de8154b4) SHA1(70a65e4656cf9fcf5c54e84c628ec95393e856fb) )	/* plane 1,2 */
1452 	ROM_LOAD( "ri1-15.7s", 0x04000, 0x02000, CRC(4298822b) SHA1(5aad41fd719c2f310ae485caaacda129c9f2ac94) )	/* plane 3 */
1453 
1454 	ROM_REGION( 0x06000, REGION_GFX2, ROMREGION_DISPOSE )
1455 	ROM_LOAD( "ri1-12.4r", 0x00000, 0x04000, CRC(557e54d3) SHA1(d22969deefcb3c3443d08a215f1ec2e874650b19) )	/* plane 1,2 */
1456 	ROM_LOAD( "ri1-13.4s", 0x04000, 0x02000, CRC(9ebe8e32) SHA1(5990a86bfbf2669e512e8ca875c69b4c60c4d108) )	/* plane 3 */
1457 
1458 	ROM_REGION( 0x40000, REGION_GFX3, ROMREGION_DISPOSE )
1459 	ROM_LOAD( "ri1-5.12h",  0x00000, 0x8000, CRC(46b59239) SHA1(bb08e57cd5864f41e27a07dcf449896570d2203d) )
1460 	ROM_LOAD( "ri1-6.12k",  0x08000, 0x8000, CRC(94d9ef48) SHA1(a13b345b8fe30dea8e85698782674859c385e79a) )
1461 	ROM_LOAD( "ri1-7.12l",  0x10000, 0x8000, CRC(da802b59) SHA1(b6551db5cd9c3d674cdf1dc59f581ee435a7eeb7) )
1462 	ROM_LOAD( "ri1-8.12m",  0x18000, 0x8000, CRC(16b88b74) SHA1(9ef3ebf686a539e911bb7a3a4c02d0e2dca616d0) )
1463 	ROM_LOAD( "ri1-9.12p",  0x20000, 0x8000, CRC(f3de3c2a) SHA1(02705bfd37f8996c5fc9c5bf2a99e859083a75e6) )
1464 	ROM_LOAD( "ri1-10.12r", 0x28000, 0x8000, CRC(6dacc70d) SHA1(c7db40a0e90c9717f8a2f1507daff997856a3b91) )
1465 	ROM_LOAD( "ri1-11.12t", 0x30000, 0x8000, CRC(fb6bc533) SHA1(a840af58d6db66518520bc7d88867a09a2e502c2) )
1466 	/* 12u empty */
1467 
1468 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1469 	ROM_LOAD( "ri1-1.3r", 0x0000, 0x0200, CRC(29cd0400) SHA1(a9b0d09492710e72e34155cd6a7b7c1a34c56b20) )	/* red & green components */
1470 	ROM_LOAD( "ri1-2.3s", 0x0200, 0x0200, CRC(02fd278d) SHA1(db104fc7acf2739def902180981eb7ba10ec3dda) )	/* blue component */
1471 	ROM_LOAD( "ri1-3.4v", 0x0400, 0x0800, CRC(cbd7e53f) SHA1(77ef70be4e8a21948d697649352a5e3527086cf2) )	/* tiles colortable */
1472 	ROM_LOAD( "ri1-4.5v", 0x0c00, 0x0800, CRC(22921617) SHA1(7304cb5a86f524f912feb8b58801393cce5d3b09) )	/* sprites colortable */
1473 	ROM_LOAD( "ri1-5.6u", 0x1400, 0x0020, CRC(e2188075) SHA1(be079ace2070433d4d90c757aef3e415b4e21455) )	/* tile address decoder (used at runtime) */
1474 
1475 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1476 	ROM_LOAD( "ri1-4.6b",    0x00000, 0x4000, CRC(552172b8) SHA1(18b35cb116baba362831fc046241895198b07a53) )
1477 	ROM_CONTINUE(            0x08000, 0x4000 )
1478 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1479 
1480 	/* the PCM expansion board is not present in this game */
1481 ROM_END
1482 
1483 ROM_START( genpeitd )
1484 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1485 	ROM_LOAD( "gt1-1b.9c", 0x08000, 0x8000, CRC(75396194) SHA1(2a526064fb91b2796c913f3050867352ac63e643) )
1486 	/* 9d empty */
1487 
1488 	ROM_REGION( 0x40000, REGION_USER1, 0 ) /* bank switched data for CPU1 */
1489 	ROM_LOAD( "gt1-10b.f1",  0x00000, 0x10000, CRC(5721ad0d) SHA1(f16afb3f468957a9de270366605592e14837b8c2) )
1490 	/* h1 empty */
1491 	/* k1 empty */
1492 	/* m1 empty */
1493 
1494 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1495 	ROM_LOAD( "gt1-2.12c", 0xc000, 0x4000, CRC(302f2cb6) SHA1(19c39afb7d49d80aeaaf67a837cd02bfd3d64fbd) )
1496 	/* 12d empty */
1497 
1498 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1499 	ROM_LOAD( "gt1-7.7r", 0x00000, 0x10000, CRC(ea77a211) SHA1(32b8ae11723b6223b42225805acd0dcab65516a5) )	/* plane 1,2 */
1500 	ROM_LOAD( "gt1-6.7s", 0x10000, 0x08000, CRC(1b128a2e) SHA1(6d7b95326919420538b509a119c26e9109e5539e) )	/* plane 3 */
1501 
1502 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1503 	ROM_LOAD( "gt1-5.4r", 0x00000, 0x08000, CRC(44d58b06) SHA1(9663f026092484a4041e486bad23e8e58a4dbf95) )	/* plane 1,2 */
1504 	ROM_LOAD( "gt1-4.4s", 0x08000, 0x04000, CRC(db8d45b0) SHA1(fd4ebdf442e8b9ccc026079c29a975b1fa6e8dd6) )	/* plane 3 */
1505 
1506 	ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )
1507 	ROM_LOAD( "gt1-11.12h",  0x00000, 0x20000, CRC(3181a5fe) SHA1(a98b8609afe3a41ed7b1432b3c2850e8de2c428b) )
1508 	ROM_LOAD( "gt1-12.12k",  0x20000, 0x20000, CRC(76b729ab) SHA1(d75aeca1ddbb690ff7442dee3b1d44331d220758) )
1509 	ROM_LOAD( "gt1-13.12l",  0x40000, 0x20000, CRC(e332a36e) SHA1(fa06da1e4f7ef3adf8e87d8d4d95aa7e0eb2d7b2) )
1510 	ROM_LOAD( "gt1-14.12m",  0x60000, 0x20000, CRC(e5ffaef5) SHA1(0db1fd0b7553f69a480fcf2d312c6a8cd99ed777) )
1511 	ROM_LOAD( "gt1-15.12p",  0x80000, 0x20000, CRC(198b6878) SHA1(3f42a80199192412171445dd4fe5c4a3a19a5672) )
1512 	ROM_LOAD( "gt1-16.12r",  0xa0000, 0x20000, CRC(801e29c7) SHA1(4f1dd17f04f56153cd090887e841e3baa1287755) )
1513 	ROM_LOAD( "gt1-8.12t",   0xc0000, 0x10000, CRC(ad7bc770) SHA1(babce324189b9380e1a71b63499362e276c99ea8) )
1514 	ROM_LOAD( "gt1-9.12u",   0xe0000, 0x10000, CRC(d95a5fd7) SHA1(819ac376ac0eb6ffa69153d579a9c11ae5feb6a4) )
1515 
1516 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1517 	ROM_LOAD( "gt1-1.3r", 0x0000, 0x0200, CRC(2f0ddddb) SHA1(27fa45c0baf9a48002db11be9b3c0472ecfd986c) )	/* red & green components */
1518 	ROM_LOAD( "gt1-2.3s", 0x0200, 0x0200, CRC(87d27025) SHA1(a50f969d48a99c6d29141458fb3e34b23cf5e67c) )	/* blue component */
1519 	ROM_LOAD( "gt1-3.4v", 0x0400, 0x0800, CRC(c178de99) SHA1(67289ef9e5068636023316560f9f1690a8384bfb) )	/* tiles colortable */
1520 	ROM_LOAD( "gt1-4.5v", 0x0c00, 0x0800, CRC(9f48ef17) SHA1(78c813dd57326f3f5ab785005ef89ba96303adeb) )	/* sprites colortable */
1521 	ROM_LOAD( "gt1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1522 
1523 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1524 	ROM_LOAD( "gt1-3.6b",    0x04000, 0x8000, CRC(315cd988) SHA1(87b1a90b2a53571f7d8f9a475125f3f31ed3cb5d) )
1525 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1526 
1527 	ROM_REGION( 0x80000, REGION_SOUND1, 0 ) /* PCM samples for Hitachi CPU */
1528 	ROM_LOAD( "gt1-17.f3",  0x00000, 0x20000, CRC(26181ff8) SHA1(c97a0e6282b2af88d960c71e3af5283608493d31) )
1529 	ROM_LOAD( "gt1-18.h3",  0x20000, 0x20000, CRC(7ef9e5ea) SHA1(0464d43b39903ce373d70854bbcd5da05896ecae) )
1530 	ROM_LOAD( "gt1-19.k3",  0x40000, 0x20000, CRC(38e11f6c) SHA1(52dea9d444d5a0421db4a8bf5c79a9d901b6f005) )
1531 	/* m3 empty */
1532 ROM_END
1533 
1534 ROM_START( rthunder )
1535 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1536 	ROM_LOAD( "rt3-1b.9c",  0x8000, 0x8000, CRC(7d252a1b) SHA1(cb92709e94eb273b3ce44c55cd252170ad1017f4) )
1537 	/* 9d empty */
1538 
1539 	ROM_REGION( 0x40000, REGION_USER1, 0 ) /* bank switched data for CPU1 */
1540 	ROM_LOAD( "rt1-17.f1",  0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) )
1541 	ROM_LOAD( "rt1-18.h1",  0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) )
1542 	ROM_LOAD( "rt1-19.k1",  0x20000, 0x10000, CRC(c16675e9) SHA1(e31c28cb95ffa85392c74e1d81bfa89acbaefeb9) )
1543 	ROM_LOAD( "rt1-20.m1",  0x30000, 0x10000, CRC(c470681b) SHA1(87f8d8509c3e8207f34c6001aaf4d0afdad82d0d) )
1544 
1545 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1546 	ROM_LOAD( "rt3-2b.12c", 0x08000, 0x8000, CRC(a7ea46ee) SHA1(52e8757aacb4e01f8432125729e2323c48ebc4f5) )
1547 	ROM_LOAD( "rt3-3.12d",  0x10000, 0x8000, CRC(a13f601c) SHA1(8987174e364d20eeab706c3e0d4e0d3c2b96723c) )
1548 
1549 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1550 	ROM_LOAD( "rt1-7.7r",  0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) )	/* plane 1,2 */
1551 	ROM_LOAD( "rt1-8.7s",  0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) )	/* plane 3 */
1552 
1553 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1554 	ROM_LOAD( "rt1-5.4r",  0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) )	/* plane 1,2 */
1555 	ROM_LOAD( "rt1-6.4s",  0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) )	/* plane 3 */
1556 
1557 	ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE )
1558 	ROM_LOAD( "rt1-9.12h",  0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) )
1559 	ROM_LOAD( "rt1-10.12k", 0x10000, 0x10000, CRC(cb8fb607) SHA1(ba9400fb19d29a285897cc3a2d4d739ce845f897) )
1560 	ROM_LOAD( "rt1-11.12l", 0x20000, 0x10000, CRC(2bdf5ed9) SHA1(a771e922ad868ca1e008d08a8ff5fdf28aa315fc) )
1561 	ROM_LOAD( "rt1-12.12m", 0x30000, 0x10000, CRC(e6c6c7dc) SHA1(ead143c2730a77911839a25734550188533c7b96) )
1562 	ROM_LOAD( "rt1-13.12p", 0x40000, 0x10000, CRC(489686d7) SHA1(a04b57424acbf2584f736b55740d613a1aae2b8b) )
1563 	ROM_LOAD( "rt1-14.12r", 0x50000, 0x10000, CRC(689e56a8) SHA1(b4d6de4eec47856a62f396f55d531fbf345cf12a) )
1564 	ROM_LOAD( "rt1-15.12t", 0x60000, 0x10000, CRC(1d8bf2ca) SHA1(949ae8b00b94bfa5bc2d07888aafbaaaea559b06) )
1565 	ROM_LOAD( "rt1-16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) )
1566 
1567 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1568 	ROM_LOAD( "mb7124e.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) )	/* red & green components */
1569 	ROM_LOAD( "mb7116e.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) )	/* blue component */
1570 	ROM_LOAD( "mb7138h.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) )	/* tiles colortable */
1571 	ROM_LOAD( "mb7138h.6v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) )	/* sprites colortable */
1572 	ROM_LOAD( "mb7112e.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1573 
1574 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1575 	ROM_LOAD( "rt1-4.6b",    0x04000, 0x8000, CRC(00cf293f) SHA1(bc441d21bb4c54a01d2393fbe99201714cd4439d) )
1576 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1577 
1578 	ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* PCM samples for Hitachi CPU */
1579 	ROM_LOAD( "rt1-21.f3",  0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) )
1580 	ROM_LOAD( "rt1-22.h3",  0x10000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) )
1581 	/* k3 empty */
1582 	/* m3 empty */
1583 ROM_END
1584 
1585 ROM_START( rthundro )
1586 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1587 	ROM_LOAD( "r1",         0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) )
1588 	/* 9d empty */
1589 
1590 	ROM_REGION( 0x40000, REGION_USER1, 0 ) /* bank switched data for CPU1 */
1591 	ROM_LOAD( "rt1-17.f1",  0x00000, 0x10000, CRC(766af455) SHA1(8c71772795e783d6c4b88af9a311d55e363c298a) )
1592 	ROM_LOAD( "rt1-18.h1",  0x10000, 0x10000, CRC(3f9f2f5d) SHA1(541b8f80800cb55e4b81ac48771d00fe10c90743) )
1593 	ROM_LOAD( "r19",        0x20000, 0x10000, CRC(fe9343b0) SHA1(ae8e5ee11eaf7dc1e8f814b0a0beef97731f042b) )
1594 	ROM_LOAD( "r20",        0x30000, 0x10000, CRC(f8518d4f) SHA1(3a8551d46ffdf82844b2eb1b2c01cf2d8423a49e) )
1595 
1596 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1597 	ROM_LOAD( "r2",        0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) )
1598 	ROM_LOAD( "r3",        0x10000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) )
1599 
1600 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
1601 	ROM_LOAD( "rt1-7.7r",  0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) )	/* plane 1,2 */
1602 	ROM_LOAD( "rt1-8.7s",  0x10000, 0x08000, CRC(f7a95820) SHA1(82fe0adf6c5b3abef19031646e1eca1585dcc481) )	/* plane 3 */
1603 
1604 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1605 	ROM_LOAD( "rt1-5.4r",  0x00000, 0x08000, CRC(d0fc470b) SHA1(70f7f1e29527044eae405f58af08bad3097990bd) )	/* plane 1,2 */
1606 	ROM_LOAD( "rt1-6.4s",  0x08000, 0x04000, CRC(6b57edb2) SHA1(4a8f1e024e5be4d76f2c99d506ae7da86af3d1f5) )	/* plane 3 */
1607 
1608 	ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE )
1609 	ROM_LOAD( "rt1-9.12h",  0x00000, 0x10000, CRC(8e070561) SHA1(483b4de79f2429236f45c32ec56b97a9a90574a3) )
1610 	ROM_LOAD( "rt1-10.12k", 0x10000, 0x10000, CRC(cb8fb607) SHA1(ba9400fb19d29a285897cc3a2d4d739ce845f897) )
1611 	ROM_LOAD( "rt1-11.12l", 0x20000, 0x10000, CRC(2bdf5ed9) SHA1(a771e922ad868ca1e008d08a8ff5fdf28aa315fc) )
1612 	ROM_LOAD( "rt1-12.12m", 0x30000, 0x10000, CRC(e6c6c7dc) SHA1(ead143c2730a77911839a25734550188533c7b96) )
1613 	ROM_LOAD( "rt1-13.12p", 0x40000, 0x10000, CRC(489686d7) SHA1(a04b57424acbf2584f736b55740d613a1aae2b8b) )
1614 	ROM_LOAD( "rt1-14.12r", 0x50000, 0x10000, CRC(689e56a8) SHA1(b4d6de4eec47856a62f396f55d531fbf345cf12a) )
1615 	ROM_LOAD( "rt1-15.12t", 0x60000, 0x10000, CRC(1d8bf2ca) SHA1(949ae8b00b94bfa5bc2d07888aafbaaaea559b06) )
1616 	ROM_LOAD( "rt1-16.12u", 0x70000, 0x10000, CRC(1bbcf37b) SHA1(8d27c49b36d5e23dd446c150ada3853eec75e4c1) )
1617 
1618 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1619 	ROM_LOAD( "mb7124e.3r", 0x0000, 0x0200, CRC(8ef3bb9d) SHA1(4636d6b8ba7611b11d4863fab02475dc4a619eaf) )	/* red & green components */
1620 	ROM_LOAD( "mb7116e.3s", 0x0200, 0x0200, CRC(6510a8f2) SHA1(935f140bfa7e6f8cebafa7f1b0de99dd319273d4) )	/* blue component */
1621 	ROM_LOAD( "mb7138h.4v", 0x0400, 0x0800, CRC(95c7d944) SHA1(ca5fea028674882a61507ac7c89ada96f5b2674d) )	/* tiles colortable */
1622 	ROM_LOAD( "mb7138h.6v", 0x0c00, 0x0800, CRC(1391fec9) SHA1(8ca94e22110b20d2ecdf03610bcc89ff4245920f) )	/* sprites colortable */
1623 	ROM_LOAD( "mb7112e.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1624 
1625 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1626 	ROM_LOAD( "r4",          0x04000, 0x8000, CRC(0387464f) SHA1(ce7f521bc2ecc6525880da2551daf595a394a275) )
1627 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1628 
1629 	ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* PCM samples for Hitachi CPU */
1630 	ROM_LOAD( "rt1-21.f3",  0x00000, 0x10000, CRC(454968f3) SHA1(e0a679353491190b6d4f0355324456a1bd7c8a7a) )
1631 	ROM_LOAD( "rt1-22.h3",  0x10000, 0x10000, CRC(fe963e72) SHA1(4c9ce4e4c8e756a743c541f670a6741b520125e3) )
1632 	/* k3 empty */
1633 	/* m3 empty */
1634 ROM_END
1635 
1636 ROM_START( wndrmomo )
1637 	ROM_REGION( 0x18000, REGION_CPU1, 0 )
1638 	ROM_LOAD( "wm1-1.9c", 0x8000, 0x8000, CRC(34b50bf0) SHA1(112c8c8a0a16382008cacd2e484f91fa9338d10a) )
1639 	/* 9d empty */
1640 
1641 	ROM_REGION( 0x40000, REGION_USER1, 0 ) /* bank switched data for CPU1 */
1642 	ROM_LOAD( "wm1-16.f1", 0x00000, 0x10000, CRC(e565f8f3) SHA1(e1f417003ef9f700f9d5ed091484463c704c8b9f) )
1643 	/* h1 empty */
1644 	/* k1 empty */
1645 	/* m1 empty */
1646 
1647 	ROM_REGION( 0x18000, REGION_CPU2, 0 )
1648 	ROM_LOAD( "wm1-2.12c", 0x8000, 0x8000, CRC(3181efd0) SHA1(01a2e0e4c8ced6f48b6e70393a3c4152b079e9b0) )
1649 	/* 12d empty */
1650 
1651 	ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
1652 	ROM_LOAD( "wm1-6.7r", 0x00000, 0x08000, CRC(93955fbb) SHA1(cffd457886c40bf709b573237165ae8fa9784e32) )	/* plane 1,2 */
1653 	ROM_LOAD( "wm1-7.7s", 0x08000, 0x04000, CRC(7d662527) SHA1(09d1dc46a402c67dddcdd4cc90f32948c7a28795) )	/* plane 3 */
1654 
1655 	ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
1656 	ROM_LOAD( "wm1-4.4r", 0x00000, 0x08000, CRC(bbe67836) SHA1(bc998c2ddc2664db614e7c487f77073a5be69e89) )	/* plane 1,2 */
1657 	ROM_LOAD( "wm1-5.4s", 0x08000, 0x04000, CRC(a81b481f) SHA1(b5a029e432b29e157505b975ea57cd4b5da361a7) )	/* plane 3 */
1658 
1659 	ROM_REGION( 0x80000, REGION_GFX3, ROMREGION_DISPOSE )
1660 	ROM_LOAD( "wm1-8.12h",  0x00000, 0x10000, CRC(14f52e72) SHA1(0f8f58cd13e3393a113817593816f53a218f3ce4) )
1661 	ROM_LOAD( "wm1-9.12k",  0x10000, 0x10000, CRC(16f8cdae) SHA1(8281b4c66157580f34aec7c035d06f721f77b3d5) )
1662 	ROM_LOAD( "wm1-10.12l", 0x20000, 0x10000, CRC(bfbc1896) SHA1(0308cf907c77417ad3f84326b074567a00245998) )
1663 	ROM_LOAD( "wm1-11.12m", 0x30000, 0x10000, CRC(d775ddb2) SHA1(8f1a6efbdaeec9049624be56078e843b3094a277) )
1664 	ROM_LOAD( "wm1-12.12p", 0x40000, 0x10000, CRC(de64c12f) SHA1(c867e03d6b249ce0c9b3554797ccebaeb2778f73) )
1665 	ROM_LOAD( "wm1-13.12r", 0x50000, 0x10000, CRC(cfe589ad) SHA1(3289cd1571fefe5266ca1e8bd75069d386919ae5) )
1666 	ROM_LOAD( "wm1-14.12t", 0x60000, 0x10000, CRC(2ae21a53) SHA1(ef3e5e4fa8580f7891d9e1825d2eda4c387db732) )
1667 	ROM_LOAD( "wm1-15.12u", 0x70000, 0x10000, CRC(b5c98be0) SHA1(bdd6e0e02632866eea60a6bdeff3af8b6cd08d68) )
1668 
1669 	ROM_REGION( 0x1420, REGION_PROMS, 0 )
1670 	ROM_LOAD( "wm1-1.3r", 0x0000, 0x0200, CRC(1af8ade8) SHA1(1aa0d314c34abc4154092d4b588214afb0b21e22) )	/* red & green components */
1671 	ROM_LOAD( "wm1-2.3s", 0x0200, 0x0200, CRC(8694e213) SHA1(f00d692e587c3706e71b6eeef21e1ea87c9dd921) )	/* blue component */
1672 	ROM_LOAD( "wm1-3.4v", 0x0400, 0x0800, CRC(2ffaf9a4) SHA1(2002df3cc38e05f3e127d05c244cb101d1f1d85f) )	/* tiles colortable */
1673 	ROM_LOAD( "wm1-4.5v", 0x0c00, 0x0800, CRC(f4e83e0b) SHA1(b000d884c6e0373b0403bc9d63eb0452c1197491) )	/* sprites colortable */
1674 	ROM_LOAD( "wm1-5.6u", 0x1400, 0x0020, CRC(e4130804) SHA1(e1a3e1383186d036fba6dc8a8681f48f24f59281) )	/* tile address decoder (used at runtime) */
1675 
1676 	ROM_REGION( 0x10000, REGION_CPU3, 0 )
1677 	ROM_LOAD( "wm1-3.6b",    0x04000, 0x8000, CRC(55f01df7) SHA1(c11574a8b51bf965790b97895452e9fa9ab6b752) )
1678 	ROM_LOAD( "rt1-mcu.bin", 0x0f000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )
1679 
1680 	ROM_REGION( 0x40000, REGION_SOUND1, 0 ) /* PCM samples for Hitachi CPU */
1681 	ROM_LOAD( "wm1-17.f3", 0x00000, 0x10000, CRC(bea3c318) SHA1(50b6e4c546ce056d68fbb2e52cb88397daa615aa) )
1682 	ROM_LOAD( "wm1-18.h3", 0x10000, 0x10000, CRC(6d73bcc5) SHA1(fccd83bb3a872b4cd8bd9f11f5cdf5926cb9b74e) )
1683 	ROM_LOAD( "wm1-19.k3", 0x20000, 0x10000, CRC(d288e912) SHA1(d0db58d7ed3d8cf895e031901f91f810f0e18709) )
1684 	ROM_LOAD( "wm1-20.m3", 0x30000, 0x10000, CRC(076a72cb) SHA1(0d0d74a6b11b07a2d768567e7bc06cf08bbcd68f) )
1685 ROM_END
1686 
1687 
1688 
1689 static DRIVER_INIT( namco86 )
1690 {
1691 	int size;
1692 	unsigned char *gfx;
1693 	unsigned char *buffer;
1694 
1695 	/* shuffle tile ROMs so regular gfx unpack routines can be used */
1696 	gfx = memory_region(REGION_GFX1);
1697 	size = memory_region_length(REGION_GFX1) * 2 / 3;
1698 	buffer = malloc( size );
1699 
1700 	if ( buffer )
1701 	{
1702 		unsigned char *dest1 = gfx;
1703 		unsigned char *dest2 = gfx + ( size / 2 );
1704 		unsigned char *mono = gfx + size;
1705 		int i;
1706 
1707 		memcpy( buffer, gfx, size );
1708 
1709 		for ( i = 0; i < size; i += 2 )
1710 		{
1711 			unsigned char data1 = buffer[i];
1712 			unsigned char data2 = buffer[i+1];
1713 			*dest1++ = ( data1 << 4 ) | ( data2 & 0xf );
1714 			*dest2++ = ( data1 & 0xf0 ) | ( data2 >> 4 );
1715 
1716 			*mono ^= 0xff; mono++;
1717 		}
1718 
1719 		free( buffer );
1720 	}
1721 
1722 	gfx = memory_region(REGION_GFX2);
1723 	size = memory_region_length(REGION_GFX2) * 2 / 3;
1724 	buffer = malloc( size );
1725 
1726 	if ( buffer )
1727 	{
1728 		unsigned char *dest1 = gfx;
1729 		unsigned char *dest2 = gfx + ( size / 2 );
1730 		unsigned char *mono = gfx + size;
1731 		int i;
1732 
1733 		memcpy( buffer, gfx, size );
1734 
1735 		for ( i = 0; i < size; i += 2 )
1736 		{
1737 			unsigned char data1 = buffer[i];
1738 			unsigned char data2 = buffer[i+1];
1739 			*dest1++ = ( data1 << 4 ) | ( data2 & 0xf );
1740 			*dest2++ = ( data1 & 0xf0 ) | ( data2 >> 4 );
1741 
1742 			*mono ^= 0xff; mono++;
1743 		}
1744 
1745 		free( buffer );
1746 	}
1747 }
1748 
1749 
1750 
WRITE_HANDLER(roishtar_semaphore_w)1751 WRITE_HANDLER( roishtar_semaphore_w )
1752 {
1753     rthunder_videoram1_w(0x7e24-0x6000+offset,data);
1754 
1755     if (data == 0x02)
1756 	    cpu_spinuntil_int();
1757 }
1758 
DRIVER_INIT(roishtar)1759 static DRIVER_INIT( roishtar )
1760 {
1761 	/* install hook to avoid hang at game over */
1762     install_mem_write_handler(1, 0x7e24, 0x7e24, roishtar_semaphore_w);
1763 
1764 	init_namco86();
1765 }
1766 
1767 
1768 
1769 GAME( 1986, hopmappy, 0,        hopmappy, hopmappy, namco86,  ROT0,   "Namco", "Hopping Mappy" )
1770 GAME( 1986, skykiddx, 0,        skykiddx, skykiddx, namco86,  ROT180, "Namco", "Sky Kid Deluxe (set 1)" )
1771 GAME( 1986, skykiddo, skykiddx, skykiddx, skykiddx, namco86,  ROT180, "Namco", "Sky Kid Deluxe (set 2)" )
1772 GAME( 1986, roishtar, 0,        roishtar, roishtar, roishtar, ROT0,   "Namco", "The Return of Ishtar" )
1773 GAME( 1986, genpeitd, 0,        genpeitd, genpeitd, namco86,  ROT0,   "Namco", "Genpei ToumaDen" )
1774 GAME( 1986, rthunder, 0,        rthunder, rthunder, namco86,  ROT0,   "Namco", "Rolling Thunder (new version)" )
1775 GAME( 1986, rthundro, rthunder, rthunder, rthundro, namco86,  ROT0,   "Namco", "Rolling Thunder (old version)" )
1776 GAME( 1987, wndrmomo, 0,        wndrmomo, wndrmomo, namco86,  ROT0,   "Namco", "Wonder Momo" )
1777