summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/carpolo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/carpolo.cpp')
-rw-r--r--src/mame/machine/carpolo.cpp58
1 files changed, 23 insertions, 35 deletions
diff --git a/src/mame/machine/carpolo.cpp b/src/mame/machine/carpolo.cpp
index 721e23cbda1..636987a260b 100644
--- a/src/mame/machine/carpolo.cpp
+++ b/src/mame/machine/carpolo.cpp
@@ -253,30 +253,16 @@ INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
/* finally read the accelerator pedals */
port_value = ioport("PEDALS")->read();
- for (player = 0; player < 4; player++)
- {
- /* one line indicates if the pedal is pressed and the other
- how much, resulting in only two different possible levels */
- if (port_value & 0x01)
- {
- m_ttl74153_1k->input_line_w(0, player, 1);
- m_ttl74153_1k->input_line_w(1, player, 0);
- }
- else if (port_value & 0x02)
- {
- m_ttl74153_1k->input_line_w(0, player, 1);
- m_ttl74153_1k->input_line_w(1, player, 1);
- }
- else
- {
- m_ttl74153_1k->input_line_w(0, player, 0);
- /* the other line is irrelevant */
- }
-
- port_value >>= 2;
- }
-
- m_ttl74153_1k->update();
+ // one line indicates if the pedal is pressed and the other
+ // how much, resulting in only two different possible levels
+ m_ttl74153_1k->i0a_w(BIT(port_value, 0) | BIT(port_value, 1));
+ m_ttl74153_1k->i1a_w(BIT(port_value, 2) | BIT(port_value, 3));
+ m_ttl74153_1k->i2a_w(BIT(port_value, 4) | BIT(port_value, 5));
+ m_ttl74153_1k->i3a_w(BIT(port_value, 6) | BIT(port_value, 7));
+ m_ttl74153_1k->i0b_w(BIT(port_value, 1));
+ m_ttl74153_1k->i1b_w(BIT(port_value, 3));
+ m_ttl74153_1k->i2b_w(BIT(port_value, 5));
+ m_ttl74153_1k->i3b_w(BIT(port_value, 7));
}
// FIXME: Remove trampolines
@@ -344,6 +330,16 @@ WRITE8_MEMBER(carpolo_state::carpolo_timer_interrupt_clear_w)
*
*************************************/
+WRITE_LINE_MEMBER( carpolo_state::ls153_za_w )
+{
+ m_ls153_za = state;
+}
+
+WRITE_LINE_MEMBER( carpolo_state::ls153_zb_w )
+{
+ m_ls153_zb = state;
+}
+
WRITE8_MEMBER(carpolo_state::pia_0_port_a_w)
{
/* bit 0 - Coin counter
@@ -374,10 +370,8 @@ WRITE8_MEMBER(carpolo_state::pia_0_port_b_w)
bit 6 - Select pedal 0
bit 7 - Select pdeal 1 */
- m_ttl74153_1k->a_w(data & 0x40);
- m_ttl74153_1k->b_w(data & 0x80);
-
- m_ttl74153_1k->update();
+ m_ttl74153_1k->s0_w(BIT(data, 6));
+ m_ttl74153_1k->s1_w(BIT(data, 7));
}
READ8_MEMBER(carpolo_state::pia_0_port_b_r)
@@ -385,8 +379,7 @@ READ8_MEMBER(carpolo_state::pia_0_port_b_r)
/* bit 4 - Pedal bit 0
bit 5 - Pedal bit 1 */
- return (m_ttl74153_1k->output_r(0) << 5) |
- (m_ttl74153_1k->output_r(1) << 4);
+ return (m_ls153_za << 5) | (m_ls153_zb << 4);
}
@@ -486,9 +479,4 @@ void carpolo_state::machine_reset()
m_ttl7474_1a_2->clear_w (1);
m_ttl7474_1a_2->preset_w(1);
-
-
- /* set up the pedal handling chips */
- m_ttl74153_1k->enable_w(0, 0);
- m_ttl74153_1k->enable_w(1, 0);
}