summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mpu3.cpp
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2016-01-05 00:04:58 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2016-01-05 00:04:58 +0100
commitf1d75fd96d0a7c9f87403234456264fcd0e4f483 (patch)
tree42b0497ef9c35645a49011364a11f785fcf2771a /src/mame/drivers/mpu3.cpp
parent4d1df2f42e038d75c429f353e907045784ba27d6 (diff)
meters.cpp: Initial device-ification, fixes MT06117 (nw)
Diffstat (limited to 'src/mame/drivers/mpu3.cpp')
-rw-r--r--src/mame/drivers/mpu3.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp
index 3c83986c401..be5ead09948 100644
--- a/src/mame/drivers/mpu3.cpp
+++ b/src/mame/drivers/mpu3.cpp
@@ -133,51 +133,50 @@ class mpu3_state : public driver_device
public:
mpu3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_vfd(*this, "vfd"),
m_maincpu(*this, "maincpu"),
m_reel0(*this, "reel0"),
m_reel1(*this, "reel1"),
m_reel2(*this, "reel2"),
- m_reel3(*this, "reel3")
+ m_reel3(*this, "reel3"),
+ m_meters(*this, "meters"),
+ m_vfd(*this, "vfd")
{ }
- optional_device<roc10937_t> m_vfd;
-
-
-int m_triac_ic3;
-int m_triac_ic4;
-int m_triac_ic5;
-int m_ic3_data;
-int m_IC11G1;
-int m_IC11G2A;
-int m_IC11G2B;
-int m_IC11GC;
-int m_IC11GB;
-int m_IC11GA;
-
-int m_ic10_output;
-int m_ic11_active;
-int m_ic11_output;
-int m_disp_func;
-
-int m_ic4_input_a;
-int m_aux1_input;
-int m_aux2_input;
-int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */
-UINT8 m_lamp_strobe;
-UINT8 m_led_strobe;
-int m_signal_50hz;
-const mpu3_chr_table* m_current_chr_table;
-int m_prot_col;
-
-int m_optic_pattern;
+ int m_triac_ic3;
+ int m_triac_ic4;
+ int m_triac_ic5;
+ int m_ic3_data;
+ int m_IC11G1;
+ int m_IC11G2A;
+ int m_IC11G2B;
+ int m_IC11GC;
+ int m_IC11GB;
+ int m_IC11GA;
+
+ int m_ic10_output;
+ int m_ic11_active;
+ int m_ic11_output;
+ int m_disp_func;
+
+ int m_ic4_input_a;
+ int m_aux1_input;
+ int m_aux2_input;
+ int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */
+ UINT8 m_lamp_strobe;
+ UINT8 m_led_strobe;
+ int m_signal_50hz;
+
+ const mpu3_chr_table* m_current_chr_table;
+ int m_prot_col;
+
+ int m_optic_pattern;
DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; }
DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; }
DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; }
DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; }
-emu_timer *m_ic21_timer;
+ emu_timer *m_ic21_timer;
DECLARE_WRITE8_MEMBER(characteriser_w);
DECLARE_READ8_MEMBER(characteriser_r);
DECLARE_WRITE8_MEMBER(mpu3ptm_w);
@@ -219,6 +218,8 @@ emu_timer *m_ic21_timer;
required_device<stepper_device> m_reel1;
required_device<stepper_device> m_reel2;
required_device<stepper_device> m_reel3;
+ required_device<meters_device> m_meters;
+ optional_device<roc10937_t> m_vfd;
};
#define DISPLAY_PORT 0
@@ -462,7 +463,7 @@ WRITE8_MEMBER(mpu3_state::pia_ic4_porta_w)
for (meter = 0; meter < 6; meter ++)
{
swizzle = ((m_ic4_input_a ^ 0xff) & 0x3f);
- MechMtr_update(meter, (swizzle & (1 << meter)));
+ m_meters->update(meter, (swizzle & (1 << meter)));
}
break;
@@ -696,10 +697,6 @@ void mpu3_state::mpu3_config_common()
void mpu3_state::machine_start()
{
mpu3_config_common();
-
- /* setup 8 mechanical meters */
- MechMtr_config(machine(),8);
-
}
/*
Characteriser (CHR)
@@ -859,6 +856,9 @@ static MACHINE_CONFIG_START( mpu3base, mpu3_state )
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel2_optic_cb))
MCFG_MPU3_REEL_ADD("reel3")
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu3_state, reel3_optic_cb))
+
+ MCFG_DEVICE_ADD("meters", METERS, 0)
+ MCFG_METERS_NUMBER(8)
MCFG_NVRAM_ADD_0FILL("nvram")