From a6ea64e6a545632098a3f9fe46dca4565843f3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Sun, 21 Sep 2014 01:35:27 +0000 Subject: [PATCH] zerotm2k inputs --- src/mame/audio/seibu.h | 14 +++++++-- src/mame/drivers/r2dx_v33.c | 61 +++++++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h index b9ed990a5aa..c275915f06a 100644 --- a/src/mame/audio/seibu.h +++ b/src/mame/audio/seibu.h @@ -138,13 +138,23 @@ extern const device_type SEIBU_ADPCM; PORT_START("COIN") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4) \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4) \ - PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) #define SEIBU_COIN_INPUTS_INVERT \ PORT_START("COIN") \ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(4) \ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(4) \ - PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) \ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) #define SEIBU_SOUND_SYSTEM_CPU(freq) \ diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c index 167a1ddbe06..45886d3fc8e 100644 --- a/src/mame/drivers/r2dx_v33.c +++ b/src/mame/drivers/r2dx_v33.c @@ -456,7 +456,7 @@ WRITE16_MEMBER(r2dx_v33_state::zerotm2k_eeprom_w) static ADDRESS_MAP_START( zerotm2k_map, AS_PROGRAM, 16, r2dx_v33_state ) AM_IMPORT_FROM( nzeroteam_base_map ) - AM_RANGE(0x00740, 0x00741) AM_READ_PORT("DSW") // doesn't have dips but address is still read (maybe service switch, check) + AM_RANGE(0x00740, 0x00741) AM_READ_PORT("P3_P4") AM_RANGE(0x00744, 0x00745) AM_READ_PORT("INPUT") AM_RANGE(0x0074c, 0x0074d) AM_READ_PORT("SYSTEM") AM_RANGE(0x00748, 0x00749) AM_WRITE(zerotm2k_eeprom_w) @@ -561,7 +561,8 @@ static INPUT_PORTS_START( nzerotea ) PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" ) PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("INPUT") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) @@ -637,10 +638,58 @@ static INPUT_PORTS_START( nzerotea ) INPUT_PORTS_END static INPUT_PORTS_START( zerotm2k ) - PORT_INCLUDE( nzerotea ) - - PORT_MODIFY("INPUT") + SEIBU_COIN_INPUTS_INVERT /* coin inputs read through sound cpu */ + + PORT_MODIFY("COIN") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_IMPULSE(4) + + PORT_START("SYSTEM") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START4 ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("INPUT") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) + + PORT_START("P3_P4") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -694,7 +743,7 @@ static MACHINE_CONFIG_START( rdx_v33, r2dx_v33_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz/28, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MCFG_DEVICE_ADDRESS_MAP(AS_0, r2dx_oki_map) MACHINE_CONFIG_END