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 : Super Qix : VM Driver Source

Source Listing


     1: /***************************************************************************
     2: 
     3: Super QIX memory map (preliminary)
     4: 
     5: driver by Mirko Buffoni
     6: 
     7: CPU:
     8: 0000-7fff ROM
     9: 8000-bfff BANK 0-1-2-3	(All banks except 2 contain code)
    10: 
    11: Notes:
    12: - the original doesn't work due to protection. There is an unknown ROM: code
    13:   for a mcu?
    14: 
    15: ***************************************************************************/
    16: 
    17: #include "driver.h" 
    18: #include "vidhrdw/generic.h" 
    19: 
    20: 
    21: extern WRITE_HANDLER( superqix_videoram_w );
    22: extern WRITE_HANDLER( superqix_colorram_w );
    23: extern READ_HANDLER( superqix_bitmapram_r );
    24: extern WRITE_HANDLER( superqix_bitmapram_w );
    25: extern READ_HANDLER( superqix_bitmapram2_r );
    26: extern WRITE_HANDLER( superqix_bitmapram2_w );
    27: extern WRITE_HANDLER( superqix_0410_w );
    28: extern WRITE_HANDLER( superqix_flipscreen_w );
    29: 
    30: extern VIDEO_START( superqix );
    31: extern VIDEO_UPDATE( superqix );
    32: 
    33: 
    34: static MEMORY_READ_START( readmem )
    35: 	{ 0x0000, 0x7fff, MRA_ROM },
    36: 	{ 0x8000, 0xbfff, MRA_BANK1 },
    37: 	{ 0xe000, 0xffff, MRA_RAM },
    38: MEMORY_END
    39: 
    40: static MEMORY_WRITE_START( writemem )
    41: 	{ 0x0000, 0xbfff, MWA_ROM },
    42: 	{ 0xe000, 0xe0ff, MWA_RAM, &spriteram, &spriteram_size },
    43: 	{ 0xe100, 0xe7ff, MWA_RAM },
    44: 	{ 0xe800, 0xebff, superqix_videoram_w, &videoram },
    45: 	{ 0xec00, 0xefff, superqix_colorram_w, &colorram },
    46: 	{ 0xf000, 0xffff, MWA_RAM },
    47: MEMORY_END
    48: 
    49: static PORT_READ_START( readport )
    50: 	{ 0x0000, 0x00ff, paletteram_r },
    51: 	{ 0x0401, 0x0401, AY8910_read_port_0_r },
    52: 	{ 0x0405, 0x0405, AY8910_read_port_1_r },
    53: 	{ 0x0418, 0x0418, input_port_4_r },
    54: 	{ 0x0800, 0x77ff, superqix_bitmapram_r },
    55: 	{ 0x8800, 0xf7ff, superqix_bitmapram2_r },
    56: PORT_END
    57: 
    58: static PORT_WRITE_START( writeport )
    59: 	{ 0x0000, 0x00ff, paletteram_BBGGRRII_w },
    60: 	{ 0x0402, 0x0402, AY8910_write_port_0_w },
    61: 	{ 0x0403, 0x0403, AY8910_control_port_0_w },
    62: 	{ 0x0406, 0x0406, AY8910_write_port_1_w },
    63: 	{ 0x0407, 0x0407, AY8910_control_port_1_w },
    64: 	{ 0x0408, 0x0408, superqix_flipscreen_w },
    65: 	{ 0x0410, 0x0410, superqix_0410_w },	/* ROM bank, NMI enable, tile bank */
    66: 	{ 0x0800, 0x77ff, superqix_bitmapram_w },
    67: 	{ 0x8800, 0xf7ff, superqix_bitmapram2_w },
    68: PORT_END
    69: 
    70: 
    71: 
    72: INPUT_PORTS_START( superqix )
    73: 	PORT_START	/* IN0 */
    74: 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
    75: 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
    76: 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
    77: 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
    78: 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
    79: 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
    80: 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )	/* ??? */
    81: 	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
    82: 
    83: 	PORT_START	/* IN1 */
    84: 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
    85: 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
    86: 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
    87: 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
    88: 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
    89: 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
    90: 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
    91: 	PORT_BITX(    0x80, 0x00, IPT_DIPSWITCH_NAME, "Freeze???", IP_KEY_NONE, IP_JOY_NONE )
    92: 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
    93: 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
    94: 
    95: 	PORT_START	/* DSW1 */
    96: 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
    97: 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
    98: 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
    99: 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
   100: 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
   101: 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
   102: 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
   103: 	PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
   104: 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
   105: 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
   106: 	PORT_DIPNAME( 0x10, 0x00, "Allow Continue" )
   107: 	PORT_DIPSETTING(    0x10, DEF_STR( No ) )
   108: 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
   109: 	PORT_DIPNAME( 0x20, 0x20, "Freeze" )
   110: 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
   111: 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
   112: 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
   113: 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
   114: 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
   115: 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
   116: 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
   117: 	PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
   118: 
   119: 	PORT_START	/* DSW2 */
   120: 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
   121: 	PORT_DIPSETTING(    0x02, "Easy" )
   122: 	PORT_DIPSETTING(    0x03, "Normal" )
   123: 	PORT_DIPSETTING(    0x01, "Hard" )
   124: 	PORT_DIPSETTING(    0x00, "Hardest" )
   125: 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
   126: 	PORT_DIPSETTING(    0x08, "20000 50000" )
   127: 	PORT_DIPSETTING(    0x0c, "30000 100000" )
   128: 	PORT_DIPSETTING(    0x04, "50000 100000" )
   129: 	PORT_DIPSETTING(    0x00, "None" )
   130: 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
   131: 	PORT_DIPSETTING(    0x20, "2" )
   132: 	PORT_DIPSETTING(    0x30, "3" )
   133: 	PORT_DIPSETTING(    0x10, "4" )
   134: 	PORT_DIPSETTING(    0x00, "5" )
   135: 	PORT_DIPNAME( 0xc0, 0xc0, "Fill Area" )
   136: 	PORT_DIPSETTING(    0x80, "70%" )
   137: 	PORT_DIPSETTING(    0xc0, "75%" )
   138: 	PORT_DIPSETTING(    0x40, "80%" )
   139: 	PORT_DIPSETTING(    0x00, "85%" )
   140: 
   141: 	PORT_START	/* IN2 */
   142: 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
   143: 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
   144: 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
   145: 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
   146: 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
   147: 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
   148: 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
   149: 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
   150: INPUT_PORTS_END
   151: 
   152: 
   153: 
   154: static struct GfxLayout charlayout =
   155: {
   156: 	8,8,
   157: 	1024,
   158: 	4,
   159: 	{ 0, 1, 2, 3 },
   160: 	{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
   161: 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
   162: 	32*8
   163: };
   164: 
   165: static struct GfxLayout spritelayout =
   166: {
   167: 	16,16,
   168: 	RGN_FRAC(1,1),
   169: 	4,
   170: 	{ 0, 1, 2, 3 },
   171: 	{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
   172: 			32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
   173: 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
   174: 			16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
   175: 	128*8
   176: };
   177: 
   178: static struct GfxDecodeInfo gfxdecodeinfo[] =
   179: {
   180: 	{ REGION_GFX1, 0x00000, &charlayout,   0, 16 },	/* Chars */
   181: 	{ REGION_GFX2, 0x00000, &charlayout,   0, 16 },	/* Background tiles */
   182: 	{ REGION_GFX2, 0x08000, &charlayout,   0, 16 },
   183: 	{ REGION_GFX2, 0x10000, &charlayout,   0, 16 },
   184: 	{ REGION_GFX2, 0x18000, &charlayout,   0, 16 },
   185: 	{ REGION_GFX3, 0x00000, &spritelayout, 0, 16 },	/* Sprites */
   186: 	{ -1 } /* end of array */
   187: };
   188: 
   189: 
   190: 
   191: static struct AY8910interface ay8910_interface =
   192: {
   193: 	2,	/* 2 chips */
   194: 	1500000,	/* 1.5 MHz??? */
   195: 	{ 25, 25 },
   196: 	{ input_port_0_r, input_port_3_r },		/* port Aread */
   197: 	{ input_port_1_r, input_port_2_r },		/* port Bread */
   198: 	{ 0 },	/* port Awrite */
   199: 	{ 0 }	/* port Bwrite */
   200: };
   201: 
   202: INTERRUPT_GEN( sqix_interrupt )
   203: {
   204: 	static int loop=0;
   205: 
   206: 	loop++;
   207: 
   208: 	if(loop>2) {
   209: 		if(loop==6) loop=0;
   210: 		nmi_line_pulse();
   211: 	}
   212: }
   213: 
   214: static MACHINE_DRIVER_START( superqix )
   215: 
   216: 	/* basic machine hardware */
   217: 	MDRV_CPU_ADD(Z80, 6000000)	/* 6 MHz ? */
   218: //			10000000,	/* 10 MHz ? */
   219: 	MDRV_CPU_FLAGS(CPU_16BIT_PORT)
   220: 	MDRV_CPU_MEMORY(readmem,writemem)
   221: 	MDRV_CPU_PORTS(readport,writeport)
   222: //	MDRV_CPU_VBLANK_INT(nmi_line_pulse,3)	/* ??? */
   223: 	MDRV_CPU_VBLANK_INT(sqix_interrupt,6)	/* ??? */
   224: 
   225: 	MDRV_FRAMES_PER_SECOND(60)
   226: 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
   227: 
   228: 	/* video hardware */
   229: 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
   230: 	MDRV_SCREEN_SIZE(32*8, 32*8)
   231: 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
   232: 	MDRV_GFXDECODE(gfxdecodeinfo)
   233: 	MDRV_PALETTE_LENGTH(256)
   234: 
   235: 	MDRV_VIDEO_START(superqix)
   236: 	MDRV_VIDEO_UPDATE(superqix)
   237: 
   238: 	/* sound hardware */
   239: 	MDRV_SOUND_ADD(AY8910, ay8910_interface)
   240: MACHINE_DRIVER_END
   241: 
   242: 
   243: 
   244: /***************************************************************************
   245: 
   246:   Game driver(s)
   247: 
   248: ***************************************************************************/
   249: 
   250: ROM_START( superqix )
   251: 	ROM_REGION( 0x20000, REGION_CPU1, 0 )	/* 64k for code */
   252: 	ROM_LOAD( "sq01.97",      0x00000, 0x08000, CRC(0888b7de) SHA1(de3e4637436de185f43d2ad4186d4cfdcd4d33d9) )
   253: 	ROM_LOAD( "sq02.96",      0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
   254: 
   255: 	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
   256: 	ROM_LOAD( "sq04.2",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
   257: 
   258: 	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
   259: 	ROM_LOAD( "sq03.3",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
   260: 	ROM_LOAD( "sq06.14",      0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
   261: 
   262: 	ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
   263: 	ROM_LOAD( "sq05.1",       0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
   264: 
   265: 	ROM_REGION( 0x1000, REGION_USER1, 0 )	/* Unknown (protection related?) */
   266: 	ROM_LOAD( "sq07.108",     0x00000, 0x1000, CRC(071a598c) SHA1(2726705c3b82f5703e856261cdec5e86d7e1994e) )	// FIXED BITS (xxxx1xxx)
   267: ROM_END
   268: 
   269: ROM_START( sqixbl )
   270: 	ROM_REGION( 0x20000, REGION_CPU1, 0 )	/* 64k for code */
   271: 	ROM_LOAD( "cpu.2",        0x00000, 0x08000, CRC(682e28e3) SHA1(fe9221d26d7397be5a0fc8fdc51672b5924f3cf2) )
   272: 	ROM_LOAD( "sq02.96",      0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
   273: 
   274: 	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
   275: 	ROM_LOAD( "sq04.2",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
   276: 
   277: 	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
   278: 	ROM_LOAD( "sq03.3",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
   279: 	ROM_LOAD( "sq06.14",      0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
   280: 
   281: 	ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
   282: 	ROM_LOAD( "sq05.1",       0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
   283: ROM_END
   284: 
   285: ROM_START( perestro )
   286: 	ROM_REGION( 0x20000, REGION_CPU1, 0 )	/* 64k for code */
   287: 	/* 0x8000 - 0x10000 in the rom is empty anyway */
   288: 	ROM_LOAD( "rom1.bin",        0x00000, 0x20000, CRC(0cbf96c1) SHA1(cf2b1367887d1b8812a56aa55593e742578f220c) )
   289: 
   290: 	ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
   291: 	ROM_LOAD( "rom4.bin",       0x00000, 0x10000, CRC(c56122a8) SHA1(1d24b2f0358e14aca5681f92175869224584a6ea) ) /* both halves identical */
   292: 
   293: 	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
   294: 	ROM_LOAD( "rom2.bin",       0x00000, 0x20000, CRC(36f93701) SHA1(452cb23efd955c6c155cef2b1b650e253e195738) )
   295: 
   296: 	ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
   297: 	ROM_LOAD( "rom3.bin",       0x00000, 0x10000, CRC(00c91d5a) SHA1(fdde56d3689a47e6bfb296e442207b93b887ec7a) )
   298: ROM_END
   299: 
   300: 
   301: static DRIVER_INIT(perestro)
   302: {
   303: 	data8_t *src;
   304: 	int len;
   305: 	data8_t temp[16];
   306: 	int i,j;
   307: 
   308: 	/* decrypt program code; the address lines are shuffled around in a non-trivial way */
   309: 	src = memory_region(REGION_CPU1);
   310: 	len = memory_region_length(REGION_CPU1);
   311: 	for (i = 0;i < len;i += 16)
   312: 	{
   313: 		memcpy(temp,&src[i],16);
   314: 		for (j = 0;j < 16;j++)
   315: 		{
   316: 			static int convtable[16] =
   317: 			{
   318: 				0xc, 0x9, 0xb, 0xa,
   319: 				0x8, 0xd, 0xf, 0xe,
   320: 				0x4, 0x1, 0x3, 0x2,
   321: 				0x0, 0x5, 0x7, 0x6
   322: 			};
   323: 
   324: 			src[i+j] = temp[convtable[j]];
   325: 		}
   326: 	}
   327: 
   328: 	/* decrypt gfx ROMs; simple bit swap on the address lines */
   329: 	src = memory_region(REGION_GFX1);
   330: 	len = memory_region_length(REGION_GFX1);
   331: 	for (i = 0;i < len;i += 16)
   332: 	{
   333: 		memcpy(temp,&src[i],16);
   334: 		for (j = 0;j < 16;j++)
   335: 		{
   336: 			src[i+j] = temp[BITSWAP8(j,7,6,5,4,3,2,0,1)];
   337: 		}
   338: 	}
   339: 
   340: 	src = memory_region(REGION_GFX2);
   341: 	len = memory_region_length(REGION_GFX2);
   342: 	for (i = 0;i < len;i += 16)
   343: 	{
   344: 		memcpy(temp,&src[i],16);
   345: 		for (j = 0;j < 16;j++)
   346: 		{
   347: 			src[i+j] = temp[BITSWAP8(j,7,6,5,4,0,1,2,3)];
   348: 		}
   349: 	}
   350: 
   351: 	src = memory_region(REGION_GFX3);
   352: 	len = memory_region_length(REGION_GFX3);
   353: 	for (i = 0;i < len;i += 16)
   354: 	{
   355: 		memcpy(temp,&src[i],16);
   356: 		for (j = 0;j < 16;j++)
   357: 		{
   358: 			src[i+j] = temp[BITSWAP8(j,7,6,5,4,1,0,3,2)];
   359: 		}
   360: 	}
   361: }
   362: 
   363: 
   364: GAMEX(1987, superqix, 0,        superqix, superqix, 0,        ROT90, "Taito", "Super Qix", GAME_NOT_WORKING )
   365: GAME( 1987, sqixbl,   superqix, superqix, superqix, 0,        ROT90, "bootleg", "Super Qix (bootleg)" )
   366: GAME( 1993, perestro, 0,        superqix, superqix, perestro, ROT90, "Promat / Fuuki", "Perestroika Girls" )
   367: 




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