From 7092c6a3721654fde7e20bf2869d87b572afa233 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 14 Dec 2012 11:39:53 +0000 Subject: [PATCH] schaser : cleaned up cocktail mode schasercv : fixed 2nd player in upright cab --- src/mame/audio/8080bw.c | 18 +++++++++--------- src/mame/drivers/8080bw.c | 21 +++++++++++++-------- src/mame/includes/8080bw.h | 1 + 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c index a37c56ca163..35850ce89a8 100644 --- a/src/mame/audio/8080bw.c +++ b/src/mame/audio/8080bw.c @@ -897,14 +897,14 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_1_w) if (!m_schaser_effect_555_is_low) { m_schaser_effect_555_time_remain = m_schaser_effect_555_timer->time_left(); - m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double(); + m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double(); m_schaser_effect_555_timer->adjust(attotime::never); } } m_schaser_last_effect = effect; } - m_schaser_explosion = (data >> 5) & 0x01; + m_schaser_explosion = BIT(data, 5); if (m_schaser_explosion) { sn76477_amplitude_res_w(m_sn, 1.0 / (1.0/RES_K(200) + 1.0/RES_K(68))); @@ -929,17 +929,17 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_2_w) //printf( "schaser_sh_port_2_w: %02x\n", data ); - discrete_sound_w(m_discrete, space, SCHASER_MUSIC_BIT, data & 0x01); + discrete_sound_w(m_discrete, space, SCHASER_MUSIC_BIT, BIT(data, 0)); - discrete_sound_w(m_discrete, space, SCHASER_SND_EN, data & 0x02); - machine().sound().system_enable(data & 0x02); + discrete_sound_w(m_discrete, space, SCHASER_SND_EN, BIT(data, 1)); + machine().sound().system_enable(BIT(data, 1)); - coin_lockout_global_w(machine(), data & 0x04); + coin_lockout_global_w(machine(), BIT(data, 2)); - m_schaser_background_disable = (data >> 3) & 0x01; - m_schaser_background_select = (data >> 4) & 0x01; + m_schaser_background_disable = BIT(data, 3); + m_schaser_background_select = BIT(data, 4); - m_c8080bw_flip_screen = (data & 0x20) && (ioport(CABINET_PORT_TAG)->read() & 0x01); + m_c8080bw_flip_screen = BIT(data, 5) & BIT(ioport("IN2")->read(), 6); m_port_2_last_extra = data; } diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c index 3dd88f15752..f8a4efba00d 100644 --- a/src/mame/drivers/8080bw.c +++ b/src/mame/drivers/8080bw.c @@ -1176,15 +1176,11 @@ static INPUT_PORTS_START( schaser ) // Name Reset - if name of high scorer was rude, owner can press this button PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Name Reset") PORT_CODE(KEYCODE_F1) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_TILT ) - PORT_DIPNAME( 0x40, 0x00, "Number of Controllers" ) PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPSETTING( 0x40, "2" ) + PORT_DIPNAME( 0x40, 0x00, "Cabinet" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, "Upright" ) + PORT_DIPSETTING( 0x40, "Cocktail" ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - // port 3 (all 8 bits) connected to custom chip MB14241 driven by out port 2 and 4 - // To get cocktail mode, turn this on, and choose 2 controllers. - INVADERS_CAB_TYPE_PORT /* Dummy port for cocktail mode */ - PORT_START("VR1") PORT_ADJUSTER( 70, "VR1 - Music Volume" ) @@ -1247,10 +1243,19 @@ MACHINE_CONFIG_END /* */ /*******************************************************/ + +READ8_MEMBER( _8080bw_state::schasercv_02_r ) +{ + UINT8 data = ioport("IN2")->read(); + if (m_c8080bw_flip_screen) return data; + UINT8 in1 = ioport("IN1")->read(); + return (data & 0x89) | (in1 & 0x70) | (BIT(in1, 3) << 1) | (BIT(in1, 7) << 2); +} + static ADDRESS_MAP_START( schasercv_io_map, AS_IO, 8, _8080bw_state ) AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") - AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) + AM_RANGE(0x02, 0x02) AM_READ(schasercv_02_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w) AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(schasercv_sh_port_1_w) AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w) AM_RANGE(0x05, 0x05) AM_WRITE(schasercv_sh_port_2_w) diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h index d0c67b1cb1e..59132200c15 100644 --- a/src/mame/includes/8080bw.h +++ b/src/mame/includes/8080bw.h @@ -74,6 +74,7 @@ public: DECLARE_WRITE8_MEMBER(lupin3_00_w); DECLARE_WRITE8_MEMBER(lupin3_sh_port_1_w); DECLARE_WRITE8_MEMBER(lupin3_sh_port_2_w); + DECLARE_READ8_MEMBER(schasercv_02_r); DECLARE_WRITE8_MEMBER(schasercv_sh_port_1_w); DECLARE_WRITE8_MEMBER(schasercv_sh_port_2_w); DECLARE_WRITE8_MEMBER(yosakdon_sh_port_1_w);