QuarterArcade Coin-Op Tech Net

Quick Nav: # A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Coin-Op : Arcade : Enigma II : VM Driver Source

Source Listing


     1: /********************************************************************
     2: 
     3: Enigma 2 (c) Zilec Electronics
     4: 
     5: driver by Pierpaolo Prazzoli and Tomasz Slanina
     6: 
     7: Two sets:
     8: 
     9: Enigma2 (1981)
    10:  2xZ80 + AY8910
    11: 
    12: Enigma2a (1984?)
    13:  Conversion applied to a Taito Space Invaders Part II board set. Bootleg ?
    14: 
    15: TODO:
    16:  	- Add sound once there is a good dump of the sound program
    17:  	- What is the other Prom used for?
    18:  	- Why does it write into ROM area?
    19: *********************************************************************/
    20: 
    21: #include "driver.h" 
    22: #include "vidhrdw/generic.h" 
    23: 
    24: static int cmap;
    25: 
    26: WRITE_HANDLER( enigma2_videoram_w )
    27: {
    28: 	if (videoram[offset] != data)
    29: 	{
    30: 		int i,x,y,col;
    31: 
    32: 		videoram[offset] = data;
    33: 
    34: 		y = offset / 32;
    35: 		col = 8 * (offset % 32);
    36: 		x = 255 - col;
    37: 
    38: 		for (i = 0; i < 8; i++)
    39: 		{
    40: 			if( data & 0x80 )
    41: 				plot_pixel(tmpbitmap, x, 255 - y, cmap?(memory_region(REGION_PROMS)[((y+16) >> 3 << 5) | ((col+i) >> 3)] & 0x07):Machine->pens[7]);
    42: 			else
    43: 				plot_pixel(tmpbitmap, x, 255 - y, Machine->pens[0]);
    44: 			x++;
    45: 			data <<= 1;
    46: 		}
    47: 	}
    48: }
    49: 
    50: static READ_HANDLER( fake_r )
    51: {
    52: 	static int cnt;
    53: 	/* HACK! to get dip-switches working, since they are read by the sound board
    54: 							  enigma						 enigma2a */
    55: 	if( activecpu_get_pc() == 0x156 || activecpu_get_pc() == 0x284 )
    56: 	{
    57: 		cnt = 0;
    58: 		return readinputport(2);
    59: 	}
    60: 	else
    61: 	{
    62: 		cnt ^= 1;
    63: 		return cnt ? 0x7d : 0xf4; /*expected values*/
    64: 	}
    65: }
    66: 
    67: static READ_HANDLER( fake_r2 )
    68: {
    69: 	if( activecpu_get_pc() == 0x7e5 ) /* needed by enigma2a*/
    70: 		return 0xaa;
    71: 	else
    72: 		return 0xf4;
    73: }
    74: 
    75: static READ_HANDLER( fake_r3 )
    76: {
    77: 	return 0x38;
    78: }
    79: 
    80: static MEMORY_READ_START( readmem )
    81: 	{ 0x0000, 0x1fff, MRA_ROM },
    82: 	{ 0x2000, 0x21ff, MRA_RAM },
    83:   { 0x2200, 0x3fff, videoram_r },
    84: 	{ 0x4000, 0x4fff, MRA_ROM },
    85: 	{ 0x5001, 0x5001, fake_r }, /* sub cpu communication */
    86: 	{ 0x5002, 0x5002, fake_r2 },
    87: 	{ 0x5035, 0x5035, fake_r3 },		/* only enigma2a (pc:1282) */
    88: 	{ 0x5801, 0x5801, input_port_0_r }, /* only enigma2a, used instead of ports */
    89: 	{ 0x5802, 0x5802, input_port_1_r }, /* only enigma2a, used instead of ports */
    90: MEMORY_END
    91: 
    92: static MEMORY_WRITE_START( writemem )
    93: 	{ 0x0000, 0x1fff, MWA_ROM },
    94: 	{ 0x2000, 0x21ff, MWA_RAM },
    95: 	{ 0x2200, 0x3fff, enigma2_videoram_w, &videoram },
    96: 	{ 0x4000, 0x4fff, MWA_ROM },
    97: 	{ 0x5015, 0x53fb, MWA_RAM }, /* every 0x20 */
    98: 	{ 0x5415, 0x541b, MWA_RAM }, /* always zero ? */
    99: 	{ 0x5803, 0x5803, MWA_RAM }, /* only enigma2a, used instead of ports */
   100: 	{ 0x5805, 0x5805, MWA_RAM }, /* only enigma2a, used instead of ports */
   101: 	{ 0x5806, 0x5806, MWA_RAM }, /* only enigma2a, used instead of ports */
   102: MEMORY_END
   103: 
   104: static PORT_READ_START( readport )
   105: 	{ 0x01, 0x01, input_port_0_r },
   106: 	{ 0x02, 0x02, input_port_1_r },
   107: PORT_END
   108: 
   109: static PORT_WRITE_START( writeport )
   110: 	{ 0x03, 0x03, MWA_NOP },
   111: 	{ 0x05, 0x05, MWA_NOP },
   112: 	{ 0x06, 0x06, MWA_NOP },
   113: PORT_END
   114: 
   115: INPUT_PORTS_START( enigma2a )
   116: 	PORT_START
   117: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
   118: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
   119: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
   120: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
   121: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
   122: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT   | IPF_2WAY | IPF_PLAYER1 )
   123: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  | IPF_2WAY | IPF_PLAYER1 )
   124: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
   125: 
   126: 	PORT_START
   127: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
   128: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
   129: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
   130: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
   131: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
   132: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT   | IPF_2WAY | IPF_PLAYER2 )
   133: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  | IPF_2WAY | IPF_PLAYER2 )
   134: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
   135: 
   136: 	PORT_START
   137: 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
   138: 	PORT_DIPSETTING(    0x00, "3" )
   139: 	PORT_DIPSETTING(    0x01, "4" )
   140: 	PORT_DIPSETTING(    0x02, "5" )
   141: 	PORT_DIPSETTING(    0x03, "6" )
   142: 	PORT_DIPNAME( 0x1c, 0x00, "Skill level" )
   143: 	PORT_DIPSETTING(    0x00, "1" )
   144: 	PORT_DIPSETTING(    0x04, "2" )
   145: 	PORT_DIPSETTING(    0x0c, "3" )
   146: 	PORT_DIPSETTING(    0x08, "4" )
   147: 	PORT_DIPSETTING(    0x10, "5" )
   148: 	PORT_DIPSETTING(    0x14, "6" )
   149: /*	PORT_DIPSETTING(    0x18, "?" )
   150: 	PORT_DIPSETTING(    0x1c, "?" ) */
   151: 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
   152: 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
   153: 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
   154: 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
   155: 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
   156: 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
   157: 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
   158: 	PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
   159: 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
   160: INPUT_PORTS_END
   161: 
   162: INPUT_PORTS_START( enigma2 )
   163: 	PORT_START
   164: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
   165: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
   166: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
   167: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
   168: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
   169: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT   | IPF_2WAY | IPF_PLAYER1 )
   170: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  | IPF_2WAY | IPF_PLAYER1 )
   171: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
   172: 
   173: 	PORT_START
   174: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
   175: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
   176: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
   177: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
   178: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
   179: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT   | IPF_2WAY | IPF_PLAYER2 )
   180: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  | IPF_2WAY | IPF_PLAYER2 )
   181: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
   182: 
   183: 	PORT_START
   184: 	PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
   185: 	PORT_DIPSETTING(    0x00, "3" )
   186: 	PORT_DIPSETTING(    0x01, "4" )
   187: 	PORT_DIPSETTING(    0x02, "5" )
   188: 	PORT_DIPSETTING(    0x03, "6" )
   189: 	PORT_DIPNAME( 0x1c, 0x00, "Skill level" ) /* need check */
   190: 	PORT_DIPSETTING(    0x00, "1" )
   191: 	PORT_DIPSETTING(    0x04, "2" )
   192: 	PORT_DIPSETTING(    0x0c, "3" )
   193: 	PORT_DIPSETTING(    0x08, "4" )
   194: 	PORT_DIPSETTING(    0x10, "5" )
   195: 	PORT_DIPSETTING(    0x14, "6" )
   196: /*	PORT_DIPSETTING(    0x18, "?" )
   197: 	PORT_DIPSETTING(    0x1c, "?" )*/
   198: 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
   199: 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
   200: 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
   201: 	PORT_DIPNAME( 0x40, 0x40, "Number of invaders" )
   202: 	PORT_DIPSETTING(    0x40, "16" )
   203: 	PORT_DIPSETTING(    0x00, "32" )
   204: 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) )
   205: 	PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
   206: 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
   207: INPUT_PORTS_END
   208: 
   209: INTERRUPT_GEN( enigma2_interrupt )
   210: {
   211: 	int vector = cpu_getvblank() ? 0xcf : 0xd7;
   212:     cpu_set_irq_line_and_vector(0, 0, HOLD_LINE, vector);
   213: }
   214: 
   215: PALETTE_INIT( enigma2 )
   216: {
   217: /*
   218: 	Washed colors were hand-tuned from :
   219: 	http://www.arcadeflyers.com/?page=flyerdb&subpage=thumbs&id=1756&PHPSESSID=9c8361a00f26b15f9b49bdd7cca9d47f
   220: */
   221: 	palette_set_color(0,0,0,0);
   222: 	palette_set_color(1,85,113,178);
   223: 	palette_set_color(2,225,198,83);
   224: 	palette_set_color(3,194,218,156);
   225: 	palette_set_color(4,234,57,47);
   226: 	palette_set_color(5,238,187,186);
   227: 	/* 6 */
   228: 	palette_set_color(7,0xff,0xff,0xff);
   229: }
   230: 
   231: static MACHINE_DRIVER_START( enigma2 )
   232: 	MDRV_CPU_ADD_TAG("main",Z80, 2500000)
   233: 	MDRV_CPU_MEMORY(readmem,writemem)
   234: 	MDRV_CPU_PORTS(readport,writeport)
   235: 	MDRV_CPU_VBLANK_INT(enigma2_interrupt,2)
   236: 
   237: 	MDRV_FRAMES_PER_SECOND(60)
   238: 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
   239: 
   240: 	/* video hardware */
   241: 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
   242: 	MDRV_SCREEN_SIZE(256, 256)
   243: 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
   244: 	MDRV_PALETTE_LENGTH(8)
   245: 	MDRV_PALETTE_INIT(enigma2)
   246: 
   247: 	MDRV_VIDEO_START(generic_bitmapped)
   248: 	MDRV_VIDEO_UPDATE(generic_bitmapped)
   249: MACHINE_DRIVER_END
   250: 
   251: static MACHINE_DRIVER_START( enigma2a )
   252: 	MDRV_IMPORT_FROM(enigma2)
   253: 	MDRV_CPU_REPLACE("main", 8080, 2000000)
   254: MACHINE_DRIVER_END
   255: 
   256: ROM_START( enigma2a )
   257: 	ROM_REGION( 0x10000, REGION_CPU1, 0 )
   258: 	ROM_LOAD( "36_en1.bin",   0x0000, 0x0800, CRC(15f44806) SHA1(4a2f7bc91d4edf7a069e0865d964371c97af0a0a) )
   259: 	ROM_LOAD( "35_en2.bin",   0x0800, 0x0800, CRC(e841072f) SHA1(6ab02fd9fdeac5ab887cd25eee3d6b70ab01f849) )
   260: 	ROM_LOAD( "34_en3.bin",   0x1000, 0x0800, CRC(43d06cf4) SHA1(495af05d54c0325efb67347f691e64d194645d85) )
   261: 	ROM_LOAD( "33_en4.bin",   0x1800, 0x0800, CRC(8879a430) SHA1(c97f44bef3741eef74e137d2459e79f1b3a90457) )
   262: 	ROM_LOAD( "5.11d",        0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) )
   263: 	ROM_LOAD( "6.13d",   	  0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) )
   264: 
   265: 	/* the length of the correct rom should be 0x1000 */
   266: 	ROM_REGION( 0x10000, REGION_CPU2, 0 )
   267: 	ROM_LOAD( "sound.bin",    0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) )
   268: 
   269: ROM_END
   270: 
   271: ROM_START( enigma2 )
   272: 	ROM_REGION( 0x10000, REGION_CPU1, 0 )
   273: 	ROM_LOAD( "1.5d",         0x0000, 0x0800, CRC(499749de) SHA1(401928ff41d3b4cbb68e6ad3bf3be4a10ae1781f) )
   274: 	ROM_LOAD( "2.7d",         0x0800, 0x0800, CRC(173c1329) SHA1(3f1ad46d0e58ab236e4ff2b385d09fbf113627da) )
   275: 	ROM_LOAD( "3.8d",         0x1000, 0x0800, CRC(c7d3e6b1) SHA1(43f7c3a02b46747998260d5469248f21714fe12b) )
   276: 	ROM_LOAD( "4.10d",        0x1800, 0x0800, CRC(c6a7428c) SHA1(3503f09856655c5973fb89f60d1045fe41012aa9) )
   277: 	ROM_LOAD( "5.11d",   	  0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) )
   278: 	ROM_LOAD( "6.13d",   	  0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) )
   279: 
   280: 	// the length of the correct rom should be 0x1000
   281: 	ROM_REGION( 0x10000, REGION_CPU2, 0 )
   282: 	ROM_LOAD( "s.2f",         0x0000, 0x0800, BAD_DUMP CRC(9bceb714) SHA1(c3d9301cc93d073d7b2694346c26eddd36f94aae) )
   283: 
   284:  /* Color Map */
   285: 	ROM_REGION( 0x800, REGION_PROMS, 0 )
   286: 	ROM_LOAD( "7.11f",        0x0000, 0x0800, CRC(409b5aad) SHA1(1b774a70f725637458ed68df9ed42476291b0e43) )
   287: 
   288: 	/* Unknown */
   289: 	ROM_REGION( 0x10000, REGION_USER1, 0 )
   290: 	ROM_LOAD( "8.13f",        0x0000, 0x0800, CRC(e9cb116d) SHA1(41da4f46c5614ec3345c233467ebad022c6b0bf5) )
   291: ROM_END
   292: 
   293: static DRIVER_INIT(enigma2) {	cmap=1;}
   294: static DRIVER_INIT(enigma2a){	cmap=0;}
   295: 
   296: GAMEX( 1981, enigma2,  0,		enigma2, enigma2,  enigma2, ROT90, "GamePlan (Zilec Electronics license)", "Enigma 2", GAME_NO_SOUND | GAME_WRONG_COLORS )
   297: GAMEX( 1984, enigma2a, enigma2, enigma2a, enigma2a, enigma2a, ROT90, "Zilec Electronics", "Enigma 2 (Space Invaders Hardware)", GAME_NO_SOUND | GAME_WRONG_COLORS )
   298: 




powered by ggdb.com this page took approx. 0.016s