summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/hh_cop400.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/hh_cop400.cpp')
-rw-r--r--src/mame/drivers/hh_cop400.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index f44587a415f..a6de1accb5e 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -669,10 +669,15 @@ class lchicken_state : public hh_cop400_state
{
public:
lchicken_state(const machine_config &mconfig, device_type type, const char *tag) :
- hh_cop400_state(mconfig, type, tag)
+ hh_cop400_state(mconfig, type, tag),
+ m_motor_pos_out(*this, "motor_pos"),
+ m_motor_on_out(*this, "motor_on")
{ }
- u8 m_motor_pos;
+ output_finder<> m_motor_pos_out;
+ output_finder<> m_motor_on_out;
+
+ u8 m_motor_pos = 0;
TIMER_DEVICE_CALLBACK_MEMBER(motor_sim_tick);
DECLARE_READ_LINE_MEMBER(motor_switch_r);
@@ -692,8 +697,10 @@ void lchicken_state::machine_start()
{
hh_cop400_state::machine_start();
- // zerofill, register for savestates
- m_motor_pos = 0;
+ m_motor_pos_out.resolve();
+ m_motor_on_out.resolve();
+
+ // register for savestates
save_item(NAME(m_motor_pos));
}
@@ -709,7 +716,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(lchicken_state::motor_sim_tick)
if (~m_inp_mux & 8)
{
m_motor_pos++;
- output().set_value("motor_pos", 100 * (m_motor_pos / (float)0x100));
+ m_motor_pos_out = 100 * (m_motor_pos / (float)0x100);
}
}
@@ -726,7 +733,7 @@ void lchicken_state::write_d(u8 data)
// D0-D3: input mux
// D3: motor on
m_inp_mux = data & 0xf;
- output().set_value("motor_on", ~data >> 3 & 1);
+ m_motor_on_out = ~data >> 3 & 1;
}
void lchicken_state::write_g(u8 data)