1 #include "../vidhrdw/cosmic.c"
2 
3 /***************************************************************************
4 
5 Universal board numbers (found on the schematics)
6 
7 Cosmic Guerilla - 7907A
8 Cosmic Alien    - 7910
9 Magical Spot II - 8013
10 Devil Zone      - 8022
11 
12 
13 Space Panic memory map
14 
15 driver by Mike Coates
16 
17 0000-3FFF ROM
18 4000-5BFF Video RAM (Bitmap)
19 5C00-5FFF RAM
20 6000-601F Sprite Controller
21           4 bytes per sprite
22 
23           byte 1 - 80 = ?
24                    40 = Rotate sprite left/right
25                    3F = Sprite Number (Conversion to my layout via table)
26 
27           byte 2 - X co-ordinate
28           byte 3 - Y co-ordinate
29 
30           byte 4 - 08 = Switch sprite bank
31                    07 = Colour
32 
33 6800      IN1 - Player controls. See input port setup for mappings
34 6801      IN2 - Player 2 controls for cocktail mode. See input port setup for mappings.
35 6802      DSW - Dip switches
36 6803      IN0 - Coinage and player start
37 700C-700E Colour Map Selector
38 
39 (Not Implemented)
40 
41 7000-700B Various triggers, Sound etc
42 700F      Ditto
43 7800      80 = Flash Screen?
44 
45 ***************************************************************************/
46 
47 /***************************************************************************
48 
49 Magical Spot 2 memory map (preliminary)
50 
51 0000-2fff ROM
52 6000-63ff RAM
53 6400-7fff Video RAM
54 
55 read:
56 
57 write:
58 
59 ***************************************************************************/
60 
61 /*************************************************************************/
62 /* Cosmic Guerilla memory map	                                         */
63 /*************************************************************************/
64 /* 0000-03FF   ROM                          COSMICG.1                    */
65 /* 0400-07FF   ROM                          COSMICG.2                    */
66 /* 0800-0BFF   ROM                          COSMICG.3                    */
67 /* 0C00-0FFF   ROM                          COSMICG.4                    */
68 /* 1000-13FF   ROM                          COSMICG.5                    */
69 /* 1400-17FF   ROM                          COSMICG.6                    */
70 /* 1800-1BFF   ROM                          COSMICG.7                    */
71 /* 1C00-1FFF   ROM                          COSMICG.8 - Graphics         */
72 /*                                                                       */
73 /* 2000-23FF   RAM                                                       */
74 /* 2400-3FEF   Screen RAM                                                */
75 /* 3FF0-3FFF   CRT Controller registers (3FF0, register, 3FF4 Data)      */
76 /*                                                                       */
77 /* CRTC data                                                             */
78 /*             ROM                          COSMICG.9 - Color Prom       */
79 /*                                                                       */
80 /* CR Bits (Inputs)                                                      */
81 /* 0000-0003   A9-A13 from CRTC Pixel Clock                              */
82 /* 0004-000B   Controls                                                  */
83 /* 000C-000F   Dip Switches                                              */
84 /*                                                                       */
85 /* CR Bits (Outputs)                                                     */
86 /* 0016-0017   Colourmap Selector                                        */
87 /*************************************************************************/
88 
89 /* R Nabet : One weird thing is that the memory map allows the use of a cheaper tms9980.
90 Did the original hardware really use the high-end tms9900 ? */
91 /* Set the flag below to compile with a tms9980. */
92 
93 #define COSMICG_USES_TMS9980 1
94 
95 #include "driver.h"
96 #include "vidhrdw/generic.h"
97 #include "cpu/z80/z80.h"
98 
99 
100 void panic_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
101 void cosmica_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
102 void cosmicg_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
103 void magspot2_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
104 void panic_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
105 void magspot2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
106 void cosmica_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
107 void cosmicg_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
108 void nomnlnd_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
109 WRITE_HANDLER( cosmica_videoram_w );
110 WRITE_HANDLER( panic_color_register_w );
111 WRITE_HANDLER( cosmicg_color_register_w );
112 WRITE_HANDLER( nomnlnd_background_w );
113 
114 
115 static unsigned int pixel_clock = 0;
116 
117 
118 /* Schematics show 12 triggers for discrete sound circuits */
119 
WRITE_HANDLER(panic_sound_output_w)120 static WRITE_HANDLER( panic_sound_output_w )
121 {
122     static int sound_enabled=1;
123 
124     /* Sound Enable / Disable */
125 
126     if (offset == 11)
127     {
128     	int count;
129     	if (data == 0)
130         	for(count=0; count<9; count++) sample_stop(count);
131 
132     	sound_enabled = data;
133     }
134 
135     if (sound_enabled)
136     {
137         switch (offset)
138         {
139 		case 0:  if (data) sample_start(0, 0, 0); break;  	/* Walk */
140         case 1:  if (data) sample_start(0, 5, 0); break;  	/* Enemy Die 1 */
141         case 2:  if (data)								  	/* Drop 1 */
142 				 {
143 					 if (!sample_playing(1))
144 					 {
145 						 sample_stop(2);
146 						 sample_start(1, 3, 0);
147 					 }
148 				 }
149 				 else
150 				 	sample_stop(1);
151 				 	break;
152 
153 		case 3:	 if (data && !sample_playing(6))			/* Oxygen */
154 					sample_start(6, 9, 1);
155                  break;
156 
157         case 4:  break;										/* Drop 2 */
158         case 5:  if (data) sample_start(0, 5, 0); break;	/* Enemy Die 2 (use same sample as 1) */
159         case 6:  if (data && !sample_playing(1) && !sample_playing(3))   /* Hang */
160                  	sample_start(2, 2, 0);
161                     break;
162 
163 		case 7:  if (data) 									/* Escape */
164 				 {
165 					 sample_stop(2);
166 					 sample_start(3, 4, 0);
167 				 }
168 				 else
169 				 	 sample_stop(3);
170                      break;
171 
172     	case 8:  if (data) sample_start(0, 1, 0); break;	/* Stairs */
173     	case 9:  if (data)									/* Extend */
174 				 	sample_start(4, 8, 0);
175 				 else
176 					sample_stop(4);
177 	  			 break;
178 
179         case 10: DAC_data_w(0, data); break;				/* Bonus */
180 		case 15: if (data) sample_start(0, 6, 0); break;	/* Player Die */
181 		case 16: if (data) sample_start(5, 7, 0); break;	/* Enemy Laugh */
182         case 17: if (data) sample_start(0, 10, 0); break;	/* Coin - Not triggered by software */
183         }
184     }
185 }
186 
WRITE_HANDLER(panic_sound_output2_w)187 WRITE_HANDLER( panic_sound_output2_w )
188 {
189 	panic_sound_output_w(offset+15, data);
190 }
191 
WRITE_HANDLER(cosmicg_output_w)192 WRITE_HANDLER( cosmicg_output_w )
193 {
194 	static int march_select;
195     static int gun_die_select;
196     static int sound_enabled;
197 
198     /* Sound Enable / Disable */
199 
200     if (offset == 12)
201     {
202 	    int count;
203 
204     	sound_enabled = data;
205     	if (data == 0)
206         	for(count=0;count<9;count++) sample_stop(count);
207     }
208 
209     if (sound_enabled)
210     {
211         switch (offset)
212         {
213 		/* The schematics show a direct link to the sound amp  */
214 		/* as other cosmic series games, but it never seems to */
215 		/* be used for anything. It is implemented for sake of */
216 		/* completness. Maybe it plays a tune if you win ?     */
217 		case 1:  DAC_data_w(0, -data); break;
218 		case 2:  if (data) sample_start (0, march_select, 0); break;	/* March Sound */
219 		case 3:  march_select = (march_select & 0xfe) | data; break;
220         case 4:  march_select = (march_select & 0xfd) | (data << 1); break;
221         case 5:  march_select = (march_select & 0xfb) | (data << 2); break;
222 
223         case 6:  if (data)  							/* Killer Attack (crawly thing at bottom of screen) */
224 					sample_start(1, 8, 1);
225 				 else
226 					sample_stop(1);
227 				 break;
228 
229 		case 7:  if (data)								/* Bonus Chance & Got Bonus */
230 				 {
231 					 sample_stop(4);
232 					 sample_start(4, 10, 0);
233 				 }
234 				 break;
235 
236 		case 8:  if (data)
237 				 {
238 					 if (!sample_playing(4)) sample_start(4, 9, 1);
239 				 }
240 				 else
241 				 	sample_stop(4);
242 				 break;
243 
244 		case 9:  if (data) sample_start(3, 11, 0); break;	/* Got Ship */
245 //		case 11: watchdog_reset_w(0, 0); break;				/* Watchdog */
246 		case 13: if (data) sample_start(8, 13-gun_die_select, 0); break;  /* Got Monster / Gunshot */
247 		case 14: gun_die_select = data; break;
248 		case 15: if (data) sample_start(5, 14, 0); break;	/* Coin Extend (extra base) */
249         }
250     }
251 }
252 
panic_interrupt(void)253 static int panic_interrupt(void)
254 {
255 	if (cpu_getiloops() != 0)
256 	{
257     	/* Coin insert - Trigger Sample */
258 
259         /* mostly not noticed since sound is */
260 		/* only enabled if game in progress! */
261 
262     	if ((input_port_3_r(0) & 0xc0) != 0xc0)
263         	panic_sound_output_w(17,1);
264 
265 		return 0x00cf;		/* RST 08h */
266     }
267     else
268     {
269         return 0x00d7;		/* RST 10h */
270     }
271 }
272 
cosmica_interrupt(void)273 static int cosmica_interrupt(void)
274 {
275     pixel_clock = (pixel_clock + 2) & 63;
276 
277     if (pixel_clock == 0)
278     {
279 		if (readinputport(3) & 1)	/* Left Coin */
280 			return nmi_interrupt();
281         else
282         	return ignore_interrupt();
283     }
284 	else
285        	return ignore_interrupt();
286 }
287 
cosmicg_interrupt(void)288 static int cosmicg_interrupt(void)
289 {
290 	/* Increment Pixel Clock */
291 
292     pixel_clock = (pixel_clock + 1) & 15;
293 
294     /* Insert Coin */
295 
296 	/* R Nabet : fixed to make this piece of code sensible.
297 	I assumed that the interrupt request lasted for as long as the coin was "sensed".
298 	It makes sense and works fine, but I cannot be 100% sure this is correct,
299 	as I have no Cosmic Guerilla console :-) . */
300 
301 	if (pixel_clock == 0)
302 	{
303 		if ((readinputport(2) & 1)) /* Coin */
304 		{
305 #if COSMICG_USES_TMS9980
306 			/* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
307 			cpu_0_irq_line_vector_w(0, 6);
308 #else
309 			/* tms9900 is more straightforward */
310 			cpu_0_irq_line_vector_w(0, 4);
311 #endif
312 			cpu_set_irq_line(0, 0, ASSERT_LINE);
313 		}
314 		else
315 		{
316 			cpu_set_irq_line(0, 0, CLEAR_LINE);
317 		}
318 	}
319 
320 	return ignore_interrupt();
321 }
322 
magspot2_interrupt(void)323 static int magspot2_interrupt(void)
324 {
325 	/* Coin 1 causes an IRQ, Coin 2 an NMI */
326 	if (input_port_4_r(0) & 0x01)
327 	{
328   		return interrupt();
329 	}
330 
331 	if (input_port_4_r(0) & 0x02)
332 	{
333 		return nmi_interrupt();
334 	}
335 
336 	return ignore_interrupt();
337 }
338 
339 
READ_HANDLER(cosmica_pixel_clock_r)340 READ_HANDLER( cosmica_pixel_clock_r )
341 {
342 	return pixel_clock;
343 }
344 
READ_HANDLER(cosmicg_pixel_clock_r)345 READ_HANDLER( cosmicg_pixel_clock_r )
346 {
347 	/* The top four address lines from the CRTC are bits 0-3 */
348 
349 	return (input_port_0_r(0) & 0xf0) | pixel_clock;
350 }
351 
READ_HANDLER(magspot2_coinage_dip_r)352 static READ_HANDLER( magspot2_coinage_dip_r )
353 {
354 	return (input_port_5_r(0) & (1 << (7 - offset))) ? 0 : 1;
355 }
356 
357 
358 /* Has 8 way joystick, remap combinations to missing directions */
359 
READ_HANDLER(nomnlnd_port_r)360 static READ_HANDLER( nomnlnd_port_r )
361 {
362 	int control;
363     int fire = input_port_3_r(0);
364 
365 	if (offset)
366 		control = input_port_1_r(0);
367     else
368 		control = input_port_0_r(0);
369 
370     /* If firing - stop tank */
371 
372     if ((fire & 0xc0) == 0) return 0xff;
373 
374     /* set bit according to 8 way direction */
375 
376     if ((control & 0x82) == 0 ) return 0xfe;    /* Up & Left */
377     if ((control & 0x0a) == 0 ) return 0xfb;    /* Down & Left */
378     if ((control & 0x28) == 0 ) return 0xef;    /* Down & Right */
379     if ((control & 0xa0) == 0 ) return 0xbf;    /* Up & Right */
380 
381     return control;
382 }
383 
384 
385 #if COSMICG_USES_TMS9980
386 
387 /* 8-bit handler */
388 #define cosmicg_videoram_w cosmica_videoram_w
389 #define cosmicg_videoram_r MRA_RAM
390 #define COSMICG_ROM_LOAD ROM_LOAD
391 
392 #else
393 
WRITE_HANDLER(cosmicg_videoram_w)394 static WRITE_HANDLER( cosmicg_videoram_w )
395 {
396   /* 16-bit handler */
397   if (! (data & 0xff000000))
398     cosmica_videoram_w(offset, (data >> 8) & 0xff);
399   if (! (data & 0x00ff0000))
400     cosmica_videoram_w(offset + 1, data & 0xff);
401 }
402 
READ_HANDLER(cosmicg_videoram_r)403 static READ_HANDLER( cosmicg_videoram_r )
404 {
405 	return (videoram[offset] << 8) | videoram[offset+1];
406 }
407 
408 #define COSMICG_ROM_LOAD ROM_LOAD_WIDE
409 
410 #endif
411 
412 
413 static struct MemoryReadAddress panic_readmem[] =
414 {
415 	{ 0x0000, 0x3fff, MRA_ROM },
416 	{ 0x4000, 0x5fff, MRA_RAM },
417 	{ 0x6800, 0x6800, input_port_0_r }, /* IN1 */
418 	{ 0x6801, 0x6801, input_port_1_r }, /* IN2 */
419 	{ 0x6802, 0x6802, input_port_2_r }, /* DSW */
420 	{ 0x6803, 0x6803, input_port_3_r }, /* IN0 */
421 	{ -1 }	/* end of table */
422 };
423 
424 static struct MemoryWriteAddress panic_writemem[] =
425 {
426 	{ 0x0000, 0x3fff, MWA_ROM },
427 	{ 0x4000, 0x5fff, cosmica_videoram_w, &videoram, &videoram_size },
428 	{ 0x6000, 0x601f, MWA_RAM, &spriteram, &spriteram_size },
429     { 0x7000, 0x700b, panic_sound_output_w },
430 	{ 0x700c, 0x700e, panic_color_register_w },
431 	{ 0x700f, 0x700f, flip_screen_w },
432     { 0x7800, 0x7801, panic_sound_output2_w },
433 	{ -1 }	/* end of table */
434 };
435 
436 static struct MemoryReadAddress cosmica_readmem[] =
437 {
438 	{ 0x0000, 0x3fff, MRA_ROM },
439 	{ 0x4000, 0x5fff, MRA_RAM },
440 	{ 0x6800, 0x6800, input_port_0_r }, /* IN1 */
441 	{ 0x6801, 0x6801, input_port_1_r }, /* IN2 */
442 	{ 0x6802, 0x6802, input_port_2_r }, /* DSW */
443 	{ 0x6803, 0x6803, cosmica_pixel_clock_r },
444 	{ -1 }	/* end of table */
445 };
446 
447 static struct MemoryWriteAddress cosmica_writemem[] =
448 {
449 	{ 0x0000, 0x3fff, MWA_ROM },
450 	{ 0x4000, 0x5fff, cosmica_videoram_w, &videoram, &videoram_size },
451 	{ 0x6000, 0x601f, MWA_RAM ,&spriteram, &spriteram_size },
452 	{ 0x7000, 0x700b, MWA_RAM },   			/* Sound Triggers */
453 	{ 0x700c, 0x700e, panic_color_register_w },
454 	{ 0x700f, 0x700f, flip_screen_w },
455 	{ -1 }	/* end of table */
456 };
457 
458 static struct MemoryReadAddress cosmicg_readmem[] =
459 {
460 	{ 0x0000, 0x1fff, MRA_ROM },
461 	{ 0x2000, 0x3fff, cosmicg_videoram_r },
462 	{ -1 }	/* end of table */
463 };
464 
465 static struct MemoryWriteAddress cosmicg_writemem[] =
466 {
467 	{ 0x0000, 0x1fff, MWA_ROM },
468 	{ 0x2000, 0x3fff, cosmicg_videoram_w, &videoram, &videoram_size },
469 	{ -1 }	/* end of table */
470 };
471 
472 static struct IOReadPort cosmicg_readport[] =
473 {
474 	{ 0x00, 0x00, cosmicg_pixel_clock_r },
475 	{ 0x01, 0x01, input_port_1_r },
476 	{ -1 }	/* end of table */
477 };
478 
479 static struct IOWritePort cosmicg_writeport[] =
480 {
481 	{ 0x00, 0x15, cosmicg_output_w },
482     { 0x16, 0x17, cosmicg_color_register_w },
483 	{ -1 }	/* end of table */
484 };
485 
486 static struct MemoryReadAddress magspot2_readmem[] =
487 {
488 	{ 0x0000, 0x2fff, MRA_ROM },
489 	{ 0x3800, 0x3807, magspot2_coinage_dip_r },
490 	{ 0x5000, 0x5000, input_port_0_r },
491 	{ 0x5001, 0x5001, input_port_1_r },
492 	{ 0x5002, 0x5002, input_port_2_r },
493 	{ 0x5003, 0x5003, input_port_3_r },
494 	{ 0x6000, 0x7fff, MRA_RAM },
495 	{ -1 }	/* end of table */
496 };
497 
498 static struct MemoryWriteAddress magspot2_writemem[] =
499 {
500 	{ 0x0000, 0x2fff, MWA_ROM },
501 	{ 0x4000, 0x401f, MWA_RAM, &spriteram, &spriteram_size},
502 	{ 0x4800, 0x4800, DAC_0_data_w },
503 	{ 0x480c, 0x480e, panic_color_register_w },
504 	{ 0x480f, 0x480f, flip_screen_w },
505 	{ 0x6000, 0x7fff, cosmica_videoram_w, &videoram, &videoram_size},
506 	{ -1 }	/* end of table */
507 };
508 
509 static struct MemoryReadAddress nomnlnd_readmem[] =
510 {
511 	{ 0x0000, 0x2fff, MRA_ROM },
512 	{ 0x3800, 0x3807, magspot2_coinage_dip_r },
513 	{ 0x5000, 0x5001, nomnlnd_port_r },
514 	{ 0x5002, 0x5002, input_port_2_r },
515 	{ 0x5003, 0x5003, input_port_3_r },
516 	{ 0x6000, 0x7fff, MRA_RAM },
517 	{ -1 }	/* end of table */
518 };
519 
520 static struct MemoryWriteAddress nomnlnd_writemem[] =
521 {
522 	{ 0x0000, 0x2fff, MWA_ROM },
523 	{ 0x4000, 0x401f, MWA_RAM, &spriteram, &spriteram_size},
524 	{ 0x4807, 0x4807, nomnlnd_background_w },
525 	{ 0x480a, 0x480a, DAC_0_data_w },
526 	{ 0x480c, 0x480e, panic_color_register_w },
527 	{ 0x480f, 0x480f, flip_screen_w },
528 	{ 0x6000, 0x7fff, cosmica_videoram_w, &videoram, &videoram_size},
529 	{ -1 }	/* end of table */
530 };
531 
532 
533 INPUT_PORTS_START( panic )
534 	PORT_START      /* IN1 */
535 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
536 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
537 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
538 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
539 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
540 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
541 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
542 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
543 
544 	PORT_START      /* IN2 */
545 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
546 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
547 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
548 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
549 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
550 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
551 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
552 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
553 
554 	PORT_START      /* DSW */
555 	PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
556 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
557 	PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
558 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
559 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
560 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
561 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
562 /* 0x06 and 0x07 disabled */
563 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
564 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
565 	PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
566 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
567 	PORT_DIPSETTING(    0x00, "3000" )
568 	PORT_DIPSETTING(    0x10, "5000" )
569 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives ) )
570 	PORT_DIPSETTING(    0x00, "3" )
571 	PORT_DIPSETTING(    0x20, "4" )
572 	PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coin_B ) )
573 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
574 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
575 	PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
576 	PORT_DIPSETTING(    0xc0, DEF_STR( 1C_3C ) )
577 
578 	PORT_START      /* IN0 */
579 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
580 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
581 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
582 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
583 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
584 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
585 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
586 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
587 
588 INPUT_PORTS_END
589 
590 INPUT_PORTS_START( cosmica )
591 	PORT_START      /* IN0 */
592 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
593 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
594 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
595 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
596 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
597 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
598 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
599 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
600 
601 	PORT_START      /* IN1 */
602 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
603 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
604 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
605 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
606 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
607 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
608 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
609 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
610 
611 	PORT_START      /* IN2 */
612 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
613 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
614 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
615 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
616 	PORT_DIPSETTING(    0x02, "3" )
617 	PORT_DIPSETTING(    0x00, "5" )
618 	PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
619 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
620 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
621 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
622 /* 0c gives 1C_1C */
623 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
624 	PORT_DIPSETTING(    0x30, "5000" )
625 	PORT_DIPSETTING(    0x20, "10000" )
626 	PORT_DIPSETTING(    0x10, "15000" )
627 	PORT_DIPSETTING(    0x00, "None" )
628 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
629 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
630 
631 	/* The coin slots are not memory mapped. Coin  causes a NMI, */
632 	/* This fake input port is used by the interrupt */
633 	/* handler to be notified of coin insertions. We use IMPULSE to */
634 	/* trigger exactly one interrupt, without having to check when the */
635 	/* user releases the key. */
636 
637 	PORT_START	/* FAKE */
638 	PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
639 
640 INPUT_PORTS_END
641 
642 /* These are used for the CR handling - This can be used to */
643 /* from 1 to 16 bits from any bit offset between 0 and 4096 */
644 
645 /* Offsets are in BYTES, so bits 0-7 are at offset 0 etc.   */
646 
647 INPUT_PORTS_START( cosmicg )
648 	PORT_START /* 4-7 */
649 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
650 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
651 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
652 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
653 
654 	PORT_START /* 8-15 */
655 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
656 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
657 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL)
658 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL)
659 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
660 	PORT_DIPSETTING(    0x10, "1000" )
661 	PORT_DIPSETTING(    0x20, "1500" )
662 	PORT_DIPSETTING(    0x30, "2000" )
663 	PORT_DIPSETTING(    0x00, "None" )
664 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
665 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
666 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
667 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
668 	PORT_DIPSETTING(    0x00, "3" )
669 	PORT_DIPSETTING(    0x80, "5" )
670 
671 	PORT_START      /* Hard wired settings */
672 
673 	/* The coin slots are not memory mapped. Coin causes INT 4  */
674 	/* This fake input port is used by the interrupt handler 	*/
675 	/* to be notified of coin insertions. */
676 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
677 
678     /* This dip switch is not read by the program at any time   */
679     /* but is wired to enable or disable the flip screen output */
680 
681 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
682 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
683 	PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
684 
685     /* This odd setting is marked as shown on the schematic,    */
686     /* and again, is not read by the program, but wired into    */
687     /* the watchdog circuit. The book says to leave it off      */
688 
689 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
690 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
691 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
692 
693 INPUT_PORTS_END
694 
695 INPUT_PORTS_START( magspot2 )
696 	PORT_START	/* IN0 */
697 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
698 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
699 	PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
700 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
701 	PORT_DIPNAME( 0xc0, 0x40, "Bonus Game" )
702 	PORT_DIPSETTING(    0x40, "5000" )
703 	PORT_DIPSETTING(    0x80, "10000" )
704 	PORT_DIPSETTING(    0xc0, "15000" )
705 	PORT_DIPSETTING(    0x00, "None" )
706 
707 	PORT_START	/* IN1 */
708 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
709 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
710 	PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
711 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
712 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
713 
714 	PORT_START	/* IN2 */
715 	PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
716 	PORT_DIPSETTING(    0x01, "2000" )
717 	PORT_DIPSETTING(    0x02, "3000" )
718 	PORT_DIPSETTING(    0x03, "5000" )
719 	PORT_DIPSETTING(    0x00, "None" )
720 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
721 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
722 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
723 	PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) )
724 	PORT_DIPSETTING(    0x00, "2" )
725 	PORT_DIPSETTING(    0x08, "3" )
726 	PORT_DIPSETTING(    0x10, "4" )
727 	PORT_DIPSETTING(    0x18, "5" )
728 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
729 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
730 	PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
731 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
732 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
733 
734 	PORT_START	/* IN3 */
735 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
736 	PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
737 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
738 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
739 
740 	/* Fake port to handle coins */
741 	PORT_START	/* IN4 */
742 	PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
743 	PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN2, 1 )
744 
745 	/* Fake port to handle coinage dip switches. Each bit goes to 3800-3807 */
746 	PORT_START	/* IN5 */
747 	PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
748 	PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
749 	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
750 	PORT_DIPSETTING(    0x0d, DEF_STR( 4C_2C ) )
751 	PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
752 	PORT_DIPSETTING(    0x09, DEF_STR( 3C_2C ) )
753 	PORT_DIPSETTING(    0x0e, DEF_STR( 4C_3C ) )
754 	PORT_DIPSETTING(    0x0f, DEF_STR( 4C_4C ) )
755 	PORT_DIPSETTING(    0x0a, DEF_STR( 3C_3C ) )
756 	PORT_DIPSETTING(    0x06, DEF_STR( 2C_2C ) )
757 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
758 	PORT_DIPSETTING(    0x0b, DEF_STR( 3C_4C ) )
759 	PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
760 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
761 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
762 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
763 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
764 	PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
765 	PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
766 	PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
767 	PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
768 	PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
769 	PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
770 	PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
771 	PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
772 	PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
773 	PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
774 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
775 	PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
776 	PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
777 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
778 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
779 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
780 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
781 INPUT_PORTS_END
782 
783 INPUT_PORTS_START( devzone )
784 	PORT_START	/* IN0 */
785 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
786 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY )
787 	PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
788 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
789 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
790 
791 	PORT_START	/* IN1 */
792 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
793 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
794 	PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
795 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
796 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
797 
798 	PORT_START	/* IN2 */
799 	PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
800 	PORT_DIPSETTING(    0x01, "4000" )
801 	PORT_DIPSETTING(    0x02, "6000" )
802 	PORT_DIPSETTING(    0x03, "8000" )
803 	PORT_DIPSETTING(    0x00, "None" )
804 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) )
805 	PORT_DIPSETTING(    0x0c, "Use Coin A & B" )
806 	PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
807 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
808 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
809 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) )
810 	PORT_DIPSETTING(    0x00, "2" )
811 	PORT_DIPSETTING(    0x10, "3" )
812 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
813 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
814 	PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
815 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
816 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
817 
818 	PORT_START	/* IN3 */
819 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
820 	PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
821 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
822 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
823 
824 	/* Fake port to handle coins */
825 	PORT_START	/* IN4 */
826 	PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
827 	PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN2, 1 )
828 
829 	PORT_START	/* IN5 */
830 	PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
831 	PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
832 	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
833 	PORT_DIPSETTING(    0x0d, DEF_STR( 4C_2C ) )
834 	PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
835 	PORT_DIPSETTING(    0x09, DEF_STR( 3C_2C ) )
836 	PORT_DIPSETTING(    0x0e, DEF_STR( 4C_3C ) )
837 	PORT_DIPSETTING(    0x0f, DEF_STR( 4C_4C ) )
838 	PORT_DIPSETTING(    0x0a, DEF_STR( 3C_3C ) )
839 	PORT_DIPSETTING(    0x06, DEF_STR( 2C_2C ) )
840 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
841 	PORT_DIPSETTING(    0x0b, DEF_STR( 3C_4C ) )
842 	PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
843 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
844 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
845 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
846 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
847 	PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
848 	PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
849 	PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
850 	PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
851 	PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
852 	PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
853 	PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
854 	PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
855 	PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
856 	PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
857 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
858 	PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
859 	PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
860 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
861 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
862 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
863 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
864 INPUT_PORTS_END
865 
866 INPUT_PORTS_START( nomnlnd )
867 	PORT_START	/* Controls - Remapped for game */
868 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
869 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
870 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
871 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
872 	PORT_BIT( 0x55, IP_ACTIVE_LOW, IPT_UNUSED )
873 
874 	PORT_START	/* IN1 */
875 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
876 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
877 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
878 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
879 	PORT_BIT( 0x55, IP_ACTIVE_LOW, IPT_UNUSED )
880 
881 	PORT_START	/* IN2 */
882 	PORT_DIPNAME( 0x03, 0x02, DEF_STR( Bonus_Life ) )
883 	PORT_DIPSETTING(    0x01, "2000" )
884 	PORT_DIPSETTING(    0x02, "3000" )
885 	PORT_DIPSETTING(    0x03, "5000" )
886 	PORT_DIPSETTING(    0x00, "None" )
887 	PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
888 	PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
889    	PORT_DIPSETTING(    0x0c, DEF_STR( 2C_2C ) )
890 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
891 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
892 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
893 	PORT_DIPSETTING(    0x00, "3" )
894 	PORT_DIPSETTING(    0x10, "5" )
895 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
896 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
897 	PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
898 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
899 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
900 
901 	PORT_START	/* IN3 */
902 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VBLANK )
903 	PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
904 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
905 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
906 
907 	/* Fake port to handle coin */
908 	PORT_START	/* IN4 */
909 	PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
910 
911 	PORT_START	/* IN5 */
912 	PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coinage ) )
913 	PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
914 	PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
915 	PORT_DIPSETTING(    0xd0, DEF_STR( 4C_2C ) )
916 	PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
917 	PORT_DIPSETTING(    0x90, DEF_STR( 3C_2C ) )
918 	PORT_DIPSETTING(    0xe0, DEF_STR( 4C_3C ) )
919 	PORT_DIPSETTING(    0xf0, DEF_STR( 4C_4C ) )
920 	PORT_DIPSETTING(    0xa0, DEF_STR( 3C_3C ) )
921 	PORT_DIPSETTING(    0x60, DEF_STR( 2C_2C ) )
922 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
923 	PORT_DIPSETTING(    0xb0, DEF_STR( 3C_4C ) )
924 	PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
925 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
926 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
927 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
928 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
929 
930 INPUT_PORTS_END
931 
932 
933 static struct GfxLayout panic_spritelayout0 =
934 {
935 	16,16,	/* 16*16 sprites */
936 	48 ,	/* 64 sprites */
937 	2,	    /* 2 bits per pixel */
938 	{ 4096*8, 0 },	/* the two bitplanes are separated */
939 	{ 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 },
940    	{ 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
941 	32*8	/* every sprite takes 32 consecutive bytes */
942 };
943 
944 static struct GfxLayout panic_spritelayout1 =
945 {
946 	16,16,	/* 16*16 sprites */
947 	16 ,	/* 16 sprites */
948 	2,	    /* 2 bits per pixel */
949 	{ 4096*8, 0 },	/* the two bitplanes are separated */
950 	{ 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7 },
951   	{ 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
952 	32*8	/* every sprite takes 32 consecutive bytes */
953 };
954 
955 static struct GfxLayout cosmica_spritelayout16 =
956 {
957 	16,16,				/* 16*16 sprites */
958 	64,					/* 64 sprites */
959 	2,					/* 2 bits per pixel */
960 	{ 64*16*16, 0 },	/* the two bitplanes are separated */
961 	{ 0,1,2,3,4,5,6,7,16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7},
962 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
963 	32*8				/* every sprite takes 32 consecutive bytes */
964 };
965 
966 static struct GfxLayout cosmica_spritelayout32 =
967 {
968 	32,32,				/* 32*32 sprites */
969 	16,					/* 16 sprites */
970 	2,					/* 2 bits per pixel */
971 	{ 64*16*16, 0 },	/* the two bitplanes are separated */
972 	{ 0,1,2,3,4,5,6,7,
973 	  32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7,
974 	  64*8+0, 64*8+1, 64*8+2, 64*8+3, 64*8+4, 64*8+5, 64*8+6, 64*8+7,
975   	  96*8+0, 96*8+1, 96*8+2, 96*8+3, 96*8+4, 96*8+5, 96*8+6, 96*8+7 },
976 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8, 16*8, 17*8,18*8,19*8,20*8,21*8,22*8,23*8,24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 },
977 	128*8				/* every sprite takes 128 consecutive bytes */
978 };
979 
980 static struct GfxLayout nomnlnd_treelayout =
981 {
982 	32,32,				/* 32*32 sprites */
983 	4,					/* 4 sprites */
984 	2,					/* 2 bits per pixel */
985 	{ 0, 8*128*8 },	/* the two bitplanes are separated */
986 	{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 },
987 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32,
988 	 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 },
989 	128*8				/* every sprite takes 128 consecutive bytes */
990 };
991 
992 static struct GfxLayout nomnlnd_waterlayout =
993 {
994 	16,32,				/* 16*32 sprites */
995 	32,					/* 32 sprites */
996 	2,					/* 2 bits per pixel */
997 	{ 0, 8*128*8 },	/* the two bitplanes are separated */
998 	{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 },
999 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32,
1000 	 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 },
1001 	32 				/* To create a set of sprites 1 pixel displaced */
1002 };
1003 
1004 static struct GfxDecodeInfo panic_gfxdecodeinfo[] =
1005 {
1006 	{ REGION_GFX1, 0x0a00, &panic_spritelayout0, 0, 8 },	/* Monsters              0a00-0fff */
1007 	{ REGION_GFX1, 0x0200, &panic_spritelayout0, 0, 8 },	/* Monsters eating Man   0200-07ff */
1008 	{ REGION_GFX1, 0x0800, &panic_spritelayout1, 0, 8 },	/* Man                   0800-09ff */
1009 	{ -1 } /* end of array */
1010 };
1011 
1012 static struct GfxDecodeInfo cosmica_gfxdecodeinfo[] =
1013 {
1014 	{ REGION_GFX1, 0, &cosmica_spritelayout16,  0, 16 },
1015 	{ REGION_GFX1, 0, &cosmica_spritelayout32,  0, 16 },
1016 	{ -1 } /* end of array */
1017 };
1018 
1019 static struct GfxDecodeInfo magspot2_gfxdecodeinfo[] =
1020 {
1021 	{ REGION_GFX1, 0, &cosmica_spritelayout16,  0, 8 },
1022 	{ REGION_GFX1, 0, &cosmica_spritelayout32,  0, 8 },
1023 	{ -1 } /* end of array */
1024 };
1025 
1026 static struct GfxDecodeInfo nomnlnd_gfxdecodeinfo[] =
1027 {
1028 	{ REGION_GFX1, 0x0000, &cosmica_spritelayout16,  0,  8 },
1029 	{ REGION_GFX1, 0x0000, &cosmica_spritelayout32,  0,  8 },
1030 	{ REGION_GFX2, 0x0000, &nomnlnd_treelayout,      0,  9 },
1031 	{ REGION_GFX2, 0x0200, &nomnlnd_waterlayout,     0,  10 },
1032 	{ -1 } /* end of array */
1033 };
1034 
1035 
1036 static struct DACinterface dac_interface =
1037 {
1038 	1,
1039 	{ 100 }
1040 };
1041 
1042 static const char *panic_sample_names[] =
1043 {
1044 	"*panic",
1045 	"walk.wav",
1046     "upordown.wav",
1047     "trapped.wav",
1048     "falling.wav",
1049     "escaping.wav",
1050 	"ekilled.wav",
1051     "death.wav",
1052     "elaugh.wav",
1053     "extral.wav",
1054     "oxygen.wav",
1055     "coin.wav",
1056 	0       /* end of array */
1057 };
1058 
1059 static struct Samplesinterface panic_samples_interface =
1060 {
1061 	9,	/* 9 channels */
1062 	25,	/* volume */
1063 	panic_sample_names
1064 };
1065 
1066 static const char *cosmicg_sample_names[] =
1067 {
1068 	"*cosmicg",
1069 	"cg_m0.wav",	/* 8 Different pitches of March Sound */
1070 	"cg_m1.wav",
1071 	"cg_m2.wav",
1072 	"cg_m3.wav",
1073 	"cg_m4.wav",
1074 	"cg_m5.wav",
1075 	"cg_m6.wav",
1076 	"cg_m7.wav",
1077 	"cg_att.wav",	/* Killer Attack */
1078 	"cg_chnc.wav",	/* Bonus Chance  */
1079 	"cg_gotb.wav",	/* Got Bonus - have not got correct sound for */
1080 	"cg_dest.wav",	/* Gun Destroy */
1081 	"cg_gun.wav",	/* Gun Shot */
1082 	"cg_gotm.wav",	/* Got Monster */
1083 	"cg_ext.wav",	/* Coin Extend */
1084 	0       /* end of array */
1085 };
1086 
1087 static struct Samplesinterface cosmicg_samples_interface =
1088 {
1089 	9,	/* 9 channels */
1090 	25,	/* volume */
1091 	cosmicg_sample_names
1092 };
1093 
1094 
1095 static struct MachineDriver machine_driver_panic =
1096 {
1097 	/* basic machine hardware */
1098 	{
1099 		{
1100 			CPU_Z80,
1101 			2000000,	/* 2 Mhz? */
1102 			panic_readmem,panic_writemem,0,0,
1103 			panic_interrupt,2
1104 		}
1105 	},
1106 	60, DEFAULT_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
1107 	1,	/* single CPU, no need for interleaving */
1108 	0,
1109 
1110 	/* video hardware */
1111   	32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
1112 	panic_gfxdecodeinfo,
1113 	16, 8*4,
1114 	panic_vh_convert_color_prom,
1115 
1116 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
1117 	0,
1118 	generic_bitmapped_vh_start,
1119 	generic_bitmapped_vh_stop,
1120 	panic_vh_screenrefresh,
1121 
1122 	/* sound hardware */
1123 	0,0,0,0,
1124     {
1125 		{
1126 			SOUND_SAMPLES,
1127 			&panic_samples_interface
1128 		},
1129 		{
1130 			SOUND_DAC,
1131 			&dac_interface
1132 		}
1133     }
1134 };
1135 
1136 static struct MachineDriver machine_driver_cosmica =
1137 {
1138 	/* basic machine hardware */
1139 	{
1140 		{
1141 			CPU_Z80,
1142 			1081600,
1143 			cosmica_readmem,cosmica_writemem,0,0,
1144 			cosmica_interrupt,32
1145 		}
1146 	},
1147 	60, 2500,	/* frames per second, vblank duration */
1148 	1,	/* single CPU, no need for interleaving */
1149 	0,
1150 
1151 	/* video hardware */
1152   	32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
1153 	cosmica_gfxdecodeinfo,
1154 	8, 16*4,
1155 	cosmica_vh_convert_color_prom,
1156 
1157 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
1158 	0,
1159 	generic_bitmapped_vh_start,
1160 	generic_bitmapped_vh_stop,
1161 	cosmica_vh_screenrefresh,
1162 
1163 	/* sound hardware */
1164 	0,0,0,0
1165 };
1166 
1167 static struct MachineDriver machine_driver_cosmicg =
1168 {
1169 	/* basic machine hardware */
1170 	{
1171 		{
1172 #if COSMICG_USES_TMS9980
1173 			CPU_TMS9980,
1174 #else
1175 			CPU_TMS9900,
1176 #endif
1177 			1228500,			/* 9.828 Mhz Crystal */
1178 			/* R Nabet : huh ? This would imply the crystal frequency is somehow divided by 2 before being
1179 			fed to the tms9904 or tms9980.  Also, I have never heard of a tms9900/9980 operating under
1180 			1.5MHz.  So, if someone can check this... */
1181 			cosmicg_readmem,cosmicg_writemem,
1182 			cosmicg_readport,cosmicg_writeport,
1183 			cosmicg_interrupt,16
1184 		}
1185 	},
1186 	60, 0,		/* frames per second, vblank duration */
1187 	1,			/* single CPU, no need for interleaving */
1188 	0,
1189 
1190 	/* video hardware */
1191   	32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
1192 	0, 			/* no gfxdecodeinfo - bitmapped display */
1193     16,0,
1194     cosmicg_vh_convert_color_prom,
1195 
1196 	VIDEO_TYPE_RASTER,
1197 	0,
1198 	generic_bitmapped_vh_start,
1199 	generic_bitmapped_vh_stop,
1200 	cosmicg_vh_screenrefresh,
1201 
1202 	/* sound hardware */
1203 	0,0,0,0,
1204 	{
1205 		{
1206 			SOUND_SAMPLES,
1207 			&cosmicg_samples_interface
1208 		},
1209 		{
1210 			SOUND_DAC,
1211 			&dac_interface
1212 		}
1213 	}
1214 };
1215 
1216 static struct MachineDriver machine_driver_magspot2 =
1217 {
1218 	/* basic machine hardware */
1219 	{
1220 		{
1221 			CPU_Z80,
1222 			18432000/6,	/* 3.072 Mhz ???? */
1223 			magspot2_readmem,magspot2_writemem,0,0,
1224 			magspot2_interrupt,1
1225 		},
1226 	},
1227 	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
1228 	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
1229 	0,
1230 
1231 	/* video hardware */
1232   	32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
1233 	magspot2_gfxdecodeinfo,
1234 	16, 8*4,
1235 	magspot2_vh_convert_color_prom,
1236 
1237 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
1238 	0,
1239 	generic_bitmapped_vh_start,
1240 	generic_bitmapped_vh_stop,
1241 	magspot2_vh_screenrefresh,
1242 
1243 	/* sound hardware */
1244 	0,0,0,0,
1245 	{
1246 		{
1247 			SOUND_DAC,
1248 			&dac_interface
1249 		}
1250 	}
1251 };
1252 
1253 static struct MachineDriver machine_driver_nomnlnd =
1254 {
1255 	/* basic machine hardware */
1256 	{
1257 		{
1258 			CPU_Z80,
1259 			18432000/6,	/* 3.072 Mhz ???? */
1260 			nomnlnd_readmem,nomnlnd_writemem,0,0,
1261 			magspot2_interrupt,1
1262 		},
1263 	},
1264 	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,	/* frames per second, vblank duration */
1265 	1,	/* 1 CPU slice per frame */
1266 	0,
1267 
1268 	/* video hardware */
1269   	32*8, 32*8, { 0*8, 32*8-1, 4*8, 28*8-1 },
1270 	nomnlnd_gfxdecodeinfo,
1271 	16, 16*4,
1272 	magspot2_vh_convert_color_prom,
1273 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
1274 	0,
1275 	generic_bitmapped_vh_start,
1276 	generic_bitmapped_vh_stop,
1277 	nomnlnd_vh_screenrefresh,
1278 
1279 	/* sound hardware */
1280 	0,0,0,0,
1281 	{
1282 		{
1283 			SOUND_DAC,
1284 			&dac_interface
1285 		}
1286 	}
1287 };
1288 
1289 
init_cosmicg(void)1290 static void init_cosmicg(void)
1291 {
1292 	/* Roms have data pins connected different from normal */
1293 
1294 	int count;
1295 	unsigned char scrambled,normal;
1296 
1297     for(count=0x1fff;count>=0;count--)
1298 	{
1299         scrambled = memory_region(REGION_CPU1)[count];
1300 
1301         normal = (scrambled >> 3 & 0x11)
1302                | (scrambled >> 1 & 0x22)
1303                | (scrambled << 1 & 0x44)
1304                | (scrambled << 3 & 0x88);
1305 
1306         memory_region(REGION_CPU1)[count] = normal;
1307     }
1308 
1309     /* Patch to avoid crash - Seems like duff romcheck routine */
1310     /* I would expect it to be bitrot, but have two romsets    */
1311     /* from different sources with the same problem!           */
1312 
1313 #if COSMICG_USES_TMS9980
1314     memory_region(REGION_CPU1)[0x1e9e] = 0x04;
1315     memory_region(REGION_CPU1)[0x1e9f] = 0xc0;
1316 #else
1317 	WRITE_WORD(memory_region(REGION_CPU1) + 0x1e9e, 0x04c0);
1318 #endif
1319 }
1320 
1321 
1322 ROM_START( panic )
1323 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1324 	ROM_LOAD( "spcpanic.1",   0x0000, 0x0800, 0x405ae6f9 )
1325 	ROM_LOAD( "spcpanic.2",   0x0800, 0x0800, 0xb6a286c5 )
1326 	ROM_LOAD( "spcpanic.3",   0x1000, 0x0800, 0x85ae8b2e )
1327 	ROM_LOAD( "spcpanic.4",   0x1800, 0x0800, 0xb6d4f52f )
1328 	ROM_LOAD( "spcpanic.5",   0x2000, 0x0800, 0x5b80f277 )
1329 	ROM_LOAD( "spcpanic.6",   0x2800, 0x0800, 0xb73babf0 )
1330 	ROM_LOAD( "spcpanic.7",   0x3000, 0x0800, 0xfc27f4e5 )
1331 
1332 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1333 	ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
1334 	ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
1335 	ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
1336 	ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
1337 
1338 	ROM_REGION( 0x0020, REGION_PROMS )
1339 	ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
1340 
1341 	ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
1342 	ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
1343 ROM_END
1344 
1345 ROM_START( panica )
1346 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1347 	ROM_LOAD( "panica.1",     0x0000, 0x0800, 0x289720ce )
1348 	ROM_LOAD( "spcpanic.2",   0x0800, 0x0800, 0xb6a286c5 )
1349 	ROM_LOAD( "spcpanic.3",   0x1000, 0x0800, 0x85ae8b2e )
1350 	ROM_LOAD( "spcpanic.4",   0x1800, 0x0800, 0xb6d4f52f )
1351 	ROM_LOAD( "spcpanic.5",   0x2000, 0x0800, 0x5b80f277 )
1352 	ROM_LOAD( "spcpanic.6",   0x2800, 0x0800, 0xb73babf0 )
1353 	ROM_LOAD( "panica.7",     0x3000, 0x0800, 0x3641cb7f )
1354 
1355 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1356 	ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
1357 	ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
1358 	ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
1359 	ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
1360 
1361 	ROM_REGION( 0x0020, REGION_PROMS )
1362 	ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
1363 
1364 	ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
1365 	ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
1366 ROM_END
1367 
1368 ROM_START( panicger )
1369 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1370 	ROM_LOAD( "spacepan.001", 0x0000, 0x0800, 0xa6d9515a )
1371 	ROM_LOAD( "spacepan.002", 0x0800, 0x0800, 0xcfc22663 )
1372 	ROM_LOAD( "spacepan.003", 0x1000, 0x0800, 0xe1f36893 )
1373 	ROM_LOAD( "spacepan.004", 0x1800, 0x0800, 0x01be297c )
1374 	ROM_LOAD( "spacepan.005", 0x2000, 0x0800, 0xe0d54805 )
1375 	ROM_LOAD( "spacepan.006", 0x2800, 0x0800, 0xaae1458e )
1376 	ROM_LOAD( "spacepan.007", 0x3000, 0x0800, 0x14e46e70 )
1377 
1378 	ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
1379 	ROM_LOAD( "spcpanic.9",   0x0000, 0x0800, 0xeec78b4c )
1380 	ROM_LOAD( "spcpanic.10",  0x0800, 0x0800, 0xc9631c2d )
1381 	ROM_LOAD( "spcpanic.12",  0x1000, 0x0800, 0xe83423d0 )
1382 	ROM_LOAD( "spcpanic.11",  0x1800, 0x0800, 0xacea9df4 )
1383 
1384 	ROM_REGION( 0x0020, REGION_PROMS )
1385 	ROM_LOAD( "82s123.sp",    0x0000, 0x0020, 0x35d43d2f )
1386 
1387 	ROM_REGION( 0x0800, REGION_USER1 ) /* color map */
1388 	ROM_LOAD( "spcpanic.8",   0x0000, 0x0800, 0x7da0b321 )
1389 ROM_END
1390 
1391 ROM_START( cosmica )
1392 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1393 	ROM_LOAD( "ca.e3",        0x0000, 0x0800, 0x535ee0c5 )
1394 	ROM_LOAD( "ca.e4",        0x0800, 0x0800, 0xed3cf8f7 )
1395 	ROM_LOAD( "ca.e5",        0x1000, 0x0800, 0x6a111e5e )
1396 	ROM_LOAD( "ca.e6",        0x1800, 0x0800, 0xc9b5ca2a )
1397 	ROM_LOAD( "ca.e7",        0x2000, 0x0800, 0x43666d68 )
1398 
1399 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1400 	ROM_LOAD( "ca.n1",        0x0000, 0x0800, 0x431e866c )
1401 	ROM_LOAD( "ca.n2",        0x0800, 0x0800, 0xaa6c6079 )
1402 
1403 	ROM_REGION( 0x0020, REGION_PROMS )
1404 	ROM_LOAD( "ca.d9",        0x0000, 0x0020, 0xdfb60f19 )
1405 
1406 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1407 	ROM_LOAD( "ca.e2",        0x0000, 0x0400, 0xea4ee931 )
1408 
1409 	ROM_REGION( 0x0400, REGION_USER2 ) /* starfield generator */
1410 	ROM_LOAD( "ca.sub",       0x0000, 0x0400, 0xacbd4e98 )
1411 ROM_END
1412 
1413 ROM_START( cosmica2 )
1414 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1415 	ROM_LOAD( "ca.e3",        0x0000, 0x0800, 0x535ee0c5 )
1416 	ROM_LOAD( "c3.bin",       0x0800, 0x0400, 0x699c849e )
1417 	ROM_LOAD( "d4.bin",       0x0c00, 0x0400, 0x168e38da )
1418 	ROM_LOAD( "ca.e5",        0x1000, 0x0800, 0x6a111e5e )
1419 	ROM_LOAD( "ca.e6",        0x1800, 0x0800, 0xc9b5ca2a )
1420 	ROM_LOAD( "i9.bin",       0x2000, 0x0400, 0x3bb57720 )
1421 	ROM_LOAD( "j0.bin",       0x2400, 0x0400, 0x4ff70f45 )
1422 
1423 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1424 	ROM_LOAD( "ca.n1",        0x0000, 0x0800, 0x431e866c )
1425 	ROM_LOAD( "ca.n2",        0x0800, 0x0800, 0xaa6c6079 )
1426 
1427 	ROM_REGION( 0x0020, REGION_PROMS )
1428 	ROM_LOAD( "ca.d9",        0x0000, 0x0020, 0xdfb60f19 )
1429 
1430 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1431 	ROM_LOAD( "ca.e2",        0x0000, 0x0400, 0xea4ee931 )
1432 
1433 	ROM_REGION( 0x0400, REGION_USER2 ) /* starfield generator */
1434 	ROM_LOAD( "ca.sub",       0x0000, 0x0400, 0xacbd4e98 )
1435 ROM_END
1436 
1437 ROM_START( cosmicg )
1438 	ROM_REGION( 0x10000, REGION_CPU1 )  /* 8k for code */
1439 	COSMICG_ROM_LOAD( "cosmicg1.bin",  0x0000, 0x0400, 0xe1b9f894 )
1440 	COSMICG_ROM_LOAD( "cosmicg2.bin",  0x0400, 0x0400, 0x35c75346 )
1441 	COSMICG_ROM_LOAD( "cosmicg3.bin",  0x0800, 0x0400, 0x82a49b48 )
1442 	COSMICG_ROM_LOAD( "cosmicg4.bin",  0x0C00, 0x0400, 0x1c1c934c )
1443 	COSMICG_ROM_LOAD( "cosmicg5.bin",  0x1000, 0x0400, 0xb1c00fbf )
1444 	COSMICG_ROM_LOAD( "cosmicg6.bin",  0x1400, 0x0400, 0xf03454ce )
1445 	COSMICG_ROM_LOAD( "cosmicg7.bin",  0x1800, 0x0400, 0xf33ebae7 )
1446 	COSMICG_ROM_LOAD( "cosmicg8.bin",  0x1C00, 0x0400, 0x472e4990 )
1447 
1448 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1449 	ROM_LOAD( "cosmicg9.bin",  0x0000, 0x0400, 0x689c2c96 )
1450 ROM_END
1451 
1452 ROM_START( magspot2 )
1453 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1454 	ROM_LOAD( "ms.e3",   0x0000, 0x0800, 0xc0085ade )
1455 	ROM_LOAD( "ms.e4",   0x0800, 0x0800, 0xd534a68b )
1456 	ROM_LOAD( "ms.e5",   0x1000, 0x0800, 0x25513b2a )
1457 	ROM_LOAD( "ms.e7",   0x1800, 0x0800, 0x8836bbc4 )
1458 	ROM_LOAD( "ms.e6",   0x2000, 0x0800, 0x6a08ab94 )
1459 	ROM_LOAD( "ms.e8",   0x2800, 0x0800, 0x77c6d109 )
1460 
1461 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1462 	ROM_LOAD( "ms.n1",   0x0000, 0x0800, 0x1ab338d3 )
1463 	ROM_LOAD( "ms.n2",   0x0800, 0x0800, 0x9e1d63a2 )
1464 
1465 	ROM_REGION( 0x0020, REGION_PROMS )
1466 	ROM_LOAD( "ms.d9",   0x0000, 0x0020, 0x36e2aa2a )
1467 
1468 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1469 	ROM_LOAD( "ms.e2",   0x0000, 0x0400, 0x89f23ebd )
1470 ROM_END
1471 
1472 ROM_START( devzone )
1473 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1474 	ROM_LOAD( "dv1.e3",  0x0000, 0x0800, 0xc70faf00 )
1475 	ROM_LOAD( "dv2.e4",  0x0800, 0x0800, 0xeacfed61 )
1476 	ROM_LOAD( "dv3.e5",  0x1000, 0x0800, 0x7973317e )
1477 	ROM_LOAD( "dv5.e7",  0x1800, 0x0800, 0xb71a3989 )
1478 	ROM_LOAD( "dv4.e6",  0x2000, 0x0800, 0xa58c5b8c )
1479 	ROM_LOAD( "dv6.e8",  0x2800, 0x0800, 0x3930fb67 )
1480 
1481 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1482 	ROM_LOAD( "dv7.n1",  0x0000, 0x0800, 0xe7562fcf )
1483 	ROM_LOAD( "dv8.n2",  0x0800, 0x0800, 0xda1cbec1 )
1484 
1485 	ROM_REGION( 0x0020, REGION_PROMS )
1486 	ROM_LOAD( "ms.d9",   0x0000, 0x0020, 0x36e2aa2a )
1487 
1488 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1489 	ROM_LOAD( "dz9.e2",  0x0000, 0x0400, 0x693855b6 )
1490 ROM_END
1491 
1492 ROM_START( nomnlnd )
1493 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1494 	ROM_LOAD( "1.bin",  0x0000, 0x0800, 0xba117ba6 )
1495 	ROM_LOAD( "2.bin",  0x0800, 0x0800, 0xe5ed654f )
1496 	ROM_LOAD( "3.bin",  0x1000, 0x0800, 0x7fc42724 )
1497 	ROM_LOAD( "5.bin",  0x1800, 0x0800, 0x9cc2f1d9 )
1498 	ROM_LOAD( "4.bin",  0x2000, 0x0800, 0x0e8cd46a )
1499 	ROM_LOAD( "6.bin",  0x2800, 0x0800, 0xba472ba5 )
1500 
1501 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1502 	ROM_LOAD( "nml7.n1",  0x0000, 0x0800, 0xd08ed22f )
1503 	ROM_LOAD( "nml8.n2",  0x0800, 0x0800, 0x739009b4 )
1504 
1505 	ROM_REGION( 0x0800, REGION_GFX2 | REGIONFLAG_DISPOSE )	/* tree + river */
1506 	ROM_LOAD( "nl11.ic7", 0x0000, 0x0400, 0xe717b241 )
1507 	ROM_LOAD( "nl10.ic4", 0x0400, 0x0400, 0x5b13f64e )
1508 
1509 	ROM_REGION( 0x0020, REGION_PROMS )
1510 	ROM_LOAD( "nml.clr",  0x0000, 0x0020, 0x65e911f9 )
1511 
1512 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1513 	ROM_LOAD( "nl9.e2",   0x0000, 0x0400, 0x9e05f14e )
1514 ROM_END
1515 
1516 ROM_START( nomnlndg )
1517 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
1518 	ROM_LOAD( "nml1.e3",  0x0000, 0x0800, 0xe212ed91 )
1519 	ROM_LOAD( "nml2.e4",  0x0800, 0x0800, 0xf66ef3d8 )
1520 	ROM_LOAD( "nml3.e5",  0x1000, 0x0800, 0xd422fc8a )
1521 	ROM_LOAD( "nml5.e7",  0x1800, 0x0800, 0xd58952ac )
1522 	ROM_LOAD( "nml4.e6",  0x2000, 0x0800, 0x994c9afb )
1523 	ROM_LOAD( "nml6.e8",  0x2800, 0x0800, 0x01ed2d8c )
1524 
1525 	ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )	/* sprites */
1526 	ROM_LOAD( "nml7.n1",  0x0000, 0x0800, 0xd08ed22f )
1527 	ROM_LOAD( "nml8.n2",  0x0800, 0x0800, 0x739009b4 )
1528 
1529 	ROM_REGION( 0x0800, REGION_GFX2 | REGIONFLAG_DISPOSE )	/* tree + river */
1530 	ROM_LOAD( "nl11.ic7", 0x0000, 0x0400, 0xe717b241 )
1531 	ROM_LOAD( "nl10.ic4", 0x0400, 0x0400, 0x5b13f64e )
1532 
1533 	ROM_REGION( 0x0020, REGION_PROMS )
1534 	ROM_LOAD( "nml.clr",  0x0000, 0x0020, 0x65e911f9 )
1535 
1536 	ROM_REGION( 0x0400, REGION_USER1 ) /* color map */
1537 	ROM_LOAD( "nl9.e2",   0x0000, 0x0400, 0x9e05f14e )
1538 ROM_END
1539 
1540 
1541 
1542 GAMEX(1979, cosmicg,  0,       cosmicg,  cosmicg,  cosmicg, ROT270, "Universal", "Cosmic Guerilla", GAME_NO_COCKTAIL )
1543 GAMEX(1979, cosmica,  0,       cosmica,  cosmica,  0,       ROT270, "Universal", "Cosmic Alien", GAME_NO_SOUND )
1544 GAMEX(1979, cosmica2, cosmica, cosmica,  cosmica,  0,       ROT270, "Universal", "Cosmic Alien (older)", GAME_NO_SOUND )
1545 GAME( 1980, panic,    0,       panic,    panic,    0,       ROT270, "Universal", "Space Panic (set 1)" )
1546 GAME( 1980, panica,   panic,   panic,    panic,    0,       ROT270, "Universal", "Space Panic (set 2)" )
1547 GAME( 1980, panicger, panic,   panic,    panic,    0,       ROT270, "Universal (ADP Automaten license)", "Space Panic (German)" )
1548 GAMEX(1980, magspot2, 0,       magspot2, magspot2, 0,       ROT270, "Universal", "Magical Spot II", GAME_IMPERFECT_SOUND )
1549 GAMEX(1980, devzone,  0,       magspot2, devzone,  0,       ROT270, "Universal", "Devil Zone", GAME_IMPERFECT_SOUND )
1550 GAMEX(1980?,nomnlnd,  0,       nomnlnd,  nomnlnd,  0,       ROT270, "Universal", "No Man's Land", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
1551 GAMEX(1980?,nomnlndg, nomnlnd, nomnlnd,  nomnlnd,  0,       ROT270, "Universal (Gottlieb license)", "No Man's Land (Gottlieb)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
1552