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 : Pit & Run : VM Driver Source

Source Listing


     1: /****************************************************
     2:    Pit&Run - Taito 1984
     3:  
     4:  driver by  Tomasz Slanina and	Pierpaolo Prazzoli
     5: 
     6: 
     7: TODO:
     8: 
     9:  - analog sound
    10:    writes to $a8xx triggering analog sound :
    11:    	$a800 - drivers are gettin into the cars
    12:    	$a801 - collisions
    13:    	$a802 - same as above
    14:    	$a803 - slide on water
    15:    	$a804 - accelerate
    16:    	$a807 - analog sound reset 
    17: 
    18: - better emulation of 'lightning' and 'spotlight' effects (see notes in vidhrdw/pitnrun.c )
    19:  
    20: 
    21: -----------------------------------------------------
    22: $8101 B - course
    23: $8102 B - trial
    24: $8492 B - fuel
    25: $84f6 B - lap
    26: $84c1 W - time 
    27: -----------------------------------------------------
    28: 
    29: N4200374A
    30: 
    31: K1000232A
    32:             A11_17     2128  PR9
    33:            (68705P5)         PR10
    34:                              PR11
    35:      SW1                     PR12
    36:                         Z80
    37:                                       clr.1
    38:                         PR8           clr.2
    39: 
    40:                PR6                    clr.3
    41:                PR7
    42:                               2114
    43:                               2114
    44: 
    45: K1000231A
    46: 
    47:     2114 2114
    48:     PR13
    49:                 Z80
    50: 
    51:           8910 8910
    52:    5MHz
    53: 
    54: K1000233A
    55: 
    56:   2125      2125        2128
    57:   2125      2125        2128
    58:   2125      2125        PR4
    59:   2125      2125        PR5
    60:   2125      2125
    61: 
    62:                              2114
    63:      PR1                     2114
    64:      PR2
    65:      PR3
    66: */
    67: 
    68: #include "driver.h" 
    69: #include "vidhrdw/generic.h" 
    70: 
    71: WRITE_HANDLER (pitnrun_68705_portA_w);
    72: WRITE_HANDLER (pitnrun_68705_portB_w);
    73: 
    74: READ_HANDLER (pitnrun_68705_portA_r);
    75: READ_HANDLER (pitnrun_68705_portB_r);
    76: READ_HANDLER (pitnrun_68705_portC_r);
    77: 
    78: MACHINE_INIT( pitnrun );
    79: 
    80: READ_HANDLER( pitnrun_mcu_data_r );
    81: READ_HANDLER( pitnrun_mcu_status_r );
    82: WRITE_HANDLER( pitnrun_mcu_data_w );
    83: 
    84: extern UINT8* videoram2;
    85: 
    86: WRITE_HANDLER( pitnrun_videoram_w );
    87: WRITE_HANDLER( pitnrun_videoram2_w );
    88: WRITE_HANDLER(pitnrun_ha_w);
    89: WRITE_HANDLER(pitnrun_h_heed_w);
    90: WRITE_HANDLER(pitnrun_v_heed_w);
    91: WRITE_HANDLER(pitnrun_color_select_w);
    92: WRITE_HANDLER( pitnrun_char_bank_select );
    93: WRITE_HANDLER( pitnrun_scroll_w );
    94: READ_HANDLER( pitnrun_videoram_r );
    95: READ_HANDLER( pitnrun_videoram2_r );
    96: 
    97: PALETTE_INIT(pitnrun);
    98: VIDEO_START(pitnrun);
    99: VIDEO_UPDATE(pitnrun);
   100: 
   101: static int pitnrun_nmi;
   102: 
   103: static INTERRUPT_GEN( pitnrun_nmi_source )
   104: {
   105: 	 if(pitnrun_nmi) cpu_set_irq_line(0,IRQ_LINE_NMI, PULSE_LINE)	;
   106: }
   107: 
   108: static WRITE_HANDLER( nmi_enable_w )
   109: {
   110:         pitnrun_nmi=data&1;
   111: }
   112: 
   113: static WRITE_HANDLER(pitnrun_hflip_w)
   114: {
   115: 	flip_screen_x_set(data);
   116: }
   117: 
   118: static WRITE_HANDLER(pitnrun_vflip_w)
   119: {
   120: 	flip_screen_y_set(data);
   121: }
   122: 
   123: static MEMORY_READ_START( readmem )
   124: 	{ 0x0000, 0x7fff, MRA_ROM },
   125: 	{ 0x8000, 0x87ff, MRA_RAM},
   126: 	{ 0x8800, 0x8fff, pitnrun_videoram_r},
   127: 	{ 0x9000, 0x9fff, pitnrun_videoram2_r }, 
   128: 	{ 0xa000, 0xa0ff, spriteram_r }, 
   129: 	{ 0xa800, 0xa800, input_port_0_r },
   130: 	{ 0xb000, 0xb000, input_port_1_r },
   131: 	{ 0xb800, 0xb800, input_port_2_r },
   132: 	{ 0xd800, 0xd800, pitnrun_mcu_status_r},
   133: 	{ 0xd000, 0xd000, pitnrun_mcu_data_r },
   134: 	{ 0xf000, 0xf000, watchdog_reset_r},
   135: MEMORY_END
   136: 
   137: static MEMORY_WRITE_START( writemem )
   138: 	{ 0x0000, 0x7fff, MWA_ROM },
   139: 	{ 0x8000, 0x87ff, MWA_RAM }, 
   140: 	{ 0x8800, 0x8fff, pitnrun_videoram_w, &videoram ,&videoram_size }, 
   141: 	{ 0x9000, 0x9fff, pitnrun_videoram2_w, &videoram2 }, 
   142: 	{ 0xa000, 0xa0ff, spriteram_w, &spriteram, &spriteram_size },
   143: 	{ 0xa800, 0xa807, MWA_NOP }, /* Analog Sound */
   144: 	{ 0xb000, 0xb000, nmi_enable_w },
   145: 	{ 0xb001, 0xb001, pitnrun_color_select_w }, 
   146: 	{ 0xb004, 0xb004, MWA_NOP },/* COLOR SEL 2 - not used ?*/
   147: 	{ 0xb005, 0xb005, pitnrun_char_bank_select},
   148: 	{ 0xb006, 0xb006, pitnrun_hflip_w},
   149: 	{ 0xb007, 0xb007, pitnrun_vflip_w},
   150: 	{ 0xb800, 0xb800, soundlatch_w },
   151: 	{ 0xc800, 0xc801, pitnrun_scroll_w },
   152: 	{ 0xc802, 0xc802, MWA_NOP },/* VP(VF?)MCV - not used ?*/
   153: 	{ 0xc804, 0xc804, pitnrun_mcu_data_w },
   154: 	{ 0xc805, 0xc805, pitnrun_h_heed_w },
   155:  	{ 0xc806, 0xc806, pitnrun_v_heed_w },
   156: 	{ 0xc807, 0xc807, pitnrun_ha_w },
   157: MEMORY_END
   158: 
   159: static PORT_WRITE_START( sound_writeport )
   160: 	{ 0x00, 0x00, soundlatch_clear_w },
   161: 	{ 0x8c, 0x8c, AY8910_control_port_1_w },
   162: 	{ 0x8d, 0x8d, AY8910_write_port_1_w   },
   163: 	{ 0x8e, 0x8e, AY8910_control_port_0_w },
   164: 	{ 0x8f, 0x8f, AY8910_write_port_0_w   },
   165: 	{ 0x90, 0x96, MWA_NOP }, 
   166: 	{ 0x97, 0x97, MWA_NOP }, 
   167: 	{ 0x98, 0x98, MWA_NOP }, 
   168: PORT_END
   169: 
   170: static PORT_READ_START( sound_readport )
   171: 	{ 0x8f, 0x8f, AY8910_read_port_0_r },
   172: PORT_END
   173: 
   174: 
   175: static MEMORY_READ_START( sound_readmem )
   176: 	{ 0x0000, 0x2fff, MRA_ROM },
   177: 	{ 0x3800, 0x3bff, MRA_RAM },
   178: 	
   179: MEMORY_END
   180: 
   181: 
   182: static MEMORY_WRITE_START( sound_writemem )
   183: 	{ 0x0000, 0x2fff, MWA_ROM },
   184: 	{ 0x3800, 0x3bff, MWA_RAM },
   185: MEMORY_END
   186: 
   187: static MEMORY_READ_START( mcu_readmem )
   188: 	{ 0x0000, 0x0000, pitnrun_68705_portA_r },
   189: 	{ 0x0001, 0x0001, pitnrun_68705_portB_r },
   190: 	{ 0x0002, 0x0002, pitnrun_68705_portC_r },
   191: 	{ 0x0003, 0x007f, MRA_RAM },
   192: 	{ 0x0080, 0x07ff, MRA_ROM },
   193: MEMORY_END
   194: 
   195: 
   196: static MEMORY_WRITE_START( mcu_writemem )
   197: 	{ 0x0000, 0x0000, pitnrun_68705_portA_w },
   198: 	{ 0x0001, 0x0001, pitnrun_68705_portB_w },
   199: 	{ 0x0003, 0x007f, MWA_RAM },
   200: 	{ 0x0080, 0x07ff, MWA_ROM },
   201: MEMORY_END
   202: 
   203: INPUT_PORTS_START( pitnrun )
   204: 	PORT_START      /* IN0 */
   205: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1  )
   206: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
   207: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
   208: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
   209: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   210: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   211: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   212: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   213: 
   214: 	PORT_START		/* DSW0 */
   215: 	PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
   216: 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
   217: 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
   218: 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
   219: 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )
   220: 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
   221: 	PORT_DIPSETTING(    0x05, DEF_STR( 1C_5C ) )
   222: 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_6C ) )
   223: 	PORT_DIPSETTING(    0x07, DEF_STR( 1C_7C ) )
   224: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   225: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   226: 	PORT_DIPNAME( 0x20, 0x00, "Gasoline Count" )
   227: 	PORT_DIPSETTING(    0x00, "10 Up or 10 Down" )
   228: 	PORT_DIPSETTING(    0x20, "20 Up or 20 Down" )
   229: 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
   230: 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
   231: 	PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
   232: 	PORT_BITX(    0x80, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "No Hit", IP_KEY_NONE, IP_JOY_NONE )
   233: 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
   234: 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
   235: 	
   236: 	PORT_START	/* IN 1 */
   237: 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT    | IPF_8WAY )
   238: 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  | IPF_8WAY )
   239: 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
   240: 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
   241: 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
   242: 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
   243: 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   244: 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
   245: INPUT_PORTS_END
   246: 
   247: 
   248: static struct GfxLayout spritelayout =
   249: {
   250: 	16,16,	
   251: 	RGN_FRAC(1,3),		
   252: 	3,	    
   253: 	{ 0,RGN_FRAC(1,3), RGN_FRAC(2,3) },	
   254: 	{ 0, 1, 2, 3, 4, 5, 6, 7,
   255: 	  8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
   256: 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
   257: 	  16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
   258: 	32*8	
   259: };
   260: 
   261: static struct GfxLayout charlayout =
   262: {
   263: 	8,8,
   264: 	RGN_FRAC(1,2),
   265: 	4,
   266: 	{RGN_FRAC(1,2),RGN_FRAC(1,2)+4,0,4},
   267: 	{ STEP4(0,1), STEP4(8,1) },
   268: 	{ STEP8(0,8*2) },
   269: 	8*8*2
   270: };
   271: 
   272: static struct AY8910interface ay8910_interface =
   273: {
   274: 	2,      
   275: 	18432000/12,
   276: 	{ 50, 50 },
   277: 	{ soundlatch_r, soundlatch_r },
   278: 	{ soundlatch_r, soundlatch_r },
   279: 	{ 0, 0 },
   280: 	{ 0, 0 }
   281: };
   282: 
   283: static struct GfxDecodeInfo gfxdecodeinfo[] =
   284: {
   285: 	{ REGION_GFX3, 0, &charlayout,   64,2 },
   286: 	{ REGION_GFX2, 0, &charlayout,   32,2 },
   287: 	{ REGION_GFX1, 0, &spritelayout,   0, 4},
   288: 	{ -1 }
   289: };
   290: 
   291: static MACHINE_DRIVER_START( pitnrun )
   292: 	MDRV_CPU_ADD(Z80,8000000/2)		 /* ? MHz */
   293: 	MDRV_CPU_MEMORY(readmem,writemem)
   294: 	MDRV_CPU_VBLANK_INT(pitnrun_nmi_source,1)
   295: 
   296: 	MDRV_FRAMES_PER_SECOND(60)
   297: 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
   298: 	
   299: 	MDRV_CPU_ADD(Z80, 10000000/4)     /* 2.5 MHz */
   300: 
   301: 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	
   302: 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
   303: 	MDRV_CPU_PORTS(sound_readport,sound_writeport)
   304: 	MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
   305: 	
   306: 	MDRV_CPU_ADD(M68705,2000000)
   307: 	MDRV_CPU_MEMORY(mcu_readmem,mcu_writemem)
   308: 
   309: 	MDRV_MACHINE_INIT(pitnrun)
   310: 
   311: 	MDRV_INTERLEAVE(100)
   312: 
   313: 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
   314: 	MDRV_SCREEN_SIZE(256, 256)
   315: 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
   316: 
   317: 	MDRV_GFXDECODE(gfxdecodeinfo)
   318: 	MDRV_PALETTE_LENGTH(32*3)
   319: 	MDRV_PALETTE_INIT(pitnrun)
   320: 	MDRV_VIDEO_START(pitnrun)
   321: 	MDRV_VIDEO_UPDATE(pitnrun)
   322: 	MDRV_SOUND_ADD(AY8910, ay8910_interface)
   323: 
   324: MACHINE_DRIVER_END
   325: 
   326: 
   327: ROM_START( pitnrun )
   328: 	ROM_REGION( 0x010000, REGION_CPU1, 0 )
   329: 	ROM_LOAD( "pr12",  0x00000, 0x02000, CRC(587a7b85) SHA1(f200ff9b706e13760a23e0187c6bffe496af0087) )
   330: 	ROM_LOAD( "pr11",  0x02000, 0x02000, CRC(270cd6dd) SHA1(ad42562e18aa30319fc55c201e5507e8734a5b4d) )
   331: 	ROM_LOAD( "pr10",  0x04000, 0x02000, CRC(65d92d89) SHA1(4030ccdb4d84e69c256e95431ee5a18cffeae5c0) )
   332: 	ROM_LOAD( "pr9",   0x06000, 0x02000, CRC(3155286d) SHA1(45af8cb81d70f2e30b52bbc7abd9f8d15231735f) )
   333: 	
   334: 	ROM_REGION( 0x010000, REGION_CPU2, 0 )
   335: 	ROM_LOAD( "pr13",  0x00000, 0x01000, CRC(fc8fd05c) SHA1(f40cc9c6fff6bda8411f4d638a0f5c5915aa3746) )
   336: 
   337: 	ROM_REGION( 0x010000, REGION_CPU3, 0 )
   338: 	ROM_LOAD( "a11_17.3a",	0x0000, 0x800, CRC(e7d5d6e1) SHA1(c1131d6fcc36926e287be26090a3c89f22feaa35) )
   339: 	
   340: 	ROM_REGION( 0x06000, REGION_GFX1, 0 )
   341: 	ROM_LOAD( "pr1",  0x000000, 0x002000, CRC(c3b3131e) SHA1(ed0463e7eef452d7fbdcb031f9477825e9780943) )
   342: 	ROM_LOAD( "pr2",  0x002000, 0x002000, CRC(2fa1682a) SHA1(9daefb525fd69f0d9a45ff27e89865545e177a5a) )
   343: 	ROM_LOAD( "pr3",  0x004000, 0x002000, CRC(e678fe39) SHA1(134e36fd30bf3cf5884732f3455ca4d9dab6b665) )
   344: 	
   345: 	ROM_REGION( 0x4000, REGION_GFX2, 0 )
   346: 	ROM_LOAD( "pr4",  0x00000, 0x002000, CRC(fbae3504) SHA1(ce799dfd653462c0814e7530f3f8a686ab0ad7f4) )
   347: 	ROM_LOAD( "pr5",  0x02000, 0x002000, CRC(c9177180) SHA1(98c8f8f586b78b88dba254bd662642ee27f9b131) )
   348: 	
   349: 	ROM_REGION( 0x2000, REGION_GFX3, 0 )
   350: 	ROM_LOAD( "pr6",  0x00000, 0x001000, CRC(c53cb897) SHA1(81a73e6031b52fa45ec507ff4264b14474ef42a2) )
   351: 	ROM_LOAD( "pr7",  0x01000, 0x001000, CRC(7cdf9a55) SHA1(404dface7e09186e486945981e39063929599efc) )
   352: 	
   353: 	ROM_REGION( 0x2000, REGION_USER1, 0 ) 
   354: 	ROM_LOAD( "pr8",	0x0000, 0x2000, CRC(8e346d10) SHA1(1362ce4362c2d28c48fbd8a33da0cec5ef8e321f) )
   355: 
   356: 	ROM_REGION( 0x0060, REGION_PROMS, 0 )
   357: 	ROM_LOAD( "clr.1",  0x0000, 0x0020, CRC(643012f4) SHA1(4a0c9766b9da456e39ce379ad62d695bf82413b0) )
   358: 	ROM_LOAD( "clr.2",  0x0020, 0x0020, CRC(50705f02) SHA1(a3d348678fd66f37c7a0d29af88f40740918b8d3) )
   359: 	ROM_LOAD( "clr.3",  0x0040, 0x0020, CRC(25e70e5e) SHA1(fdb9c69e9568a725dd0e3ac25835270fb4f49280) )
   360: ROM_END
   361: 
   362: GAMEX( 1984, pitnrun, 0, pitnrun, pitnrun, 0, ROT90, "Taito Corporation", "Pit & Run", GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
   363: 
   364: 




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