Previous 199869 Revisions Next

r33936 Wednesday 17th December, 2014 at 16:04:03 UTC by James Wallace
Attempt at fixing the new Stepper device to load correctly for AWP games. This is part 1 of a plan to remove the stepper_interface for a devcb2 setup.  [James Wallace]
[src/emu/machine]steppers.c steppers.h
[src/mame/drivers]bfm_sc2.c ecoinfr.c jpmimpct.c mpu4hw.c
[src/mame/includes]jpmimpct.h mpu4.h

trunk/src/emu/machine/steppers.c
r242447r242448
7575   7
7676};
7777
78const device_type STEPPER = &device_creator<stepper_device>;
7879
79
80stepper_device::stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
81      : device_t(mconfig, STEPPER, "Stepper Motor", tag, owner, clock, "stepper", __FILE__),
82      m_optic_cb(*this)
83   {
84   }   
8085///////////////////////////////////////////////////////////////////////////
8186void stepper_device::configure(const stepper_interface *intf)
8287{
trunk/src/emu/machine/steppers.h
r242447r242448
5252   devcb = &stepper_device::set_optic_handler(*device, DEVCB_##_write);
5353
5454class stepper_device;
55const device_type STEPPER = &device_creator<stepper_device>;
55extern const device_type STEPPER;
5656
5757class stepper_device : public device_t
5858{
5959public:
60   stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
61      : device_t(mconfig, STEPPER, "Stepper Motor", tag, owner, clock, "stepper", __FILE__),
62      m_optic_cb(*this)
63   { }
60   stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6461
6562   template<class _Object> static devcb_base &set_optic_handler(device_t &device, _Object object) { return downcast<stepper_device &>(device).m_optic_cb.set_callback(object); }
6663
trunk/src/mame/drivers/bfm_sc2.c
r242447r242448
193193         m_dm01(*this, "dm01") { }
194194
195195   required_device<cpu_device> m_maincpu;
196   required_device<stepper_device> m_reel0;
197   required_device<stepper_device> m_reel1;
198   required_device<stepper_device> m_reel2;
199   required_device<stepper_device> m_reel3;
200   required_device<stepper_device> m_reel4;
201   required_device<stepper_device> m_reel5;
202   required_device<upd7759_device> m_upd7759;
196   optional_device<stepper_device> m_reel0;
197   optional_device<stepper_device> m_reel1;
198   optional_device<stepper_device> m_reel2;
199   optional_device<stepper_device> m_reel3;
200   optional_device<stepper_device> m_reel4;
201   optional_device<stepper_device> m_reel5;
202   optional_device<upd7759_device> m_upd7759;
203203   optional_device<bfm_bd1_t> m_vfd0;
204204   optional_device<bfm_bd1_t> m_vfd1;
205205   optional_device<bfmdm01_device> m_dm01;
r242447r242448
21642164   MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz)
21652165   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
21662166
2167   MCFG_DEVICE_ADD("reel0", STEPPER, 0)
2168   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
2169   MCFG_DEVICE_ADD("reel1", STEPPER, 0)
2170   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
2171   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
2172   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
2173   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
2174   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))
2175   MCFG_DEVICE_ADD("reel4", STEPPER, 0)
2176   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
2177   MCFG_DEVICE_ADD("reel5", STEPPER, 0)
2178   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
2179
21802167MACHINE_CONFIG_END
21812168
21822169
r242447r242448
36263613
36273614   /* video hardware */
36283615   MCFG_DEFAULT_LAYOUT(layout_sc2_vfd)
3616   
3617   MCFG_DEVICE_ADD("reel0", STEPPER, 0)
3618   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
3619   MCFG_DEVICE_ADD("reel1", STEPPER, 0)
3620   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
3621   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
3622   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
3623   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
3624   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))   
3625   MCFG_DEVICE_ADD("reel4", STEPPER, 0)
3626   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
3627   MCFG_DEVICE_ADD("reel5", STEPPER, 0)
3628   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
36293629MACHINE_CONFIG_END
36303630
36313631
r242447r242448
36633663   MCFG_CPU_ADD("matrix", M6809, 2000000 )             /* matrix board 6809 CPU at 2 Mhz ?? I don't know the exact freq.*/
36643664   MCFG_CPU_PROGRAM_MAP(bfm_dm01_memmap)
36653665   MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, nmi_line_assert, 1500 )          /* generate 1500 NMI's per second ?? what is the exact freq?? */
3666   
3667   MCFG_DEVICE_ADD("reel0", STEPPER, 0)
3668   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
3669   MCFG_DEVICE_ADD("reel1", STEPPER, 0)
3670   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
3671   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
3672   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
3673   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
3674   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))   
3675   MCFG_DEVICE_ADD("reel4", STEPPER, 0)
3676   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
3677   MCFG_DEVICE_ADD("reel5", STEPPER, 0)
3678   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
36663679MACHINE_CONFIG_END
36673680
36683681void bfm_sc2_state::sc2awp_common_init(int reels, int decrypt)
trunk/src/mame/drivers/ecoinfr.c
r242447r242448
795795   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel1_optic_cb))
796796   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
797797   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel2_optic_cb))
798   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
799   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel3_optic_cb))   
798800MACHINE_CONFIG_END
799801
800802
trunk/src/mame/drivers/jpmimpct.c
r242447r242448
13311331   MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
13321332   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
13331333   MCFG_DEFAULT_LAYOUT(layout_jpmimpct)
1334   
1335   MCFG_DEVICE_ADD("reel0", STEPPER, 0)
1336   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel0_optic_cb))
1337   MCFG_DEVICE_ADD("reel1", STEPPER, 0)
1338   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel1_optic_cb))
1339   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
1340   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel2_optic_cb))
1341   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
1342   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel3_optic_cb))
1343   MCFG_DEVICE_ADD("reel4", STEPPER, 0)
1344   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel4_optic_cb))
1345   MCFG_DEVICE_ADD("reel5", STEPPER, 0)
1346   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel5_optic_cb))
1347   
13341348MACHINE_CONFIG_END
13351349
13361350
trunk/src/mame/drivers/mpu4hw.c
r242447r242448
26152615   MCFG_PIA_CB2_HANDLER(WRITELINE(mpu4_state, pia_ic8_cb2_w))
26162616   MCFG_PIA_IRQA_HANDLER(WRITELINE(mpu4_state, cpu0_irq))
26172617   MCFG_PIA_IRQB_HANDLER(WRITELINE(mpu4_state, cpu0_irq))
2618   
2619   
2620   MCFG_DEVICE_ADD("reel0", STEPPER, 0)
2621   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel0_optic_cb))
2622   MCFG_DEVICE_ADD("reel1", STEPPER, 0)
2623   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel1_optic_cb))
2624   MCFG_DEVICE_ADD("reel2", STEPPER, 0)
2625   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb))
2626   MCFG_DEVICE_ADD("reel3", STEPPER, 0)
2627   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb))   
2628   MCFG_DEVICE_ADD("reel4", STEPPER, 0)
2629   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb))
2630   MCFG_DEVICE_ADD("reel5", STEPPER, 0)
2631   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel5_optic_cb))
2632   MCFG_DEVICE_ADD("reel6", STEPPER, 0)
2633   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel6_optic_cb))
2634   MCFG_DEVICE_ADD("reel7", STEPPER, 0)
2635   MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel7_optic_cb))   
26182636MACHINE_CONFIG_END
26192637
26202638MACHINE_CONFIG_FRAGMENT( mpu4_common2 )
trunk/src/mame/includes/jpmimpct.h
r242447r242448
137137   required_device<upd7759_device> m_upd7759;
138138   optional_device<palette_device> m_palette;
139139   optional_device<tms34010_device> m_dsp;
140   required_device<stepper_device> m_reel0;
141   required_device<stepper_device> m_reel1;
142   required_device<stepper_device> m_reel2;
143   required_device<stepper_device> m_reel3;
144   required_device<stepper_device> m_reel4;
145   required_device<stepper_device> m_reel5;
140   optional_device<stepper_device> m_reel0;
141   optional_device<stepper_device> m_reel1;
142   optional_device<stepper_device> m_reel2;
143   optional_device<stepper_device> m_reel3;
144   optional_device<stepper_device> m_reel4;
145   optional_device<stepper_device> m_reel5;
146146};
trunk/src/mame/includes/mpu4.h
r242447r242448
212212   DECLARE_MACHINE_START(mpu4bwb);
213213   DECLARE_MACHINE_START(mpu4cry);
214214   TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz);
215
215   DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; }
216   DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; }
217   DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; }
218   DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; }
219   DECLARE_WRITE_LINE_MEMBER(reel4_optic_cb) { if (state) m_optic_pattern |= 0x10; else m_optic_pattern &= ~0x10; }
220   DECLARE_WRITE_LINE_MEMBER(reel5_optic_cb) { if (state) m_optic_pattern |= 0x20; else m_optic_pattern &= ~0x20; }
221   DECLARE_WRITE_LINE_MEMBER(reel6_optic_cb) { if (state) m_optic_pattern |= 0x40; else m_optic_pattern &= ~0x40; }
222   DECLARE_WRITE_LINE_MEMBER(reel7_optic_cb) { if (state) m_optic_pattern |= 0x80; else m_optic_pattern &= ~0x80; }
216223protected:
217224   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
218225
r242447r242448
249256   required_ioport m_aux2_port;
250257   optional_memory_bank m_bank1;
251258   optional_device<okim6376_device> m_msm6376;
252   required_device<stepper_device> m_reel0;
253   required_device<stepper_device> m_reel1;
254   required_device<stepper_device> m_reel2;
255   required_device<stepper_device> m_reel3;
256   required_device<stepper_device> m_reel4;
257   required_device<stepper_device> m_reel5;
258   required_device<stepper_device> m_reel6;
259   required_device<stepper_device> m_reel7;
259   optional_device<stepper_device> m_reel0;
260   optional_device<stepper_device> m_reel1;
261   optional_device<stepper_device> m_reel2;
262   optional_device<stepper_device> m_reel3;
263   optional_device<stepper_device> m_reel4;
264   optional_device<stepper_device> m_reel5;
265   optional_device<stepper_device> m_reel6;
266   optional_device<stepper_device> m_reel7;
260267
261268   enum
262269   {
r242447r242448
295302   UINT8 m_led_strobe;
296303   UINT8 m_ay_data;
297304   int m_optic_pattern;
298   DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; }
299   DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; }
300   DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; }
301   DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; }
302   DECLARE_WRITE_LINE_MEMBER(reel4_optic_cb) { if (state) m_optic_pattern |= 0x10; else m_optic_pattern &= ~0x10; }
303   DECLARE_WRITE_LINE_MEMBER(reel5_optic_cb) { if (state) m_optic_pattern |= 0x20; else m_optic_pattern &= ~0x20; }
304   DECLARE_WRITE_LINE_MEMBER(reel6_optic_cb) { if (state) m_optic_pattern |= 0x40; else m_optic_pattern &= ~0x40; }
305   DECLARE_WRITE_LINE_MEMBER(reel7_optic_cb) { if (state) m_optic_pattern |= 0x80; else m_optic_pattern &= ~0x80; }
305
306306   int m_active_reel;
307307   int m_remote_meter;
308308   int m_reel_mux;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team