/***************************************************************************

	Midway MCR-3 system

    driver by Christopher Kirmse, Aaron Giles

	Games supported:
		* Tapper
		* Timber
		* Discs of Tron (Squawk n' Talk)
		* Demolition Derby (Turbo Chip Squeak)
		* Demolition Derby (Monoboard version) (Turbo Chip Squeak)
		* Sarge (Turbo Chip Squeak)
		* Max RPM (Turbo Chip Squeak)
		* Rampage (Sounds Good)
		* Power Drive (Sounds Good)
		* Star Guards (Sounds Good)
		* Spy Hunter (Chip Squeak Deluxe)
		* Crater Raider
		* Turbo Tag (prototype) (Chip Squeak Deluxe)

	Known bugs:
		* Spy Hunter crashes at the end of the boat level
		* sprite placement on the scrolling games seems a bit off

****************************************************************************

	Memory map

****************************************************************************

	========================================================================
	CPU #1
	========================================================================
	0000-DFFF   R     xxxxxxxx    Program ROM
	E000-E7FF   R/W   xxxxxxxx    NVRAM
	E800-E9FF   R/W   xxxxxxxx    Sprite RAM
	F000-F7FF   R/W   xxxxxxxx    Background video RAM
	F800-F8FF     W   xxxxxxxx    Palette RAM
	========================================================================
	0000        R     x-xxxxxx    Input ports
	            R     x-------    Service switch (active low)
	            R     --x-----    Tilt
	            R     ---xxx--    External inputs
	            R     ------x-    Right coin
	            R     -------x    Left coin
	0000        W     xxxxxxxx    Data latch OP0 (coin meters, 2 led's and cocktail 'flip')
	0001        R     xxxxxxxx    External inputs
	0002        R     xxxxxxxx    External inputs
	0003        R     xxxxxxxx    DIP switches
	0004        R     xxxxxxxx    External inputs
	0004        W     xxxxxxxx    Data latch OP4 (comm. with external hardware)
	0007        R     xxxxxxxx    Audio status
	001C-001F   W     xxxxxxxx    Audio latches 1-4
	00E0        W     --------    Watchdog reset
	00E8        W     xxxxxxxx    Unknown (written at initialization time)
	00F0-00F3   W     xxxxxxxx    CTC communications
	========================================================================
	Interrupts:
		NMI ???
		INT generated by CTC
	========================================================================


	========================================================================
	CPU #2 (Super Sound I/O)
	========================================================================
	0000-3FFF   R     xxxxxxxx    Program ROM
	8000-83FF   R/W   xxxxxxxx    Program RAM
	9000-9003   R     xxxxxxxx    Audio latches 1-4
	A000          W   xxxxxxxx    AY-8910 #1 control
	A001        R     xxxxxxxx    AY-8910 #1 status
	A002          W   xxxxxxxx    AY-8910 #1 data
	B000          W   xxxxxxxx    AY-8910 #2 control
	B001        R     xxxxxxxx    AY-8910 #2 status
	B002          W   xxxxxxxx    AY-8910 #2 data
	C000          W   xxxxxxxx    Audio status
	E000          W   xxxxxxxx    Unknown
	F000        R     xxxxxxxx    Audio board switches
	========================================================================
	Interrupts:
		NMI ???
		INT generated by external circuitry 780 times/second
	========================================================================

***************************************************************************/


#include "driver.h"
#include "machine/z80fmly.h"
#include "sndhrdw/mcr.h"
#include "vidhrdw/generic.h"
#include "artwork.h"
#include "mcr.h"



/*************************************
 *
 *	Local variables and tables
 *
 *************************************/

static UINT8 input_mux;
static UINT8 maxrpm_last_shift;
static INT8 maxrpm_p1_shift;
static INT8 maxrpm_p2_shift;

/* Translation table for one-joystick emulation */
static const UINT8 one_joy_trans[16] =
{
	0x00,0x05,0x0A,0x00,0x06,0x04,0x08,0x00,
	0x09,0x01,0x02,0x00,0x00,0x00,0x00,0x00
};



/*************************************
 *
 *	Discs of Tron I/O ports
 *
 *************************************/

static READ_HANDLER( dotron_port_2_r )
{
	static char lastfake = 0;
	static int mask = 0x00FF;
	static int count = 0;
	static int delta = 0;
	int data;
	char fake;

	/* remap up and down on the mouse to aim up and down */
	data = input_port_2_r(offset);
	fake = input_port_6_r(offset);

	delta += (fake - lastfake);
	lastfake = fake;

	/* Map to "aim up" */
	if (delta > 5)
	{
		mask = 0x00EF;
		count = 5;
		delta = 0;
	}

	/* Map to "aim down" */
	else if (delta < -5)
	{
		mask = 0x00DF;
		count = 5;
		delta = 0;
	}

	if ((count--) <= 0)
	{
		count = 0;
		mask = 0x00FF;
	}

	data &= mask;

	return data;
}


static WRITE_HANDLER( dotron_port_4_w )
{
	/* light control is in the top 2 bits */
	set_led_status(0, data & 0x40);		/* background light */
	set_led_status(1, data & 0x80);		/* strobe */
	artwork_show("backdrop", (data >> 6) & 1);

	/* low 5 bits go to control the Squawk & Talk */
	squawkntalk_data_w(offset, data);
}



/*************************************
 *
 *	Demolition Derby I/O ports
 *
 *************************************/

static WRITE_HANDLER( demoderb_port_4_w )
{
	if (data & 0x40) input_mux = 1;
	if (data & 0x80) input_mux = 0;
	turbocs_data_w(offset, data);
}


static READ_HANDLER( demoderb_port12_r )
{
	return readinputport(input_mux ? (6 + offset) : (1 + offset));
}



/*************************************
 *
 *	Sarge I/O ports
 *
 *************************************/

static READ_HANDLER( sarge_port_1_r )
{
	return readinputport(1) & ~one_joy_trans[readinputport(6) & 0x0f];
}


static READ_HANDLER( sarge_port_2_r )
{
	return readinputport(2) & ~one_joy_trans[(readinputport(6) >> 4) & 0x0f];
}



/*************************************
 *
 *	Max RPM I/O ports
 *
 *************************************/

static WRITE_HANDLER( maxrpm_port_5_w )
{
	input_mux = (data >> 1) & 3;
	mcrmono_control_port_w(offset, data);
}


static READ_HANDLER( maxrpm_port_1_r )
{
	/* multiplexed steering wheel/gas pedal */
	return readinputport(6 + input_mux);
}


static READ_HANDLER( maxrpm_port_2_r )
{
	static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 };
	UINT8 start = readinputport(0);
	UINT8 shift = readinputport(10);

	/* reset on a start */
	if (!(start & 0x08))
		maxrpm_p1_shift = 0;
	if (!(start & 0x04))
		maxrpm_p2_shift = 0;

	/* increment, decrement on falling edge */
	if (!(shift & 0x01) && (maxrpm_last_shift & 0x01))
	{
		maxrpm_p1_shift++;
		if (maxrpm_p1_shift > 4)
			maxrpm_p1_shift = 4;
	}
	if (!(shift & 0x02) && (maxrpm_last_shift & 0x02))
	{
		maxrpm_p1_shift--;
		if (maxrpm_p1_shift < 0)
			maxrpm_p1_shift = 0;
	}
	if (!(shift & 0x04) && (maxrpm_last_shift & 0x04))
	{
		maxrpm_p2_shift++;
		if (maxrpm_p2_shift > 4)
			maxrpm_p2_shift = 4;
	}
	if (!(shift & 0x08) && (maxrpm_last_shift & 0x08))
	{
		maxrpm_p2_shift--;
		if (maxrpm_p2_shift < 0)
			maxrpm_p2_shift = 0;
	}

	maxrpm_last_shift = shift;

	return ~((shift_bits[maxrpm_p1_shift] << 4) + shift_bits[maxrpm_p2_shift]);
}



/*************************************
 *
 *	Power Drive I/O ports
 *
 *************************************/

static READ_HANDLER( powerdrv_port_2_r )
{
	int result = readinputport(2) & 0x7f;
	return result | (input_mux & 0x80);
}


static WRITE_HANDLER( powerdrv_port_5_w )
{
	/* bit 1 controls led 0 */
	/* bit 2 controls led 1 */
	/* bit 3 controls led 2 */
	set_led_status(0, (data >> 1) & 1);
	set_led_status(1, (data >> 2) & 1);
	set_led_status(2, (data >> 3) & 1);
	mcrmono_control_port_w(offset, data);
}


static WRITE_HANDLER( powerdrv_port_7_w )
{
	/* use input_mux for scratch */
	input_mux = ~input_mux & 0x80;
}



/*************************************
 *
 *	Star Guards I/O ports
 *
 *************************************/

static READ_HANDLER( stargrds_port_0_r )
{
	int result = readinputport(input_mux ? 6 : 0);

	/* kludge for now: Star Guards will fail the self-test if bit 0x10 doesn't */
	/* toggle properly */
	static int temp = 0;
	result ^= temp ^= 0x10;
	return result;
}


static WRITE_HANDLER( stargrds_port_5_w )
{
	/* bit 1 controls input muxing on port 0 */
	/* bit 2 controls led 0 */
	/* bit 3 controls led 1 */
	/* bit 4 controls led 2 */
	input_mux = (data >> 1) & 1;
	set_led_status(0, (data >> 2) & 1);
	set_led_status(1, (data >> 3) & 1);
	set_led_status(2, (data >> 4) & 1);
	mcrmono_control_port_w(offset, data);
}


static WRITE_HANDLER( stargrds_soundsgood_data_w )
{
	soundsgood_data_w(offset, (data << 1) | (data >> 7));
}



/*************************************
 *
 *	Spy Hunter I/O ports
 *
 *************************************/

static READ_HANDLER( spyhunt_port_2_r )
{
	/* multiplexed steering wheel/gas pedal */
	return readinputport(6 + input_mux);
}


static WRITE_HANDLER( spyhunt_port_4_w )
{
	static UINT8 lastport4;

	/* Spy Hunter uses port 4 for talking to the Chip Squeak Deluxe */
	/* (and for toggling the lamps and muxing the analog inputs) */

	/* mux select is in bit 7 */
	input_mux = (data >> 7) & 1;

	/* lamp driver command triggered by bit 5, data is in low four bits */
	if (((lastport4 ^ data) & 0x20) && !(data & 0x20))
	{
		static const char *lampname[8] = 
		{
			"lamp0", "lamp1", "lamp2", "lamp3", 
			"lamp4", "lamp5", "lamp6", "lamp7"
		};
		artwork_show(lampname[data & 7], (data >> 3) & 1);
	}

	/* low 5 bits go to control the Chip Squeak Deluxe */
	csdeluxe_data_w(offset, data);

	/* remember the last data */
	lastport4 = data;
}



/*************************************
 *
 *	Turbo Tag kludges
 *
 *************************************/

static READ_HANDLER( turbotag_kludge_r )
{
	/* The checksum on the ttprog1.bin ROM seems to be bad by 1 bit */
	/* The checksum should come out to $82 but it should be $92     */
	/* Unfortunately, the game refuses to start if any bad ROM is   */
	/* found; to work around this, we catch the checksum byte read  */
	/* and modify it to what we know we will be getting.            */
	if (activecpu_get_previouspc() == 0xb29)
		return 0x82;
	else
		return 0x92;
}



/*************************************
 *
 *	NVRAM save/load
 *
 *************************************/

static NVRAM_HANDLER( mcr3 )
{
	if (read_or_write)
		osd_fwrite(file, videoram, videoram_size);
	else if (file)
		osd_fread(file, videoram, videoram_size);
	else
		memset(videoram, 0, videoram_size);
}



/*************************************
 *
 *	Main CPU memory handlers
 *
 *************************************/

static MEMORY_READ_START( readmem )
	{ 0x0000, 0xdfff, MRA_ROM },
	{ 0xe000, 0xe9ff, MRA_RAM },
	{ 0xf000, 0xf7ff, MRA_RAM },
MEMORY_END


static MEMORY_WRITE_START( writemem )
	{ 0x0000, 0xdfff, MWA_ROM },
	{ 0xe000, 0xe7ff, MWA_RAM },
	{ 0xe800, 0xe9ff, MWA_RAM, &spriteram, &spriteram_size },
	{ 0xf000, 0xf7ff, mcr3_videoram_w, &videoram, &videoram_size },
	{ 0xf800, 0xf8ff, mcr3_paletteram_w, &paletteram },
MEMORY_END


static PORT_READ_START( readport )
	{ 0x00, 0x00, input_port_0_r },
	{ 0x01, 0x01, input_port_1_r },
	{ 0x02, 0x02, input_port_2_r },
	{ 0x03, 0x03, input_port_3_r },
	{ 0x04, 0x04, input_port_4_r },
	{ 0x07, 0x07, ssio_status_r },
	{ 0x10, 0x10, input_port_0_r },
	{ 0xf0, 0xf3, z80ctc_0_r },
PORT_END


static PORT_WRITE_START( writeport )
	{ 0x00, 0x00, mcr_control_port_w },
	{ 0x1c, 0x1f, ssio_data_w },
	{ 0x84, 0x86, mcr_scroll_value_w },
	{ 0xe0, 0xe0, watchdog_reset_w },
	{ 0xe8, 0xe8, MWA_NOP },
	{ 0xf0, 0xf3, z80ctc_0_w },
PORT_END



/*************************************
 *
 *	MCR Monoboard CPU memory handlers
 *
 *************************************/

static MEMORY_WRITE_START( mcrmono_writemem )
	{ 0x0000, 0xdfff, MWA_ROM },
	{ 0xe000, 0xe7ff, MWA_RAM },
	{ 0xe800, 0xe9ff, MWA_RAM, &spriteram, &spriteram_size },
	{ 0xec00, 0xecff, mcr3_paletteram_w, &paletteram },
	{ 0xf000, 0xf7ff, mcr3_videoram_w, &videoram, &videoram_size },
MEMORY_END


static PORT_WRITE_START( mcrmono_writeport )
	{ 0x05, 0x05, mcrmono_control_port_w },
	{ 0x07, 0x07, watchdog_reset_w },
	{ 0xf0, 0xf3, z80ctc_0_w },
PORT_END



/*************************************
 *
 *	Spy Hunter main CPU memory handlers
 *
 *************************************/

static MEMORY_READ_START( spyhunt_readmem )
	{ 0x0000, 0xdfff, MRA_ROM },
	{ 0xe000, 0xebff, MRA_RAM },
	{ 0xf000, 0xffff, MRA_RAM },
MEMORY_END


static MEMORY_WRITE_START( spyhunt_writemem )
	{ 0x0000, 0xdfff, MWA_ROM },
	{ 0xe000, 0xe7ff, spyhunt_videoram_w, &videoram, &videoram_size },
	{ 0xe800, 0xebff, spyhunt_alpharam_w, &spyhunt_alpharam },
	{ 0xf000, 0xf7ff, MWA_RAM },
	{ 0xf800, 0xf9ff, MWA_RAM, &spriteram, &spriteram_size },
	{ 0xfa00, 0xfaff, mcr3_paletteram_w, &paletteram },
MEMORY_END



/*************************************
 *
 *	Port definitions
 *
 *************************************/

INPUT_PORTS_START( tapper )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches */
	PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
	PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
	PORT_DIPNAME( 0x80, 0x80, "Coin Meters" )
	PORT_DIPSETTING(    0x80, "1" )
	PORT_DIPSETTING(    0x00, "2" )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( timber )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches */
	PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
	PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
	PORT_DIPNAME( 0x80, 0x80, "Coin Meters" )
	PORT_DIPSETTING(    0x80, "1" )
	PORT_DIPSETTING(    0x00, "2" )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( dotron )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_ANALOGX( 0xff, 0x00, IPT_DIAL | IPF_REVERSE, 50, 10, 0, 0, KEYCODE_Z, KEYCODE_X, 0, 0 )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
	PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON3, "Aim Down", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON4, "Aim Up", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
	/* we default to Environmental otherwise speech is disabled */
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
	PORT_DIPSETTING(    0x00, "Environmental" )
	PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x01, 0x01, "Coin Meters" )
	PORT_DIPSETTING(    0x01, "1" )
	PORT_DIPSETTING(    0x00, "2" )
	PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* fake port to make aiming up & down easier */
	PORT_ANALOG( 0xff, 0x00, IPT_TRACKBALL_Y, 100, 10, 0, 0 )
INPUT_PORTS_END


INPUT_PORTS_START( demoderb )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN1 -- the high 6 bits contain the steering wheel value */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_ANALOG( 0xfc, 0x00, IPT_DIAL | IPF_REVERSE | IPF_PLAYER1, 50, 10, 0, 0 )

	PORT_START	/* IN2 -- the high 6 bits contain the steering wheel value */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
	PORT_ANALOG( 0xfc, 0x00, IPT_DIAL | IPF_REVERSE | IPF_PLAYER2, 50, 10, 0, 0 )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
	PORT_DIPSETTING(    0x01, "2P Upright" )
	PORT_DIPSETTING(    0x00, "4P Cocktail" )
	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Difficulty ) )
	PORT_DIPSETTING(    0x02, "Normal" )
	PORT_DIPSETTING(    0x00, "Harder" )
	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )
	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_DIPNAME( 0x08, 0x08, "Reward Screen" )
	PORT_DIPSETTING(    0x08, "Expanded" )
	PORT_DIPSETTING(    0x00, "Limited" )
	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
	PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN4 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4 )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN1 (muxed) -- the high 6 bits contain the steering wheel value */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_ANALOG( 0xfc, 0x00, IPT_DIAL | IPF_REVERSE | IPF_PLAYER3, 50, 10, 0, 0 )

	PORT_START	/* IN2 (muxed) -- the high 6 bits contain the steering wheel value */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
	PORT_ANALOG( 0xfc, 0x00, IPT_DIAL | IPF_REVERSE | IPF_PLAYER4, 50, 10, 0, 0 )
INPUT_PORTS_END


INPUT_PORTS_START( sarge )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_2WAY | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_2WAY | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP   | IPF_2WAY | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN | IPF_2WAY | IPF_PLAYER1 )
	PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_2WAY | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_2WAY | IPF_PLAYER2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP   | IPF_2WAY | IPF_PLAYER2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN | IPF_2WAY | IPF_PLAYER2 )
	PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) )
	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
	PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
/* 0x00 says 2 Coins/2 Credits in service mode, but gives 1 Coin/1 Credit */
	PORT_BIT( 0xc7, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* fake port for single joystick control */
	/* This fake port is handled via sarge_port_1_r and sarge_port_2_r */
	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_CHEAT | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_CHEAT | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_CHEAT | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_CHEAT | IPF_PLAYER1 )
	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_CHEAT | IPF_PLAYER2 )
	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_CHEAT | IPF_PLAYER2 )
	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_CHEAT | IPF_PLAYER2 )
	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_CHEAT | IPF_PLAYER2 )
INPUT_PORTS_END


INPUT_PORTS_START( maxrpm )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN2 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) )
	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
	PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
/* 0x00 says 2 Coins/2 Credits in service mode, but gives 1 Coin/1 Credit */
	PORT_BIT( 0xc7, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* new fake for acceleration */
	PORT_ANALOG( 0xff, 0x30, IPT_PEDAL | IPF_REVERSE | IPF_PLAYER2, 100, 10, 0x30, 0xff )

	PORT_START	/* new fake for acceleration */
	PORT_ANALOG( 0xff, 0x30, IPT_PEDAL | IPF_REVERSE | IPF_PLAYER1, 100, 10, 0x30, 0xff )

	PORT_START	/* new fake for steering */
	PORT_ANALOG( 0xff, 0x74, IPT_PADDLE | IPF_PLAYER2 | IPF_REVERSE, 40, 10, 0x34, 0xb4 )

	PORT_START	/* new fake for steering */
	PORT_ANALOG( 0xff, 0x74, IPT_PADDLE | IPF_PLAYER1 | IPF_REVERSE, 40, 10, 0x34, 0xb4 )

	PORT_START	/* fake for shifting */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
	PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( rampage )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
	PORT_DIPSETTING(    0x02, "Easy" )
	PORT_DIPSETTING(    0x03, "Normal" )
	PORT_DIPSETTING(    0x01, "Hard" )
	PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
	PORT_DIPNAME( 0x04, 0x04, "Score Option" )
	PORT_DIPSETTING(    0x04, "Keep score when continuing" )
	PORT_DIPSETTING(    0x00, "Lose score when continuing" )
	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coin_A ) )
	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
	PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coin_B ) )
	PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
	PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
	PORT_DIPSETTING(    0x50, DEF_STR( 1C_3C ) )
	PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )
	PORT_DIPSETTING(    0x30, DEF_STR( 1C_5C ) )
	PORT_DIPSETTING(    0x20, DEF_STR( 1C_6C ) )
	PORT_BITX( 0x80,    0x80, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Advance", KEYCODE_F1, IP_JOY_NONE )
	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )

	PORT_START	/* IN4 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_PLAYER3 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_PLAYER3 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_PLAYER3 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_PLAYER3 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( powerdrv )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
	PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER1 | IPF_TOGGLE )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER2 | IPF_TOGGLE )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER3 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER3 | IPF_TOGGLE )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
	PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches */
	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
/*	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )*/
	PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
	PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
	PORT_DIPSETTING(    0x20, "Easy" )
	PORT_DIPSETTING(    0x30, "Factory" )
	PORT_DIPSETTING(    0x10, "Hard" )
	PORT_DIPSETTING(    0x00, "Hardest" )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_BITX( 0x80,    0x80, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Advance", KEYCODE_F1, IP_JOY_NONE )
	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( stargrds )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL )	/* status from sounds good */
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_PLAYER1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_PLAYER1 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_PLAYER1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_PLAYER1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_PLAYER1 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_PLAYER1 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_PLAYER1 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_PLAYER1 )

	PORT_START	/* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_PLAYER2 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_PLAYER2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_PLAYER2 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_PLAYER2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_PLAYER2 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_PLAYER2 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_PLAYER2 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_PLAYER2 )

	PORT_START	/* IN3 -- dipswitches */
	PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x0c, 0x0c, "Energy Units" )
	PORT_DIPSETTING(    0x08, "8" )
	PORT_DIPSETTING(    0x0c, "10" )
	PORT_DIPSETTING(    0x04, "12" )
	PORT_DIPSETTING(    0x00, "14" )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
	PORT_DIPSETTING(    0x80, "Easy" )
	PORT_DIPSETTING(    0xc0, "Medium" )
	PORT_DIPSETTING(    0x40, "Hard" )
	PORT_DIPSETTING(    0x00, "Hardest" )

	PORT_START	/* IN4 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_PLAYER3 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_PLAYER3 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_PLAYER3 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_PLAYER3 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP     | IPF_PLAYER3 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN   | IPF_PLAYER3 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT   | IPF_PLAYER3 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT  | IPF_PLAYER3 )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )

	PORT_START	/* IN0 (muxed) */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL )	/* status from sounds good */
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
INPUT_PORTS_END


INPUT_PORTS_START( spyhunt )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_TOGGLE, "Gear Shift", KEYCODE_ENTER, IP_JOY_DEFAULT )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 -- various buttons, low 5 bits */
	PORT_BITX( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4, "Oil Slick", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5, "Missiles", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3, "Weapon Truck", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BITX( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2, "Smoke Screen", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1, "Machine Guns", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BIT(  0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )

	PORT_START	/* IN2 -- actually not used at all, but read as a trakport */
	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches -- low 4 bits only */
	PORT_DIPNAME( 0x01, 0x01, "Game Timer" )
	PORT_DIPSETTING(    0x00, "1:00" )
	PORT_DIPSETTING(    0x01, "1:30" )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* new fake for acceleration */
	PORT_ANALOG( 0xff, 0x30, IPT_PEDAL, 100, 10, 0x30, 0xff )

	PORT_START	/* new fake for steering */
	PORT_ANALOG( 0xff, 0x74, IPT_PADDLE, 40, 10, 0x34, 0xb4 )
INPUT_PORTS_END


INPUT_PORTS_START( crater )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 */
	PORT_ANALOGX( 0xff, 0x00, IPT_DIAL | IPF_REVERSE, 25, 10, 0, 0, KEYCODE_Z, KEYCODE_X, 0, 0 )

	PORT_START	/* IN2 */
	PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_2WAY )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_2WAY )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END


INPUT_PORTS_START( turbotag )
	PORT_START	/* IN0 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
	PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON6 | IPF_TOGGLE, "Gear Shift", KEYCODE_ENTER, IP_JOY_DEFAULT )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE )
	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )

	PORT_START	/* IN1 -- various buttons, low 5 bits */
	PORT_BITX( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4, "Left Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BITX( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5, "Left Trigger", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3, "Center Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2, "Right Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BITX( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1, "Right Trigger", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
	PORT_BIT(  0xe0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN2 -- actually not used at all, but read as a trakport */
	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )

	PORT_START	/* IN3 -- dipswitches -- low 4 bits only */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* IN4 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

	PORT_START	/* AIN0 */
	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )

	PORT_START	/* new fake for acceleration */
	PORT_ANALOG( 0xff, 0x30, IPT_PEDAL, 100, 10, 0x30, 0xc0 )

	PORT_START	/* new fake for steering */
	PORT_ANALOG( 0xff, 0x74, IPT_PADDLE, 40, 10, 0x34, 0xb4 )
INPUT_PORTS_END



/*************************************
 *
 *	Graphics definitions
 *
 *************************************/

static struct GfxLayout spyhunt_charlayout =
{
	64,32,
	RGN_FRAC(1,2),
	4,
	{ RGN_FRAC(1,2), RGN_FRAC(1,2)+1, 0, 1 },
	{  0,  0,  2,  2,  4,  4,  6,  6,  8,  8, 10, 10, 12, 12, 14, 14,
	  16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30,
	  32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 46,
	  48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62 },
	{ 0*32,  0*32,  2*32,  2*32,  4*32,  4*32,  6*32,  6*32,
	  8*32,  8*32, 10*32, 10*32, 12*32, 12*32, 14*32, 14*32,
	 16*32, 16*32, 18*32, 18*32, 20*32, 20*32, 22*32, 22*32,
	 24*32, 24*32, 26*32, 26*32, 28*32, 28*32, 30*32, 30*32 },
	128*8
};


static struct GfxLayout spyhunt_alphalayout =
{
	16,16,
	RGN_FRAC(1,1),
	2,
	{ 0, 1 },
	{ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14 },
	{ 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 },
	16*8
};


static struct GfxDecodeInfo gfxdecodeinfo[] =
{
	{ REGION_GFX1, 0, &mcr_bg_layout,     0, 4 },
	{ REGION_GFX2, 0, &mcr_sprite_layout, 0, 4 },
	{ -1 } /* end of array */
};


static struct GfxDecodeInfo spyhunt_gfxdecodeinfo[] =
{
	{ REGION_GFX1, 0, &spyhunt_charlayout,  1*16, 1 },
	{ REGION_GFX2, 0, &mcr_sprite_layout,   0*16, 4 },
	{ REGION_GFX3, 0, &spyhunt_alphalayout, 4*16, 1 },
	{ -1 } /* end of array */
};



/*************************************
 *
 *	Machine drivers
 *
 *************************************/

/* Core MCR3 system with no sound */
static MACHINE_DRIVER_START( mcr3 )

	/* basic machine hardware */
	MDRV_CPU_ADD_TAG("main", Z80, 5000000)
	MDRV_CPU_CONFIG(mcr_daisy_chain)
	MDRV_CPU_MEMORY(readmem,writemem)
	MDRV_CPU_PORTS(readport,writeport)
	MDRV_CPU_VBLANK_INT(mcr_interrupt,2)

	MDRV_FRAMES_PER_SECOND(30)
	MDRV_VBLANK_DURATION(DEFAULT_REAL_30HZ_VBLANK_DURATION)
	MDRV_MACHINE_INIT(mcr)
	MDRV_NVRAM_HANDLER(mcr3)

	/* video hardware */
	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
	MDRV_SCREEN_SIZE(32*16, 30*16)
	MDRV_VISIBLE_AREA(0*16, 32*16-1, 0*16, 30*16-1)
	MDRV_GFXDECODE(gfxdecodeinfo)
	MDRV_PALETTE_LENGTH(64)
	
	MDRV_VIDEO_START(mcr3)
	MDRV_VIDEO_UPDATE(mcr3)
MACHINE_DRIVER_END


/* General MCR3 system with SSIO */
static MACHINE_DRIVER_START( mcr3_ssio )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcr3)
	MDRV_IMPORT_FROM(mcr_ssio)
MACHINE_DRIVER_END


/* Discs of Tron = General MCR3 with Squawk & Talk */
static MACHINE_DRIVER_START( dotron )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcr3_ssio)
	MDRV_IMPORT_FROM(squawk_n_talk)
MACHINE_DRIVER_END


/* Demolition Derby = General MCR3 with Turbo Chip Squeak instead of SSIO */
static MACHINE_DRIVER_START( demoderb )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcr3)
	MDRV_IMPORT_FROM(turbo_chip_squeak)
MACHINE_DRIVER_END


/*************************************/


/* Core MCR monoboard system with no sound */
static MACHINE_DRIVER_START( mcrmono )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcr3)

	MDRV_CPU_MODIFY("main")
	MDRV_CPU_MEMORY(readmem,mcrmono_writemem)
	MDRV_CPU_PORTS(readport,mcrmono_writeport)
	
	/* video hardware */
	MDRV_VIDEO_START(mcrmono)
MACHINE_DRIVER_END


/* Sarge/Demolition Derby Mono/Max RPM = MCR monoboardmonoboard = MCR3 with no SSIO */
/* in this case, Turbo Chip Squeak is used for sound */
static MACHINE_DRIVER_START( mono_tcs )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcrmono)
	MDRV_IMPORT_FROM(turbo_chip_squeak)
MACHINE_DRIVER_END


/* Rampage/Power Drive/Star Guards = MCR monoboard with Sounds Good */
static MACHINE_DRIVER_START( mono_sg )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcrmono)
	MDRV_IMPORT_FROM(sounds_good)
MACHINE_DRIVER_END


/*************************************/


/* Core scrolling system with no sound */
static MACHINE_DRIVER_START( mcrscroll )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcr3)

	MDRV_CPU_MODIFY("main")
	MDRV_CPU_MEMORY(spyhunt_readmem,spyhunt_writemem)

	/* video hardware */
	MDRV_SCREEN_SIZE(30*16, 30*16)
	MDRV_VISIBLE_AREA(0, 30*16-1, 0, 30*16-1)
	MDRV_GFXDECODE(spyhunt_gfxdecodeinfo)
	MDRV_PALETTE_LENGTH(64+4)

	MDRV_PALETTE_INIT(spyhunt)
	MDRV_VIDEO_START(spyhunt)
	MDRV_VIDEO_UPDATE(spyhunt)
MACHINE_DRIVER_END


/* Spy Hunter = scrolling system with an SSIO and a chip squeak deluxe */
static MACHINE_DRIVER_START( spyhunt )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcrscroll)
	MDRV_IMPORT_FROM(mcr_ssio)
	MDRV_IMPORT_FROM(chip_squeak_deluxe)
MACHINE_DRIVER_END


/* Crater Raider = scrolling system with SSIO only */
static MACHINE_DRIVER_START( crater )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcrscroll)
	MDRV_IMPORT_FROM(mcr_ssio)
MACHINE_DRIVER_END


/* Turbo Tag = scrolling system with CSD only */
static MACHINE_DRIVER_START( turbotag )

	/* basic machine hardware */
	MDRV_IMPORT_FROM(mcrscroll)
	MDRV_IMPORT_FROM(chip_squeak_deluxe)
MACHINE_DRIVER_END



/*************************************
 *
 *	ROM definitions
 *
 *************************************/

ROM_START( tapper )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "tappg0.bin",   0x00000, 0x4000, 0x127171d1 )
	ROM_LOAD( "tappg1.bin",   0x04000, 0x4000, 0x9d6a47f7 )
	ROM_LOAD( "tappg2.bin",   0x08000, 0x4000, 0x3a1f8778 )
	ROM_LOAD( "tappg3.bin",   0x0c000, 0x2000, 0xe8dcdaa4 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "tapsnda7.bin", 0x0000, 0x1000, 0x0e8bb9d5 )
	ROM_LOAD( "tapsnda8.bin", 0x1000, 0x1000, 0x0cf0e29b )
	ROM_LOAD( "tapsnda9.bin", 0x2000, 0x1000, 0x31eb6dc6 )
	ROM_LOAD( "tapsda10.bin", 0x3000, 0x1000, 0x01a9be6a )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "tapbg1.bin",   0x00000, 0x4000, 0x2a30238c )
	ROM_LOAD( "tapbg0.bin",   0x04000, 0x4000, 0x394ab576 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "tapfg1.bin",   0x00000, 0x4000, 0x32509011 )
	ROM_LOAD( "tapfg0.bin",   0x04000, 0x4000, 0x8412c808 )
	ROM_LOAD( "tapfg3.bin",   0x08000, 0x4000, 0x818fffd4 )
	ROM_LOAD( "tapfg2.bin",   0x0c000, 0x4000, 0x67e37690 )
	ROM_LOAD( "tapfg5.bin",   0x10000, 0x4000, 0x800f7c8a )
	ROM_LOAD( "tapfg4.bin",   0x14000, 0x4000, 0x32674ee6 )
	ROM_LOAD( "tapfg7.bin",   0x18000, 0x4000, 0x070b4c81 )
	ROM_LOAD( "tapfg6.bin",   0x1c000, 0x4000, 0xa37aef36 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "5784",         0x0000, 0x0020, 0xe1281ee9 )
ROM_END


ROM_START( tappera )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pr00_1c.128",   0x00000, 0x4000, 0xbb060bb0 )
	ROM_LOAD( "pr01_2c.128",   0x04000, 0x4000, 0xfd9acc22 )
	ROM_LOAD( "pr02_3c.128",   0x08000, 0x4000, 0xb3755d41 )
	ROM_LOAD( "pr03_4c.64",    0x0c000, 0x2000, 0x77273096 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "tapsnda7.bin", 0x0000, 0x1000, 0x0e8bb9d5 )
	ROM_LOAD( "tapsnda8.bin", 0x1000, 0x1000, 0x0cf0e29b )
	ROM_LOAD( "tapsnda9.bin", 0x2000, 0x1000, 0x31eb6dc6 )
	ROM_LOAD( "tapsda10.bin", 0x3000, 0x1000, 0x01a9be6a )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "tapbg1.bin",   0x00000, 0x4000, 0x2a30238c )
	ROM_LOAD( "tapbg0.bin",   0x04000, 0x4000, 0x394ab576 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "fg1_a7.128",   0x00000, 0x4000, 0xbac70b69 )
	ROM_LOAD( "fg0_a8.128",   0x04000, 0x4000, 0xc300925d )
	ROM_LOAD( "fg3_a5.128",   0x08000, 0x4000, 0xecff6c23 )
	ROM_LOAD( "fg2_a6.128",   0x0c000, 0x4000, 0xa4f2d1be )
	ROM_LOAD( "fg5_a3.128",   0x10000, 0x4000, 0x16ce38cb )
	ROM_LOAD( "fg4_a4.128",   0x14000, 0x4000, 0x082a4059 )
	ROM_LOAD( "fg7_a1.128",   0x18000, 0x4000, 0x3b476abe )
	ROM_LOAD( "fg6_a2.128",   0x1c000, 0x4000, 0x6717264c )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "5784",         0x0000, 0x0020, 0xe1281ee9 )
ROM_END


ROM_START( sutapper )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "5791",         0x0000, 0x4000, 0x87119cc4 )
	ROM_LOAD( "5792",         0x4000, 0x4000, 0x4c23ad89 )
	ROM_LOAD( "5793",         0x8000, 0x4000, 0xfecbf683 )
	ROM_LOAD( "5794",         0xc000, 0x2000, 0x5bdc1916 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "5788",         0x00000, 0x1000, 0x5c1d0982 )
	ROM_LOAD( "5787",         0x01000, 0x1000, 0x09e74ed8 )
	ROM_LOAD( "5786",         0x02000, 0x1000, 0xc3e98284 )
	ROM_LOAD( "5785",         0x03000, 0x1000, 0xced2fd47 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "5790",         0x00000, 0x4000, 0xac1558c1 )
	ROM_LOAD( "5789",         0x04000, 0x4000, 0xfa66cab5 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "5795",         0x00000, 0x4000, 0x5d987c92 )
	ROM_LOAD( "5796",         0x04000, 0x4000, 0xde5700b4 )
	ROM_LOAD( "5797",         0x08000, 0x4000, 0xf10a1d05 )
	ROM_LOAD( "5798",         0x0c000, 0x4000, 0x614990cd )
	ROM_LOAD( "5799",         0x10000, 0x4000, 0x02c69432 )
	ROM_LOAD( "5800",         0x14000, 0x4000, 0xebf1f948 )
	ROM_LOAD( "5801",         0x18000, 0x4000, 0xd70defa7 )
	ROM_LOAD( "5802",         0x1c000, 0x4000, 0xd4f114b9 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "5784",         0x0000, 0x0020, 0xe1281ee9 )
ROM_END


ROM_START( rbtapper )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "rbtpg0.bin",   0x00000, 0x4000, 0x20b9adf4 )
	ROM_LOAD( "rbtpg1.bin",   0x04000, 0x4000, 0x87e616c2 )
	ROM_LOAD( "rbtpg2.bin",   0x08000, 0x4000, 0x0b332c97 )
	ROM_LOAD( "rbtpg3.bin",   0x0c000, 0x2000, 0x698c06f2 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "5788",         0x00000, 0x1000, 0x5c1d0982 )
	ROM_LOAD( "5787",         0x01000, 0x1000, 0x09e74ed8 )
	ROM_LOAD( "5786",         0x02000, 0x1000, 0xc3e98284 )
	ROM_LOAD( "5785",         0x03000, 0x1000, 0xced2fd47 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "rbtbg1.bin",   0x00000, 0x4000, 0x44dfa483 )
	ROM_LOAD( "rbtbg0.bin",   0x04000, 0x4000, 0x510b13de )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "rbtfg1.bin",   0x00000, 0x4000, 0x1c0b8791 )
	ROM_LOAD( "rbtfg0.bin",   0x04000, 0x4000, 0xe99f6018 )
	ROM_LOAD( "rbtfg3.bin",   0x08000, 0x4000, 0x3e725e77 )
	ROM_LOAD( "rbtfg2.bin",   0x0c000, 0x4000, 0x4ee8b624 )
	ROM_LOAD( "rbtfg5.bin",   0x10000, 0x4000, 0x9eeca46e )
	ROM_LOAD( "rbtfg4.bin",   0x14000, 0x4000, 0x8c79e7d7 )
	ROM_LOAD( "rbtfg7.bin",   0x18000, 0x4000, 0x8dbf0c36 )
	ROM_LOAD( "rbtfg6.bin",   0x1c000, 0x4000, 0x441201a0 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "5784",         0x0000, 0x0020, 0xe1281ee9 )
ROM_END


ROM_START( timber )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "timpg0.bin",   0x00000, 0x4000, 0x377032ab )
	ROM_LOAD( "timpg1.bin",   0x04000, 0x4000, 0xfd772836 )
	ROM_LOAD( "timpg2.bin",   0x08000, 0x4000, 0x632989f9 )
	ROM_LOAD( "timpg3.bin",   0x0c000, 0x2000, 0xdae8a0dc )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "tima7.bin",    0x00000, 0x1000, 0xc615dc3e )
	ROM_LOAD( "tima8.bin",    0x01000, 0x1000, 0x83841c87 )
	ROM_LOAD( "tima9.bin",    0x02000, 0x1000, 0x22bcdcd3 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "timbg1.bin",   0x00000, 0x4000, 0xb1cb2651 )
	ROM_LOAD( "timbg0.bin",   0x04000, 0x4000, 0x2ae352c4 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "timfg1.bin",   0x00000, 0x4000, 0x81de4a73 )
	ROM_LOAD( "timfg0.bin",   0x04000, 0x4000, 0x7f3a4f59 )
	ROM_LOAD( "timfg3.bin",   0x08000, 0x4000, 0x37c03272 )
	ROM_LOAD( "timfg2.bin",   0x0c000, 0x4000, 0xe2c2885c )
	ROM_LOAD( "timfg5.bin",   0x10000, 0x4000, 0xeb636216 )
	ROM_LOAD( "timfg4.bin",   0x14000, 0x4000, 0xb7105eb7 )
	ROM_LOAD( "timfg7.bin",   0x18000, 0x4000, 0xd9c27475 )
	ROM_LOAD( "timfg6.bin",   0x1c000, 0x4000, 0x244778e8 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( dotron )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "loc-pg0.1c",   0x0000, 0x4000, 0xba0da15f )
	ROM_LOAD( "loc-pg1.2c",   0x4000, 0x4000, 0xdc300191 )
	ROM_LOAD( "loc-pg2.3c",   0x8000, 0x4000, 0xab0b3800 )
	ROM_LOAD( "loc-pg1.4c",   0xc000, 0x2000, 0xf98c9f8e )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "sound0.a7",    0x00000, 0x1000, 0x6d39bf19 )
	ROM_LOAD( "sound1.a8",    0x01000, 0x1000, 0xac872e1d )
	ROM_LOAD( "sound2.a9",    0x02000, 0x1000, 0xe8ef6519 )
	ROM_LOAD( "sound3.a10",   0x03000, 0x1000, 0x6b5aeb02 )

	ROM_REGION( 0x10000, REGION_CPU3, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "pre.u3",       0x0d000, 0x1000, 0xc3d0f762 )
	ROM_LOAD( "pre.u4",       0x0e000, 0x1000, 0x7ca79b43 )
	ROM_LOAD( "pre.u5",       0x0f000, 0x1000, 0x24e9618e )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-bg2.6f",   0x00000, 0x2000, 0x40167124 )
	ROM_LOAD( "loc-bg1.5f",   0x02000, 0x2000, 0xbb2d7a5d )

	ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-g.cp4",    0x00000, 0x2000, 0x57a2b1ff )
	ROM_LOAD( "loc-h.cp3",    0x02000, 0x2000, 0x3bb4d475 )
	ROM_LOAD( "loc-e.cp6",    0x04000, 0x2000, 0xce957f1a )
	ROM_LOAD( "loc-f.cp5",    0x06000, 0x2000, 0xd26053ce )
	ROM_LOAD( "loc-c.cp8",    0x08000, 0x2000, 0xef45d146 )
	ROM_LOAD( "loc-d.cp7",    0x0a000, 0x2000, 0x5e8a3ef3 )
	ROM_LOAD( "loc-a.cp0",    0x0c000, 0x2000, 0xb35f5374 )
	ROM_LOAD( "loc-b.cp9",    0x0e000, 0x2000, 0x565a5c48 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( dotrona )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "aloc-pg0.1c",  0x0000, 0x4000, 0x40d00195 )
	ROM_LOAD( "aloc-pg1.2c",  0x4000, 0x4000, 0x5a7d1300 )
	ROM_LOAD( "aloc-pg2.3c",  0x8000, 0x4000, 0xcb89c9be )
	ROM_LOAD( "aloc-pg1.4c",  0xc000, 0x2000, 0x5098faf4 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "asound0.a7",   0x00000, 0x1000, 0x7fb54293 )
	ROM_LOAD( "asound1.a8",   0x01000, 0x1000, 0xedef7326 )
	ROM_LOAD( "sound2.a9",    0x02000, 0x1000, 0xe8ef6519 )
	ROM_LOAD( "sound3.a10",   0x03000, 0x1000, 0x6b5aeb02 )

	ROM_REGION( 0x10000, REGION_CPU3, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "pre.u3",       0x0d000, 0x1000, 0xc3d0f762 )
	ROM_LOAD( "pre.u4",       0x0e000, 0x1000, 0x7ca79b43 )
	ROM_LOAD( "pre.u5",       0x0f000, 0x1000, 0x24e9618e )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-bg2.6f",   0x00000, 0x2000, 0x40167124 )
	ROM_LOAD( "loc-bg1.5f",   0x02000, 0x2000, 0xbb2d7a5d )

	ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-g.cp4",    0x00000, 0x2000, 0x57a2b1ff )
	ROM_LOAD( "loc-h.cp3",    0x02000, 0x2000, 0x3bb4d475 )
	ROM_LOAD( "loc-e.cp6",    0x04000, 0x2000, 0xce957f1a )
	ROM_LOAD( "loc-f.cp5",    0x06000, 0x2000, 0xd26053ce )
	ROM_LOAD( "loc-c.cp8",    0x08000, 0x2000, 0xef45d146 )
	ROM_LOAD( "loc-d.cp7",    0x0a000, 0x2000, 0x5e8a3ef3 )
	ROM_LOAD( "loc-a.cp0",    0x0c000, 0x2000, 0xb35f5374 )
	ROM_LOAD( "loc-b.cp9",    0x0e000, 0x2000, 0x565a5c48 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( dotrone )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "loc-cpu1",     0x00000, 0x4000, 0xeee31b8c )
	ROM_LOAD( "loc-cpu2",     0x04000, 0x4000, 0x75ba6ad3 )
	ROM_LOAD( "loc-cpu3",     0x08000, 0x4000, 0x94bb1a0e )
	ROM_LOAD( "loc-cpu4",     0x0c000, 0x2000, 0xc137383c )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "loc-a",        0x00000, 0x1000, 0x2de6a8a8 )
	ROM_LOAD( "loc-b",        0x01000, 0x1000, 0x4097663e )
	ROM_LOAD( "loc-c",        0x02000, 0x1000, 0xf576b9e7 )
	ROM_LOAD( "loc-d",        0x03000, 0x1000, 0x74b0059e )

	ROM_REGION( 0x10000, REGION_CPU3, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "pre.u3",       0x0d000, 0x1000, 0xc3d0f762 )
	ROM_LOAD( "pre.u4",       0x0e000, 0x1000, 0x7ca79b43 )
	ROM_LOAD( "pre.u5",       0x0f000, 0x1000, 0x24e9618e )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-bg2.6f",   0x00000, 0x2000, 0x40167124 )
	ROM_LOAD( "loc-bg1.5f",   0x02000, 0x2000, 0xbb2d7a5d )

	ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "loc-g.cp4",    0x00000, 0x2000, 0x57a2b1ff )
	ROM_LOAD( "loc-h.cp3",    0x02000, 0x2000, 0x3bb4d475 )
	ROM_LOAD( "loc-e.cp6",    0x04000, 0x2000, 0xce957f1a )
	ROM_LOAD( "loc-f.cp5",    0x06000, 0x2000, 0xd26053ce )
	ROM_LOAD( "loc-c.cp8",    0x08000, 0x2000, 0xef45d146 )
	ROM_LOAD( "loc-d.cp7",    0x0a000, 0x2000, 0x5e8a3ef3 )
	ROM_LOAD( "loc-a.cp0",    0x0c000, 0x2000, 0xb35f5374 )
	ROM_LOAD( "loc-b.cp9",    0x0e000, 0x2000, 0x565a5c48 )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( demoderb )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "dd_pro",       0x00000, 0x4000, 0x8781b367 )
	ROM_LOAD( "dd_pro1",      0x04000, 0x4000, 0x4c713bfe )
	ROM_LOAD( "dd_pro2",      0x08000, 0x4000, 0xc2cbd2a4 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for the Turbo Cheap Squeak */
	ROM_LOAD( "tcs_u5.bin",   0x0c000, 0x2000, 0xeca33b2c )
	ROM_LOAD( "tcs_u4.bin",   0x0e000, 0x2000, 0x3490289a )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "dd_bg0.6f",    0x00000, 0x2000, 0xcf80be19 )
	ROM_LOAD( "dd_bg1.5f",    0x02000, 0x2000, 0x4e173e52 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "dd_fg-0.a4",   0x00000, 0x4000, 0xe57a4de6 )
	ROM_LOAD( "dd_fg-4.a3",   0x04000, 0x4000, 0x55aa667f )
	ROM_LOAD( "dd_fg-1.a6",   0x08000, 0x4000, 0x70259651 )
	ROM_LOAD( "dd_fg-5.a5",   0x0c000, 0x4000, 0x5fe99007 )
	ROM_LOAD( "dd_fg-2.a8",   0x10000, 0x4000, 0x6cab7b95 )
	ROM_LOAD( "dd_fg-6.a7",   0x14000, 0x4000, 0xabfb9a8b )
	ROM_LOAD( "dd_fg-3.a10",  0x18000, 0x4000, 0x801d9b86 )
	ROM_LOAD( "dd_fg-7.a9",   0x1c000, 0x4000, 0x0ec3f60a )
ROM_END


ROM_START( demoderm )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pro0.3b",      0x00000, 0x8000, 0x2e24527b )
	ROM_LOAD( "pro1.5b",      0x08000, 0x8000, 0x034c00fc )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for the Turbo Cheap Squeak */
	ROM_LOAD( "tcs_u5.bin",   0x0c000, 0x2000, 0xeca33b2c )
	ROM_LOAD( "tcs_u4.bin",   0x0e000, 0x2000, 0x3490289a )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "bg0.15a",      0x00000, 0x2000, 0xa35d13b8 )
	ROM_LOAD( "bg1.14b",      0x02000, 0x2000, 0x22ca93f3 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "dd_fg-0.a4",   0x00000, 0x4000, 0xe57a4de6 )
	ROM_LOAD( "dd_fg-4.a3",   0x04000, 0x4000, 0x55aa667f )
	ROM_LOAD( "dd_fg-1.a6",   0x08000, 0x4000, 0x70259651 )
	ROM_LOAD( "dd_fg-5.a5",   0x0c000, 0x4000, 0x5fe99007 )
	ROM_LOAD( "dd_fg-2.a8",   0x10000, 0x4000, 0x6cab7b95 )
	ROM_LOAD( "dd_fg-6.a7",   0x14000, 0x4000, 0xabfb9a8b )
	ROM_LOAD( "dd_fg-3.a10",  0x18000, 0x4000, 0x801d9b86 )
	ROM_LOAD( "dd_fg-7.a9",   0x1c000, 0x4000, 0x0ec3f60a )
ROM_END


ROM_START( sarge )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "cpu_3b.bin",   0x0000, 0x8000, 0xda31a58f )
	ROM_LOAD( "cpu_5b.bin",   0x8000, 0x8000, 0x6800e746 )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for the Turbo Cheap Squeak */
	ROM_LOAD( "tcs_u5.bin",   0xc000, 0x2000, 0xa894ef8a )
	ROM_LOAD( "tcs_u4.bin",   0xe000, 0x2000, 0x6ca6faf3 )

	ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "til_15a.bin",  0x00000, 0x2000, 0x685001b8 )
	ROM_LOAD( "til_14b.bin",  0x02000, 0x2000, 0x8449eb45 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "spr_8e.bin",   0x00000, 0x8000, 0x93fac29d )
	ROM_LOAD( "spr_6e.bin",   0x08000, 0x8000, 0x7cc6fb28 )
	ROM_LOAD( "spr_5e.bin",   0x10000, 0x8000, 0xc832375c )
	ROM_LOAD( "spr_4e.bin",   0x18000, 0x8000, 0xc382267d )
ROM_END


ROM_START( maxrpm )
	ROM_REGION( 0x12000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pro.0",        0x00000, 0x8000, 0x3f9ec35f )
	ROM_LOAD( "pro.1",        0x08000, 0x6000, 0xf628bb30 )
	ROM_CONTINUE(             0x10000, 0x2000 )	/* unused? but there seems to be stuff in here */
								/* loading it at e000 causes rogue sprites to appear on screen */

	ROM_REGION( 0x10000, REGION_CPU2, 0 )  /* 64k for the Turbo Cheap Squeak */
	ROM_LOAD( "turbskwk.u5",   0x8000, 0x4000, 0x55c3b759 )
	ROM_LOAD( "turbskwk.u4",   0xc000, 0x4000, 0x31a2da2e )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "bg-0",         0x00000, 0x4000, 0xe3fb693a )
	ROM_LOAD( "bg-1",         0x04000, 0x4000, 0x50d1db6c )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "fg-0",         0x00000, 0x8000, 0x1d1435c1 )
	ROM_LOAD( "fg-1",         0x08000, 0x8000, 0xe54b7f2a )
	ROM_LOAD( "fg-2",         0x10000, 0x8000, 0x38be8505 )
	ROM_LOAD( "fg-3",         0x18000, 0x8000, 0x9ae3eb52 )
ROM_END


ROM_START( rampage )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pro0rev3.3b",  0x00000, 0x08000, 0x2f7ca03c )
	ROM_LOAD( "pro1rev3.5b",  0x08000, 0x08000, 0xd89bd9a4 )

	ROM_REGION( 0x20000, REGION_CPU2, 0 )  /* 128k for the Sounds Good board */
	ROM_LOAD16_BYTE( "ramp_u7.snd",  0x00000, 0x8000, 0xcffd7fa5 )	/* these are Revision 2 sound ROMs */
	ROM_LOAD16_BYTE( "ramp_u17.snd", 0x00001, 0x8000, 0xe92c596b )
	ROM_LOAD16_BYTE( "ramp_u8.snd",  0x10000, 0x8000, 0x11f787e4 )
	ROM_LOAD16_BYTE( "ramp_u18.snd", 0x10001, 0x8000, 0x6b8bf5e1 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "bg-0",         0x00000, 0x04000, 0xc0d8b7a5 )
	ROM_LOAD( "bg-1",         0x04000, 0x04000, 0x2f6e3aa1 )

	ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "fg-0",         0x00000, 0x10000, 0x0974be5d )
	ROM_LOAD( "fg-1",         0x10000, 0x10000, 0x8728532b )
	ROM_LOAD( "fg-2",         0x20000, 0x10000, 0x9489f714 )
	ROM_LOAD( "fg-3",         0x30000, 0x10000, 0x81e1de40 )
ROM_END


ROM_START( rampage2 )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pro0rev2.3b",  0x0000, 0x8000, 0x3f1d0293 )
	ROM_LOAD( "pro1rev2.5b",  0x8000, 0x8000, 0x58523d75 )

	ROM_REGION( 0x20000, REGION_CPU2, 0 )  /* 128k for the Sounds Good board */
	ROM_LOAD16_BYTE( "ramp_u7.snd",  0x00000, 0x8000, 0xcffd7fa5 )    /* these are Revision 2 sound ROMs */
	ROM_LOAD16_BYTE( "ramp_u17.snd", 0x00001, 0x8000, 0xe92c596b )
	ROM_LOAD16_BYTE( "ramp_u8.snd",  0x10000, 0x8000, 0x11f787e4 )
	ROM_LOAD16_BYTE( "ramp_u18.snd", 0x10001, 0x8000, 0x6b8bf5e1 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "bg-0",         0x00000, 0x04000, 0xc0d8b7a5 )
	ROM_LOAD( "bg-1",         0x04000, 0x04000, 0x2f6e3aa1 )

	ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "fg-0",         0x00000, 0x10000, 0x0974be5d )
	ROM_LOAD( "fg-1",         0x10000, 0x10000, 0x8728532b )
	ROM_LOAD( "fg-2",         0x20000, 0x10000, 0x9489f714 )
	ROM_LOAD( "fg-3",         0x30000, 0x10000, 0x81e1de40 )
ROM_END


ROM_START( powerdrv )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pdrv3b.bin",   0x0000, 0x8000, 0xd870b704 )
	ROM_LOAD( "pdrv5b.bin",   0x8000, 0x8000, 0xfa0544ad )

	ROM_REGION( 0x20000, REGION_CPU2, 0 )  /* 128k for the Sounds Good board */
	ROM_LOAD16_BYTE( "pdsndu7.bin",  0x00000, 0x8000, 0x78713e78 )
	ROM_LOAD16_BYTE( "pdsndu17.bin", 0x00001, 0x8000, 0xc41de6e4 )
	ROM_LOAD16_BYTE( "pdsndu8.bin",  0x10000, 0x8000, 0x15714036 )
	ROM_LOAD16_BYTE( "pdsndu18.bin", 0x10001, 0x8000, 0xcae14c70 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "pdrv15a.bin",  0x00000, 0x04000, 0xb858b5a8 )
	ROM_LOAD( "pdrv14b.bin",  0x04000, 0x04000, 0x12ee7fc2 )

	ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "pdrv8e.bin",   0x00000, 0x10000, 0xdd3a2adc )
	ROM_LOAD( "pdrv6e.bin",   0x10000, 0x10000, 0x1a1f7f81 )
	ROM_LOAD( "pdrv5e.bin",   0x20000, 0x10000, 0x4cb4780e )
	ROM_LOAD( "pdrv4e.bin",   0x30000, 0x10000, 0xde400335 )
ROM_END


ROM_START( stargrds )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "pro-0.3b",  0x00000, 0x08000, 0x3ad94aa2 )
	ROM_LOAD( "pro-1.5b",  0x08000, 0x08000, 0xdba428b0 )

	ROM_REGION( 0x20000, REGION_CPU2, 0 )  /* 128k for the Sounds Good board */
	ROM_LOAD16_BYTE( "snd0.u7",      0x00000, 0x8000, 0x7755a493 )
	ROM_LOAD16_BYTE( "snd1.u17",     0x00001, 0x8000, 0xd98d14ae )

	ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
	ROM_LOAD( "bg-0.15a",     0x00000, 0x08000, 0xecfaef3e )
	ROM_LOAD( "bg-1.14b",     0x08000, 0x08000, 0x2c75569d )

	ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "fg-0.8e",         0x00000, 0x10000, 0x22797aaa )
	ROM_LOAD( "fg-1.6e",         0x10000, 0x10000, 0x413fa119 )
	ROM_LOAD( "fg-2.5e",         0x20000, 0x10000, 0x7036cfe6 )
	ROM_LOAD( "fg-3.4e",         0x30000, 0x10000, 0xcc5cc003 )
ROM_END


ROM_START( spyhunt )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "cpu_pg0.6d",   0x0000, 0x2000, 0x1721b88f )
	ROM_LOAD( "cpu_pg1.7d",   0x2000, 0x2000, 0x909d044f )
	ROM_LOAD( "cpu_pg2.8d",   0x4000, 0x2000, 0xafeeb8bd )
	ROM_LOAD( "cpu_pg3.9d",   0x6000, 0x2000, 0x5e744381 )
	ROM_LOAD( "cpu_pg4.10d",  0x8000, 0x2000, 0xa3033c15 )
	ROM_LOAD( "cpu_pg5.11d",  0xa000, 0x4000, 0x53a4f7cd )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "snd_0sd.a8",   0x0000, 0x1000, 0xc95cf31e )
	ROM_LOAD( "snd_1sd.a7",   0x1000, 0x1000, 0x12aaa48e )

	ROM_REGION( 0x8000, REGION_CPU3, 0 )  /* 32k for the Chip Squeak Deluxe */
	ROM_LOAD16_BYTE( "csd_u7a.u7",   0x00000, 0x2000, 0x6e689fe7 )
	ROM_LOAD16_BYTE( "csd_u17b.u17", 0x00001, 0x2000, 0x0d9ddce6 )
	ROM_LOAD16_BYTE( "csd_u8c.u8",   0x04000, 0x2000, 0x35563cd0 )
	ROM_LOAD16_BYTE( "csd_u18d.u18", 0x04001, 0x2000, 0x63d3f5b1 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "cpu_bg0.3a",   0x00000, 0x2000, 0xdea34fed )
	ROM_LOAD( "cpu_bg1.4a",   0x02000, 0x2000, 0x8f64525f )
	ROM_LOAD( "cpu_bg2.5a",   0x04000, 0x2000, 0xba0fd626 )
	ROM_LOAD( "cpu_bg3.6a",   0x06000, 0x2000, 0x7b482d61 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "vid_0fg.a8",   0x00000, 0x4000, 0x292c5466 )
	ROM_LOAD( "vid_1fg.a7",   0x04000, 0x4000, 0x9fe286ec )
	ROM_LOAD( "vid_2fg.a6",   0x08000, 0x4000, 0x62c8bfa5 )
	ROM_LOAD( "vid_3fg.a5",   0x0c000, 0x4000, 0xb894934d )
	ROM_LOAD( "vid_4fg.a4",   0x10000, 0x4000, 0x7ca4941b )
	ROM_LOAD( "vid_5fg.a3",   0x14000, 0x4000, 0x2d9fbcec )
	ROM_LOAD( "vid_6fg.a2",   0x18000, 0x4000, 0x8cb8a066 )
	ROM_LOAD( "vid_7fg.a1",   0x1c000, 0x4000, 0x940fe17e )

	ROM_REGION( 0x01000, REGION_GFX3, ROMREGION_DISPOSE )
	ROM_LOAD( "cpu_alph.10g", 0x00000, 0x1000, 0x936dc87f )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( crater )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "crcpu.6d",     0x0000, 0x2000, 0xad31f127 )
	ROM_LOAD( "crcpu.7d",     0x2000, 0x2000, 0x3743c78f )
	ROM_LOAD( "crcpu.8d",     0x4000, 0x2000, 0xc95f9088 )
	ROM_LOAD( "crcpu.9d",     0x6000, 0x2000, 0xa03c4b11 )
	ROM_LOAD( "crcpu.10d",    0x8000, 0x2000, 0x44ae4cbd )

	ROM_REGION( 0x10000, REGION_CPU2, 0 )	/* 64k for the audio CPU */
	ROM_LOAD( "crsnd4.a7",    0x0000, 0x1000, 0xfd666cb5 )
	ROM_LOAD( "crsnd1.a8",    0x1000, 0x1000, 0x90bf2c4c )
	ROM_LOAD( "crsnd2.a9",    0x2000, 0x1000, 0x3b8deef1 )
	ROM_LOAD( "crsnd3.a10",   0x3000, 0x1000, 0x05803453 )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "crcpu.3a",     0x00000, 0x2000, 0x9d73504a )
	ROM_LOAD( "crcpu.4a",     0x02000, 0x2000, 0x42a47dff )
	ROM_LOAD( "crcpu.5a",     0x04000, 0x2000, 0x2fe4a6e1 )
	ROM_LOAD( "crcpu.6a",     0x06000, 0x2000, 0xd0659042 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "crvid.a3",     0x00000, 0x4000, 0x2c2f5b29 )
	ROM_LOAD( "crvid.a4",     0x04000, 0x4000, 0x579a8e36 )
	ROM_LOAD( "crvid.a5",     0x08000, 0x4000, 0x9bdec312 )
	ROM_LOAD( "crvid.a6",     0x0c000, 0x4000, 0x5bf954e0 )
	ROM_LOAD( "crvid.a7",     0x10000, 0x4000, 0x9fa307d5 )
	ROM_LOAD( "crvid.a8",     0x14000, 0x4000, 0x4b913498 )
	ROM_LOAD( "crvid.a9",     0x18000, 0x4000, 0x811f152d )
	ROM_LOAD( "crvid.a10",    0x1c000, 0x4000, 0x7a22d6bc )

	ROM_REGION( 0x01000, REGION_GFX3, ROMREGION_DISPOSE )
	ROM_LOAD( "crcpu.10g",    0x00000, 0x1000, 0x6fe53c8d )

	ROM_REGION( 0x0020, REGION_PROMS, 0 )
	ROM_LOAD( "82s123.12d",   0x0000, 0x0020, 0xe1281ee9 )	/* from shollow, assuming it's the same */
ROM_END


ROM_START( turbotag )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )	/* 64k for code */
	ROM_LOAD( "ttprog0.bin",  0x0000, 0x2000, 0x6110fd80 )
	ROM_LOAD( "ttprog1.bin",  0x2000, 0x2000, BADCRC( 0xb0505e18 ))
	ROM_LOAD( "ttprog2.bin",  0x4000, 0x2000, 0xc4141237 )
	ROM_LOAD( "ttprog3.bin",  0x6000, 0x2000, 0xaf294c6e )
	ROM_LOAD( "ttprog4.bin",  0x8000, 0x2000, 0x8c5bc1a4 )
	ROM_LOAD( "ttprog5.bin",  0xa000, 0x2000, 0x11e62fe4 )
	ROM_RELOAD(               0xc000, 0x2000 )

	ROM_REGION( 0x8000, REGION_CPU2, 0 )  /* 32k for the Chip Squeak Deluxe */
	ROM_LOAD16_BYTE( "ttu7.bin",  0x00000, 0x2000, 0x8ebb3302 )
	ROM_LOAD16_BYTE( "ttu17.bin", 0x00001, 0x2000, 0x605d6c74 )
	ROM_LOAD16_BYTE( "ttu8.bin",  0x04000, 0x2000, 0x6bfcb22a )
	ROM_LOAD16_BYTE( "ttu18.bin", 0x04001, 0x2000, 0xbb25852c )

	ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "ttbg0.bin",    0x00000, 0x2000, 0x1cd2023f )
	ROM_LOAD( "ttbg1.bin",    0x02000, 0x2000, 0x784e84cd )
	ROM_LOAD( "ttbg2.bin",    0x04000, 0x2000, 0xda9d47d2 )
	ROM_LOAD( "ttbg3.bin",    0x06000, 0x2000, 0x367e06a5 )

	ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
	ROM_LOAD( "ttfg0.bin",    0x00000, 0x4000, 0xed69e1a8 )
	ROM_LOAD( "ttfg1.bin",    0x04000, 0x4000, 0x9d7e6ebc )
	ROM_LOAD( "ttfg2.bin",    0x08000, 0x4000, 0x037ec6fc )
	ROM_LOAD( "ttfg3.bin",    0x0c000, 0x4000, 0x74e21c1c )
	ROM_LOAD( "ttfg4.bin",    0x10000, 0x4000, 0x6fdb0c13 )
	ROM_LOAD( "ttfg5.bin",    0x14000, 0x4000, 0x8b718879 )
	ROM_LOAD( "ttfg6.bin",    0x18000, 0x4000, 0x4094e996 )
	ROM_LOAD( "ttfg7.bin",    0x1c000, 0x4000, 0x212019dc )

	ROM_REGION( 0x01000, REGION_GFX3, ROMREGION_DISPOSE )
	ROM_LOAD( "ttan.bin",     0x00000, 0x1000, 0xaa0b1471 )
ROM_END



/*************************************
 *
 *	Driver initialization
 *
 *************************************/

static DRIVER_INIT( tapper )
{
	MCR_CONFIGURE_SOUND(MCR_SSIO);
}


static DRIVER_INIT( timber )
{
	MCR_CONFIGURE_SOUND(MCR_SSIO);

	/* Timber uses a modified SSIO with RAM in place of one of the ROMs */
	install_mem_read_handler(1, 0x3000, 0x3fff, MRA_RAM);
	install_mem_write_handler(1, 0x3000, 0x3fff, MWA_RAM);
}


static DRIVER_INIT( dotron )
{
	MCR_CONFIGURE_SOUND(MCR_SSIO | MCR_SQUAWK_N_TALK);
	install_port_read_handler(0, 0x02, 0x02, dotron_port_2_r);
	install_port_write_handler(0, 0x04, 0x04, dotron_port_4_w);
}


static DRIVER_INIT( demoderb )
{
	MCR_CONFIGURE_SOUND(MCR_TURBO_CHIP_SQUEAK);
	install_port_read_handler(0, 0x01, 0x02, demoderb_port12_r);
	install_port_write_handler(0, 0x04, 0x04, demoderb_port_4_w);
}


static DRIVER_INIT( demoderm )
{
	MCR_CONFIGURE_SOUND(MCR_TURBO_CHIP_SQUEAK);
	install_port_read_handler(0, 0x01, 0x02, demoderb_port12_r);
	install_port_write_handler(0, 0x06, 0x06, demoderb_port_4_w);
}


static DRIVER_INIT( sarge )
{
	MCR_CONFIGURE_SOUND(MCR_TURBO_CHIP_SQUEAK);
	install_port_read_handler(0, 0x01, 0x01, sarge_port_1_r);
	install_port_read_handler(0, 0x02, 0x02, sarge_port_2_r);
	install_port_write_handler(0, 0x06, 0x06, turbocs_data_w);
}


static DRIVER_INIT( maxrpm )
{
	MCR_CONFIGURE_SOUND(MCR_TURBO_CHIP_SQUEAK);
	install_port_read_handler(0, 0x01, 0x01, maxrpm_port_1_r);
	install_port_read_handler(0, 0x02, 0x02, maxrpm_port_2_r);
	install_port_write_handler(0, 0x05, 0x05, maxrpm_port_5_w);
	install_port_write_handler(0, 0x06, 0x06, turbocs_data_w);
}


static DRIVER_INIT( rampage )
{
	MCR_CONFIGURE_SOUND(MCR_SOUNDS_GOOD);
	install_port_write_handler(0, 0x06, 0x06, soundsgood_data_w);
}


static DRIVER_INIT( powerdrv )
{
	MCR_CONFIGURE_SOUND(MCR_SOUNDS_GOOD);
	install_port_read_handler(0, 0x02, 0x02, powerdrv_port_2_r);
	install_port_write_handler(0, 0x05, 0x05, powerdrv_port_5_w);
	install_port_write_handler(0, 0x06, 0x06, soundsgood_data_w);
	install_port_write_handler(0, 0x07, 0x07, powerdrv_port_7_w);
}


static DRIVER_INIT( stargrds )
{
	MCR_CONFIGURE_SOUND(MCR_SOUNDS_GOOD);
	install_port_read_handler(0, 0x00, 0x00, stargrds_port_0_r);
	install_port_write_handler(0, 0x05, 0x05, stargrds_port_5_w);
	install_port_write_handler(0, 0x06, 0x06, stargrds_soundsgood_data_w);
}


static DRIVER_INIT( spyhunt )
{
	MCR_CONFIGURE_SOUND(MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE);
	install_port_read_handler(0, 0x02, 0x02, spyhunt_port_2_r);
	install_port_write_handler(0, 0x04, 0x04, spyhunt_port_4_w);

	spyhunt_sprite_color_mask = 0x00;
	spyhunt_scroll_offset = 16;
}


static DRIVER_INIT( crater )
{
	MCR_CONFIGURE_SOUND(MCR_SSIO);

	spyhunt_sprite_color_mask = 0x03;
	spyhunt_scroll_offset = 96;
}


static DRIVER_INIT( turbotag )
{
	MCR_CONFIGURE_SOUND(MCR_CHIP_SQUEAK_DELUXE);
	install_port_read_handler(0, 0x02, 0x02, spyhunt_port_2_r);
	install_port_write_handler(0, 0x04, 0x04, spyhunt_port_4_w);

	spyhunt_sprite_color_mask = 0x00;
	spyhunt_scroll_offset = 88;

	/* kludge for bad ROM read */
	install_mem_read_handler(0, 0x0b53, 0x0b53, turbotag_kludge_r);
}



/*************************************
 *
 *	Game drivers
 *
 *************************************/

/* MCR3 games */
GAME( 1983, tapper,   0,        mcr3_ssio,tapper,   tapper,   ROT0,  "Bally Midway", "Tapper (Budweiser)" )
GAME( 1983, tappera,  tapper,   mcr3_ssio,tapper,   tapper,   ROT0,  "Bally Midway", "Tapper (alternate)" )
GAME( 1983, sutapper, tapper,   mcr3_ssio,tapper,   tapper,   ROT0,  "Bally Midway", "Tapper (Suntory)" )
GAME( 1984, rbtapper, tapper,   mcr3_ssio,tapper,   tapper,   ROT0,  "Bally Midway", "Tapper (Root Beer)" )
GAME( 1984, timber,   0,        mcr3_ssio,timber,   timber,   ROT0,  "Bally Midway", "Timber" )
GAME( 1983, dotron,   0,        dotron,   dotron,   dotron,   ORIENTATION_FLIP_X, "Bally Midway", "Discs of Tron (Upright)" )
GAME( 1983, dotrona,  dotron,   dotron,   dotron,   dotron,   ORIENTATION_FLIP_X, "Bally Midway", "Discs of Tron (Upright alternate)" )
GAME( 1983, dotrone,  dotron,   dotron,   dotron,   dotron,   ORIENTATION_FLIP_X, "Bally Midway", "Discs of Tron (Environmental)" )
GAME( 1984, demoderb, 0,        demoderb, demoderb, demoderb, ROT0,  "Bally Midway", "Demolition Derby" )

/* MCR monoboard games */
GAME( 1984, demoderm, demoderb, mono_tcs, demoderb, demoderm, ROT0,  "Bally Midway", "Demolition Derby (2-Player Mono Board Version)" )
GAME( 1985, sarge,    0,        mono_tcs, sarge,    sarge,    ROT0,  "Bally Midway", "Sarge" )
GAME( 1986, maxrpm,   0,        mono_tcs, maxrpm,   maxrpm,   ROT0,  "Bally Midway", "Max RPM" )
GAME( 1986, rampage,  0,        mono_sg,  rampage,  rampage,  ROT0,  "Bally Midway", "Rampage (revision 3)" )
GAME( 1986, rampage2, rampage,  mono_sg,  rampage,  rampage,  ROT0,  "Bally Midway", "Rampage (revision 2)" )
GAME( 1986, powerdrv, 0,        mono_sg,  powerdrv, powerdrv, ROT0,  "Bally Midway", "Power Drive" )
GAME( 1987, stargrds, 0,        mono_sg,  stargrds, stargrds, ROT0,  "Bally Midway", "Star Guards" )

/* MCR scrolling games */
GAME( 1983, spyhunt,  0,        spyhunt,  spyhunt,  spyhunt,  ROT90, "Bally Midway", "Spy Hunter" )
GAME( 1984, crater,   0,        crater,   crater,   crater,   ORIENTATION_FLIP_X, "Bally Midway", "Crater Raider" )
GAME( 1985, turbotag, 0,        turbotag, turbotag, turbotag, ROT90, "Bally Midway", "Turbo Tag (prototype)" )
