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]

This commit is contained in:
James Wallace 2014-12-17 16:03:36 +00:00
parent 37d1ed1a22
commit b8da0e5e89
8 changed files with 98 additions and 49 deletions

View File

@ -75,8 +75,13 @@ const stepper_interface ecoin_interface_200step_reel =
7
};
const device_type STEPPER = &device_creator<stepper_device>;
stepper_device::stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, STEPPER, "Stepper Motor", tag, owner, clock, "stepper", __FILE__),
m_optic_cb(*this)
{
}
///////////////////////////////////////////////////////////////////////////
void stepper_device::configure(const stepper_interface *intf)
{

View File

@ -52,15 +52,12 @@ extern const stepper_interface ecoin_interface_200step_reel;
devcb = &stepper_device::set_optic_handler(*device, DEVCB_##_write);
class stepper_device;
const device_type STEPPER = &device_creator<stepper_device>;
extern const device_type STEPPER;
class stepper_device : public device_t
{
public:
stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, STEPPER, "Stepper Motor", tag, owner, clock, "stepper", __FILE__),
m_optic_cb(*this)
{ }
stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
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); }

View File

@ -193,13 +193,13 @@ public:
m_dm01(*this, "dm01") { }
required_device<cpu_device> m_maincpu;
required_device<stepper_device> m_reel0;
required_device<stepper_device> m_reel1;
required_device<stepper_device> m_reel2;
required_device<stepper_device> m_reel3;
required_device<stepper_device> m_reel4;
required_device<stepper_device> m_reel5;
required_device<upd7759_device> m_upd7759;
optional_device<stepper_device> m_reel0;
optional_device<stepper_device> m_reel1;
optional_device<stepper_device> m_reel2;
optional_device<stepper_device> m_reel3;
optional_device<stepper_device> m_reel4;
optional_device<stepper_device> m_reel5;
optional_device<upd7759_device> m_upd7759;
optional_device<bfm_bd1_t> m_vfd0;
optional_device<bfm_bd1_t> m_vfd1;
optional_device<bfmdm01_device> m_dm01;
@ -2164,19 +2164,6 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADD("reel0", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
MCFG_DEVICE_ADD("reel1", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))
MCFG_DEVICE_ADD("reel4", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
MCFG_DEVICE_ADD("reel5", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
MACHINE_CONFIG_END
@ -3626,6 +3613,19 @@ static MACHINE_CONFIG_START( scorpion2, bfm_sc2_state )
/* video hardware */
MCFG_DEFAULT_LAYOUT(layout_sc2_vfd)
MCFG_DEVICE_ADD("reel0", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
MCFG_DEVICE_ADD("reel1", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))
MCFG_DEVICE_ADD("reel4", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
MCFG_DEVICE_ADD("reel5", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
MACHINE_CONFIG_END
@ -3663,6 +3663,19 @@ static MACHINE_CONFIG_START( scorpion2_dm01, bfm_sc2_state )
MCFG_CPU_ADD("matrix", M6809, 2000000 ) /* matrix board 6809 CPU at 2 Mhz ?? I don't know the exact freq.*/
MCFG_CPU_PROGRAM_MAP(bfm_dm01_memmap)
MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, nmi_line_assert, 1500 ) /* generate 1500 NMI's per second ?? what is the exact freq?? */
MCFG_DEVICE_ADD("reel0", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb))
MCFG_DEVICE_ADD("reel1", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb))
MCFG_DEVICE_ADD("reel4", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb))
MCFG_DEVICE_ADD("reel5", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel5_optic_cb))
MACHINE_CONFIG_END
void bfm_sc2_state::sc2awp_common_init(int reels, int decrypt)

View File

@ -795,6 +795,8 @@ static MACHINE_CONFIG_START( ecoinfr, ecoinfr_state )
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel3_optic_cb))
MACHINE_CONFIG_END

View File

@ -1331,6 +1331,20 @@ MACHINE_CONFIG_START( impctawp, jpmimpct_state )
MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_DEFAULT_LAYOUT(layout_jpmimpct)
MCFG_DEVICE_ADD("reel0", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel0_optic_cb))
MCFG_DEVICE_ADD("reel1", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel3_optic_cb))
MCFG_DEVICE_ADD("reel4", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel4_optic_cb))
MCFG_DEVICE_ADD("reel5", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel5_optic_cb))
MACHINE_CONFIG_END

View File

@ -2615,6 +2615,24 @@ MACHINE_CONFIG_FRAGMENT( mpu4_common )
MCFG_PIA_CB2_HANDLER(WRITELINE(mpu4_state, pia_ic8_cb2_w))
MCFG_PIA_IRQA_HANDLER(WRITELINE(mpu4_state, cpu0_irq))
MCFG_PIA_IRQB_HANDLER(WRITELINE(mpu4_state, cpu0_irq))
MCFG_DEVICE_ADD("reel0", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel0_optic_cb))
MCFG_DEVICE_ADD("reel1", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel1_optic_cb))
MCFG_DEVICE_ADD("reel2", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb))
MCFG_DEVICE_ADD("reel3", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb))
MCFG_DEVICE_ADD("reel4", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb))
MCFG_DEVICE_ADD("reel5", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel5_optic_cb))
MCFG_DEVICE_ADD("reel6", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel6_optic_cb))
MCFG_DEVICE_ADD("reel7", STEPPER, 0)
MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel7_optic_cb))
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( mpu4_common2 )

View File

@ -137,10 +137,10 @@ public:
required_device<upd7759_device> m_upd7759;
optional_device<palette_device> m_palette;
optional_device<tms34010_device> m_dsp;
required_device<stepper_device> m_reel0;
required_device<stepper_device> m_reel1;
required_device<stepper_device> m_reel2;
required_device<stepper_device> m_reel3;
required_device<stepper_device> m_reel4;
required_device<stepper_device> m_reel5;
optional_device<stepper_device> m_reel0;
optional_device<stepper_device> m_reel1;
optional_device<stepper_device> m_reel2;
optional_device<stepper_device> m_reel3;
optional_device<stepper_device> m_reel4;
optional_device<stepper_device> m_reel5;
};

View File

@ -212,7 +212,14 @@ public:
DECLARE_MACHINE_START(mpu4bwb);
DECLARE_MACHINE_START(mpu4cry);
TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz);
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; }
DECLARE_WRITE_LINE_MEMBER(reel4_optic_cb) { if (state) m_optic_pattern |= 0x10; else m_optic_pattern &= ~0x10; }
DECLARE_WRITE_LINE_MEMBER(reel5_optic_cb) { if (state) m_optic_pattern |= 0x20; else m_optic_pattern &= ~0x20; }
DECLARE_WRITE_LINE_MEMBER(reel6_optic_cb) { if (state) m_optic_pattern |= 0x40; else m_optic_pattern &= ~0x40; }
DECLARE_WRITE_LINE_MEMBER(reel7_optic_cb) { if (state) m_optic_pattern |= 0x80; else m_optic_pattern &= ~0x80; }
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@ -249,14 +256,14 @@ protected:
required_ioport m_aux2_port;
optional_memory_bank m_bank1;
optional_device<okim6376_device> m_msm6376;
required_device<stepper_device> m_reel0;
required_device<stepper_device> m_reel1;
required_device<stepper_device> m_reel2;
required_device<stepper_device> m_reel3;
required_device<stepper_device> m_reel4;
required_device<stepper_device> m_reel5;
required_device<stepper_device> m_reel6;
required_device<stepper_device> m_reel7;
optional_device<stepper_device> m_reel0;
optional_device<stepper_device> m_reel1;
optional_device<stepper_device> m_reel2;
optional_device<stepper_device> m_reel3;
optional_device<stepper_device> m_reel4;
optional_device<stepper_device> m_reel5;
optional_device<stepper_device> m_reel6;
optional_device<stepper_device> m_reel7;
enum
{
@ -295,14 +302,7 @@ protected:
UINT8 m_led_strobe;
UINT8 m_ay_data;
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; }
DECLARE_WRITE_LINE_MEMBER(reel4_optic_cb) { if (state) m_optic_pattern |= 0x10; else m_optic_pattern &= ~0x10; }
DECLARE_WRITE_LINE_MEMBER(reel5_optic_cb) { if (state) m_optic_pattern |= 0x20; else m_optic_pattern &= ~0x20; }
DECLARE_WRITE_LINE_MEMBER(reel6_optic_cb) { if (state) m_optic_pattern |= 0x40; else m_optic_pattern &= ~0x40; }
DECLARE_WRITE_LINE_MEMBER(reel7_optic_cb) { if (state) m_optic_pattern |= 0x80; else m_optic_pattern &= ~0x80; }
int m_active_reel;
int m_remote_meter;
int m_reel_mux;