summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/berzerk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/berzerk.c')
-rw-r--r--src/mame/drivers/berzerk.c167
1 files changed, 73 insertions, 94 deletions
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index 291e2fc44ee..1eedc992a81 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -586,9 +586,9 @@ static ADDRESS_MAP_START( berzerk_io_map, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x3f) AM_NOP
AM_RANGE(0x40, 0x47) AM_READWRITE(berzerk_audio_r, berzerk_audio_w)
- AM_RANGE(0x48, 0x48) AM_READWRITE(input_port_0_r, SMH_NOP)
- AM_RANGE(0x49, 0x49) AM_READWRITE(input_port_1_r, SMH_NOP)
- AM_RANGE(0x4a, 0x4a) AM_READWRITE(input_port_2_r, SMH_NOP)
+ AM_RANGE(0x48, 0x48) AM_READ_PORT("P1") AM_WRITENOP
+ AM_RANGE(0x49, 0x49) AM_READ_PORT("SYSTEM") AM_WRITENOP
+ AM_RANGE(0x4a, 0x4a) AM_READ_PORT("P2") AM_WRITENOP
AM_RANGE(0x4b, 0x4b) AM_READWRITE(SMH_NOP, magicram_control_w)
AM_RANGE(0x4c, 0x4c) AM_READWRITE(nmi_enable_r, nmi_enable_w)
AM_RANGE(0x4d, 0x4d) AM_READWRITE(nmi_disable_r, nmi_disable_w)
@@ -596,12 +596,12 @@ static ADDRESS_MAP_START( berzerk_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x4f, 0x4f) AM_READWRITE(SMH_NOP, irq_enable_w)
AM_RANGE(0x50, 0x57) AM_NOP /* second sound board, but not used */
AM_RANGE(0x58, 0x5f) AM_NOP
- AM_RANGE(0x60, 0x60) AM_MIRROR(0x18) AM_READWRITE(input_port_3_r, SMH_NOP)
- AM_RANGE(0x61, 0x61) AM_MIRROR(0x18) AM_READWRITE(input_port_4_r, SMH_NOP)
- AM_RANGE(0x62, 0x62) AM_MIRROR(0x18) AM_READWRITE(input_port_5_r, SMH_NOP)
- AM_RANGE(0x63, 0x63) AM_MIRROR(0x18) AM_READWRITE(input_port_6_r, SMH_NOP)
- AM_RANGE(0x64, 0x64) AM_MIRROR(0x18) AM_READWRITE(input_port_7_r, SMH_NOP)
- AM_RANGE(0x65, 0x65) AM_MIRROR(0x18) AM_READWRITE(input_port_8_r, SMH_NOP)
+ AM_RANGE(0x60, 0x60) AM_MIRROR(0x18) AM_READ_PORT("F3") AM_WRITENOP
+ AM_RANGE(0x61, 0x61) AM_MIRROR(0x18) AM_READ_PORT("F2") AM_WRITENOP
+ AM_RANGE(0x62, 0x62) AM_MIRROR(0x18) AM_READ_PORT("F6") AM_WRITENOP
+ AM_RANGE(0x63, 0x63) AM_MIRROR(0x18) AM_READ_PORT("F5") AM_WRITENOP
+ AM_RANGE(0x64, 0x64) AM_MIRROR(0x18) AM_READ_PORT("F4") AM_WRITENOP
+ AM_RANGE(0x65, 0x65) AM_MIRROR(0x18) AM_READ_PORT("SW2") AM_WRITENOP
AM_RANGE(0x66, 0x66) AM_MIRROR(0x18) AM_READWRITE(led_off_r, led_off_w)
AM_RANGE(0x67, 0x67) AM_MIRROR(0x18) AM_READWRITE(led_on_r, led_on_w)
AM_RANGE(0x80, 0xff) AM_NOP
@@ -636,8 +636,8 @@ ADDRESS_MAP_END
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
-static INPUT_PORTS_START( berzerk )
- PORT_START /* IN0 */
+static INPUT_PORTS_START( common )
+ PORT_START_TAG("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
@@ -645,7 +645,7 @@ static INPUT_PORTS_START( berzerk )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* IN1 */
+ PORT_START_TAG("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -653,7 +653,7 @@ static INPUT_PORTS_START( berzerk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_START /* IN2 */
+ PORT_START_TAG("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
@@ -664,7 +664,29 @@ static INPUT_PORTS_START( berzerk )
PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
- PORT_START /* IN3 */
+ /* fake port for monitor type */
+ PORT_START_TAG(MONITOR_TYPE_PORT_TAG)
+ PORT_CONFNAME( 0x01, 0x00, "Monitor Type" )
+ PORT_CONFSETTING( 0x00, "Wells-Gardner" )
+ PORT_CONFSETTING( 0x01, "Electrohome" )
+ PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( berzerk )
+ PORT_INCLUDE( common )
+
+ PORT_START_TAG("F2")
+ PORT_DIPNAME( 0x03, 0x00, "Color Test" ) PORT_CODE(KEYCODE_F5) PORT_TOGGLE PORT_DIPLOCATION("F2:1,2")
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x03, DEF_STR( On ) )
+ PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("F2:7,8")
+ PORT_DIPSETTING( 0xc0, "5000 and 10000" )
+ PORT_DIPSETTING( 0x40, "5000" )
+ PORT_DIPSETTING( 0x80, "10000" )
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) )
+
+ PORT_START_TAG("F3")
PORT_DIPNAME( 0x01, 0x00, "Input Test Mode" ) PORT_CODE(KEYCODE_F2) PORT_TOGGLE PORT_DIPLOCATION("F3:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
@@ -678,71 +700,45 @@ static INPUT_PORTS_START( berzerk )
PORT_DIPSETTING( 0x80, DEF_STR( French ) )
PORT_DIPSETTING( 0xc0, DEF_STR( Spanish ) )
- PORT_START /* IN4 */
- PORT_DIPNAME( 0x03, 0x00, "Color Test" ) PORT_CODE(KEYCODE_F5) PORT_TOGGLE PORT_DIPLOCATION("F2:1,2")
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x03, DEF_STR( On ) )
- PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("F2:7,8")
- PORT_DIPSETTING( 0xc0, "5000 and 10000" )
- PORT_DIPSETTING( 0x40, "5000" )
- PORT_DIPSETTING( 0x80, "10000" )
- PORT_DIPSETTING( 0x00, DEF_STR( None ) )
-
- PORT_START /* IN5 */
- BERZERK_COINAGE(3, F6)
+ PORT_START_TAG("F4")
+ BERZERK_COINAGE(1, F4)
- PORT_START /* IN6 */
+ PORT_START_TAG("F5")
BERZERK_COINAGE(2, F5)
- PORT_START /* IN7 */
- BERZERK_COINAGE(1, F4)
+ PORT_START_TAG("F6")
+ BERZERK_COINAGE(3, F6)
- PORT_START /* IN8 */
+ PORT_START_TAG("SW2")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Stats") PORT_CODE(KEYCODE_F1)
-
- /* fake port for monitor type */
- PORT_START_TAG(MONITOR_TYPE_PORT_TAG)
- PORT_CONFNAME( 0x01, 0x00, "Monitor Type" )
- PORT_CONFSETTING( 0x00, "Wells-Gardner" )
- PORT_CONFSETTING( 0x01, "Electrohome" )
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Stats") PORT_CODE(KEYCODE_F1)
INPUT_PORTS_END
static INPUT_PORTS_START( frenzy )
- PORT_START /* IN0 */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
- PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_INCLUDE( common )
- PORT_START /* IN1 */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_MODIFY("SYSTEM")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* IN2 */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
+ PORT_START_TAG("F2")
+ /* Bit 0 does some more hardware tests. According to the manual, both bit 0 & 1 must be:
+ - ON for Signature Analysis (S.A.)
+ - OFF for game operation */
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) // F2:1,2
+ PORT_DIPNAME( 0x04, 0x00, "Input Test Mode" ) PORT_CODE(KEYCODE_F2) PORT_TOGGLE PORT_DIPLOCATION("F2:3")
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x00, "Crosshair Pattern" ) PORT_CODE(KEYCODE_F4) PORT_TOGGLE PORT_DIPLOCATION("F2:4")
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( On ) )
+ PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) // F2:5,6,7,8
- PORT_START /* IN3 */
- PORT_DIPNAME( 0x0f, 0x03, DEF_STR( Bonus_Life ) )
+ PORT_START_TAG("F3")
+ PORT_DIPNAME( 0x0f, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("F3:1,2,3,4")
PORT_DIPSETTING( 0x01, "1000" )
PORT_DIPSETTING( 0x02, "2000" )
PORT_DIPSETTING( 0x03, "3000" )
@@ -759,27 +755,17 @@ static INPUT_PORTS_START( frenzy )
PORT_DIPSETTING( 0x0e, "14000" )
PORT_DIPSETTING( 0x0f, "15000" )
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language ) )
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED ) // F3:5,6
+ PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("F3:7,8")
PORT_DIPSETTING( 0x00, DEF_STR( English ) )
PORT_DIPSETTING( 0x40, DEF_STR( German ) )
PORT_DIPSETTING( 0x80, DEF_STR( French ) )
PORT_DIPSETTING( 0xc0, DEF_STR( Spanish ) )
- PORT_START /* IN4 */
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Bit 0 does some more hardware tests */
- PORT_DIPNAME( 0x04, 0x00, "Input Test Mode" ) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x00, "Crosshair Pattern" ) PORT_CODE(KEYCODE_F4) PORT_TOGGLE
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
-
/* The following 3 ports use all 8 bits, but I didn't feel like adding all 256 values :-) */
- PORT_START /* IN5 */
- PORT_DIPNAME( 0x0f, 0x01, "Coins/Credit B" )
- /*PORT_DIPSETTING( 0x00, "0" ) Can't insert coins */
+ PORT_START_TAG("F4")
+ PORT_DIPNAME( 0x0f, 0x01, "Coin Multiplier" ) PORT_DIPLOCATION("F4:1,2,3,4") // F4:1,8
+ PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x03, "3" )
@@ -797,8 +783,8 @@ static INPUT_PORTS_START( frenzy )
PORT_DIPSETTING( 0x0f, "15" )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* IN6 */
- PORT_DIPNAME( 0x0f, 0x01, "Coins/Credit A" )
+ PORT_START_TAG("F5")
+ PORT_DIPNAME( 0x0f, 0x01, "Coins/Credit A" ) PORT_DIPLOCATION("F5:1,2,3,4") // F5:1,8
/*PORT_DIPSETTING( 0x00, "0" ) Can't insert coins */
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x02, "2" )
@@ -817,9 +803,9 @@ static INPUT_PORTS_START( frenzy )
PORT_DIPSETTING( 0x0f, "15" )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* IN7 */
- PORT_DIPNAME( 0x0f, 0x01, "Coin Multiplier" )
- PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
+ PORT_START_TAG("F6")
+ PORT_DIPNAME( 0x0f, 0x01, "Coins/Credit B" ) PORT_DIPLOCATION("F6:1,2,3,4") // F6:1,8
+ /*PORT_DIPSETTING( 0x00, "0" ) Can't insert coins */
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x03, "3" )
@@ -837,17 +823,10 @@ static INPUT_PORTS_START( frenzy )
PORT_DIPSETTING( 0x0f, "15" )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* IN8 */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )
+ PORT_START_TAG("SW2")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_DIPLOCATION("SW2:1")
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Stats") PORT_CODE(KEYCODE_F1)
-
- /* fake port for monitor type */
- PORT_START_TAG(MONITOR_TYPE_PORT_TAG)
- PORT_CONFNAME( 0x01, 0x00, "Monitor Type" )
- PORT_CONFSETTING( 0x00, "Wells-Gardner" )
- PORT_CONFSETTING( 0x01, "Electrohome" )
- PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Stats") PORT_CODE(KEYCODE_F1)
INPUT_PORTS_END