From 544a8091c09e7fa4b161dc2973ac88760e6febdf Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 3 Feb 2017 17:12:09 -0500 Subject: [PATCH] polepos.cpp: Input improvements - Correct DIP switches and locations for polepos2bi and polepos2bs - Fix bootleg mft. info for polepos2bs - Use modern DEVCB features to make extra 4-bit input ports unnecessary --- src/mame/drivers/polepos.cpp | 110 ++++++++++++++++++++++------------- src/mame/includes/polepos.h | 2 - src/mame/layout/polepos.lay | 4 +- 3 files changed, 72 insertions(+), 44 deletions(-) diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp index bfd0b3d2124..e038e2db0df 100644 --- a/src/mame/drivers/polepos.cpp +++ b/src/mame/drivers/polepos.cpp @@ -343,9 +343,6 @@ WRITE16_MEMBER(polepos_state::polepos_z8002_nvi_enable_w) space.device().execute().set_input_line(0, CLEAR_LINE); } - -CUSTOM_INPUT_MEMBER(polepos_state::high_port_r){ return ioport((const char *)param)->read() >> 4; } -CUSTOM_INPUT_MEMBER(polepos_state::low_port_r){ return ioport((const char *)param)->read() & 0x0f; } CUSTOM_INPUT_MEMBER(polepos_state::auto_start_r) { return m_auto_start_mask; @@ -491,17 +488,15 @@ ADDRESS_MAP_END *********************************************************************/ static INPUT_PORTS_START( polepos ) - PORT_START("IN0L") + PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,auto_start_r, nullptr) // start 1, program controlled PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN0H") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("DSWA") PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") @@ -527,9 +522,6 @@ static INPUT_PORTS_START( polepos ) PORT_DIPSETTING( 0x80, "3" ) /* Manufacturer's recommended settings for Upright cabinet */ PORT_DIPSETTING( 0x00, "4" ) /* Manufacturer's recommended settings for Sit-Down cabinet */ - PORT_START("DSWA_HI") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,high_port_r, "DSWA") - PORT_START("DSWB") PORT_DIPNAME( 0x07, 0x03, "Extended Rank" ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x07, "A" ) @@ -556,9 +548,6 @@ static INPUT_PORTS_START( polepos ) PORT_DIPSETTING( 0x80, DEF_STR( Off )) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSWB_HI") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,high_port_r, "DSWB") - PORT_START("BRAKE") PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) @@ -635,12 +624,6 @@ static INPUT_PORTS_START( topracern ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - PORT_START("IN0L") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,low_port_r, "IN0") - - PORT_START("IN0H") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,high_port_r, "IN0") - PORT_START("DSWA") PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) @@ -665,9 +648,6 @@ static INPUT_PORTS_START( topracern ) PORT_DIPSETTING( 0x80, "3" ) PORT_DIPSETTING( 0x00, "4" ) - PORT_START("DSWA_HI") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,high_port_r, "DSWA") - /* FIXME: these dips don't work and may not even exist on this bootleg */ PORT_START("DSWB") PORT_DIPNAME( 0x07, 0x07, "Extended Rank" ) @@ -695,9 +675,6 @@ static INPUT_PORTS_START( topracern ) PORT_DIPSETTING( 0x80, DEF_STR( Off )) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSWB_HI") - PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, polepos_state,high_port_r, "DSWB") - PORT_START("BRAKE") PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) @@ -772,6 +749,59 @@ static INPUT_PORTS_START( polepos2j ) INPUT_PORTS_END +static INPUT_PORTS_START( polepos2bi ) + PORT_INCLUDE( topracern ) + + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,3,5") + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_6C ) ) + PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,2") + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0x20, 0x00, "Speed Unit" ) PORT_DIPLOCATION("SWA:4") + PORT_DIPSETTING( 0x20, "mph" ) + PORT_DIPSETTING( 0x00, "km/h" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:6") + PORT_DIPSETTING( 0x00, DEF_STR( Off )) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Speed" ) PORT_DIPLOCATION("SWA:8") + PORT_DIPSETTING( 0x80, "Average" ) + PORT_DIPSETTING( 0x00, DEF_STR( High ) ) + + PORT_MODIFY("DSWB") + PORT_DIPNAME( 0x03, 0x01, "Extended Rank" ) PORT_DIPLOCATION("SWB:1,3") + PORT_DIPSETTING( 0x00, "A" ) + PORT_DIPSETTING( 0x01, "B" ) + PORT_DIPSETTING( 0x02, "C" ) + PORT_DIPSETTING( 0x03, "D" ) + PORT_DIPNAME( 0x0c, 0x04, "Practice Rank" ) PORT_DIPLOCATION("SWB:5,7") + PORT_DIPSETTING( 0x00, "A" ) + PORT_DIPSETTING( 0x04, "B" ) + PORT_DIPSETTING( 0x08, "C" ) + PORT_DIPSETTING( 0x0c, "D" ) + PORT_DIPNAME( 0x30, 0x10, "Goal" ) PORT_DIPLOCATION("SWB:2,4") + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x10, "4" ) + PORT_DIPSETTING( 0x20, "5" ) + PORT_DIPSETTING( 0x30, "6" ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SWB:6") + PORT_DIPSETTING( 0x00, "90 secs." ) + PORT_DIPSETTING( 0x40, "120 secs." ) + PORT_DIPNAME( 0x80, 0x00, "Always On" ) PORT_DIPLOCATION("SWB:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + /********************************************************************* * Graphics layouts @@ -845,10 +875,10 @@ static MACHINE_CONFIG_START( polepos, polepos_state ) MCFG_CPU_PROGRAM_MAP(z8002_map) MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */ - MCFG_NAMCO_51XX_INPUT_0_CB(IOPORT("IN0L")) - MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0H")) - MCFG_NAMCO_51XX_INPUT_2_CB(IOPORT("DSWB")) - MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("DSWB_HI")) + MCFG_NAMCO_51XX_INPUT_0_CB(IOPORT("IN0")) MCFG_DEVCB_MASK(0x0f) + MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0")) MCFG_DEVCB_RSHIFT(4) + MCFG_NAMCO_51XX_INPUT_2_CB(IOPORT("DSWB")) MCFG_DEVCB_MASK(0x0f) + MCFG_NAMCO_51XX_INPUT_3_CB(IOPORT("DSWB")) MCFG_DEVCB_RSHIFT(4) MCFG_NAMCO_51XX_OUTPUT_0_CB(WRITE8(polepos_state,out_0)) MCFG_NAMCO_51XX_OUTPUT_1_CB(WRITE8(polepos_state,out_1)) @@ -862,8 +892,8 @@ static MACHINE_CONFIG_START( polepos, polepos_state ) MCFG_NAMCO_53XX_K_CB(READ8(polepos_state,namco_53xx_k_r)) MCFG_NAMCO_53XX_INPUT_0_CB(READ8(polepos_state,steering_changed_r)) MCFG_NAMCO_53XX_INPUT_1_CB(READ8(polepos_state,steering_delta_r)) - MCFG_NAMCO_53XX_INPUT_2_CB(IOPORT("DSWA")) - MCFG_NAMCO_53XX_INPUT_3_CB(IOPORT("DSWA_HI")) + MCFG_NAMCO_53XX_INPUT_2_CB(IOPORT("DSWA")) MCFG_DEVCB_MASK(0x0f) + MCFG_NAMCO_53XX_INPUT_3_CB(IOPORT("DSWA")) MCFG_DEVCB_RSHIFT(4) MCFG_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/8/2) /* 1.536 MHz */ MCFG_NAMCO_54XX_DISCRETE("discrete") @@ -942,8 +972,8 @@ static ADDRESS_MAP_START( topracern_io, AS_IO, 8, polepos_state ) // extra direct mapped inputs read AM_RANGE(0x02, 0x02) AM_READ_PORT("STEER") AM_WRITENOP AM_RANGE(0x03, 0x03) AM_READ_PORT("IN0") AM_DEVWRITE("dac", dac_byte_interface, write) - AM_RANGE(0x04, 0x04) AM_READ_PORT("DSWA") AM_WRITENOP - AM_RANGE(0x05, 0x05) AM_READ_PORT("DSWB") /* ??? */ AM_WRITE(bootleg_soundlatch_w) + AM_RANGE(0x04, 0x04) AM_READ_PORT("DSWA") AM_WRITENOP // explosion sound trigger + AM_RANGE(0x05, 0x05) AM_READ_PORT("DSWB") AM_WRITE(bootleg_soundlatch_w) ADDRESS_MAP_END static ADDRESS_MAP_START( sound_z80_bootleg_map, AS_PROGRAM, 8, polepos_state ) @@ -975,7 +1005,7 @@ static MACHINE_CONFIG_START( topracern, polepos_state ) /* doesn't exist on the bootleg, but required for now or the game only boots in test mode! they probably simulate some of the logic */ MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */ - MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0H")) + MCFG_NAMCO_51XX_INPUT_1_CB(IOPORT("IN0")) MCFG_DEVCB_RSHIFT(4) MCFG_NAMCO_06XX_ADD("06xx", MASTER_CLOCK/8/64) MCFG_NAMCO_06XX_MAINCPU("maincpu") @@ -2350,10 +2380,10 @@ GAME( 1982, poleposa2, polepos, polepos, poleposa, driver_device, 0, GAME( 1984, topracer, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1984)", 0 ) // the NAMCO customs have been cloned on these bootlegs GAME( 1983, topracera, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Top Racer (with MB8841 + MB8842, 1983)", 0 ) // the only difference between them is the year displayed on the title screen GAME( 1983, ppspeed, polepos, polepos, polepos, driver_device, 0, ROT0, "bootleg", "Speed Up (Spanish bootleg of Pole Position)", 0 ) // very close to topracer / topracera -GAME( 1982, topracern, polepos, topracern, topracern, driver_device, 0, ROT0, "bootleg", "Top Racer (no MB8841 + MB8842)", MACHINE_IMPERFECT_SOUND ) // is there any explosion sound generator here? +GAME( 1982, topracern, polepos, topracern, topracern, driver_device, 0, ROT0, "bootleg", "Top Racer (no MB8841 + MB8842)", MACHINE_IMPERFECT_SOUND ) // explosion sound generator missing GAME( 1983, polepos2, 0, polepos, polepos2j, polepos_state, polepos2, ROT0, "Namco", "Pole Position II (Japan)", 0 ) GAME( 1983, polepos2a, polepos2, polepos, polepos2, polepos_state, polepos2, ROT0, "Namco (Atari license)", "Pole Position II (Atari)", 0 ) GAME( 1983, polepos2b, polepos2, polepos, polepos2, driver_device, 0, ROT0, "bootleg", "Pole Position II (bootleg)", 0 ) -GAME( 1984, polepos2bi, polepos2, polepos2bi, topracern, driver_device, 0, ROT0, "bootleg", "Gran Premio F1 (Italian bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND ) -GAME( 1984, polepos2bs, polepos2, polepos2bi, topracern, driver_device, 0, ROT0, "BCN Internacional S.A.)", "Gran Premio F1 (Spanish bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND ) +GAME( 1984, polepos2bi, polepos2, polepos2bi, polepos2bi,driver_device, 0, ROT0, "bootleg", "Gran Premio F1 (Italian bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND ) +GAME( 1984, polepos2bs, polepos2, polepos2bi, polepos2bi,driver_device, 0, ROT0, "bootleg (BCN Internacional S.A.)", "Gran Premio F1 (Spanish bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h index cdfd6b4b704..c6c4f0dc5e3 100644 --- a/src/mame/includes/polepos.h +++ b/src/mame/includes/polepos.h @@ -106,8 +106,6 @@ public: DECLARE_WRITE16_MEMBER(polepos_alpha16_w); DECLARE_READ8_MEMBER(polepos_alpha_r); DECLARE_WRITE8_MEMBER(polepos_alpha_w); - DECLARE_CUSTOM_INPUT_MEMBER(high_port_r); - DECLARE_CUSTOM_INPUT_MEMBER(low_port_r); DECLARE_CUSTOM_INPUT_MEMBER(auto_start_r); DECLARE_WRITE8_MEMBER(out_0); DECLARE_WRITE8_MEMBER(out_1); diff --git a/src/mame/layout/polepos.lay b/src/mame/layout/polepos.lay index 50634fadfd5..91c82ed096b 100644 --- a/src/mame/layout/polepos.lay +++ b/src/mame/layout/polepos.lay @@ -52,7 +52,7 @@ - + @@ -61,7 +61,7 @@ - +