legacy timer device callback removed (nw)

This commit is contained in:
Miodrag Milanovic 2014-04-21 09:26:41 +00:00
parent ff6c78345d
commit 019ef6e963
6 changed files with 40 additions and 57 deletions

View File

@ -24,25 +24,15 @@
//**************************************************************************
// macros for a timer callback functions
#define TIMER_DEVICE_CALLBACK(name) void name(device_t *, timer_device &timer, void *ptr, INT32 param)
#define TIMER_DEVICE_CALLBACK_MEMBER(name) void name(timer_device &timer, void *ptr, INT32 param)
//**************************************************************************
// TIMER DEVICE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_TIMER_ADD(_tag, _callback) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_callback, #_callback));
#define MCFG_TIMER_ADD_NONE(_tag) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
timer_device::static_configure_generic(*device, timer_device_expired_delegate());
#define MCFG_TIMER_ADD_PERIODIC(_tag, _callback, _period) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
timer_device::static_configure_periodic(*device, timer_device_expired_delegate(&_callback, #_callback), _period);
#define MCFG_TIMER_ADD_SCANLINE(_tag, _callback, _screen, _first_vpos, _increment) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
timer_device::static_configure_scanline(*device, timer_device_expired_delegate(&_callback, #_callback), _screen, _first_vpos, _increment);
#define MCFG_TIMER_DRIVER_ADD(_tag, _class, _callback) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0));
@ -64,8 +54,6 @@
#define MCFG_TIMER_MODIFY(_tag) \
MCFG_DEVICE_MODIFY(_tag)
#define MCFG_TIMER_CALLBACK(_callback) \
timer_device::static_set_callback(*device, timer_device_expired_delegate(&_callback, #_callback));
#define MCFG_TIMER_DRIVER_CALLBACK(_class, _callback) \
timer_device::static_set_callback(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0));
#define MCFG_TIMER_START_DELAY(_start_delay) \

View File

@ -1424,13 +1424,13 @@ static MACHINE_CONFIG_FRAGMENT( ds3 )
MCFG_ADSP21XX_CONFIG(ds3sdsp_config)
MCFG_CPU_PROGRAM_MAP(ds3sdsp_program_map)
MCFG_CPU_DATA_MAP(ds3sdsp_data_map)
MCFG_TIMER_ADD("ds3sdsp_timer", ds3sdsp_internal_timer_callback)
MCFG_TIMER_DRIVER_ADD("ds3sdsp_timer", harddriv_state, ds3sdsp_internal_timer_callback)
MCFG_CPU_ADD("ds3xdsp", ADSP2105, XTAL_10MHz)
MCFG_ADSP21XX_CONFIG(ds3xdsp_config)
MCFG_CPU_PROGRAM_MAP(ds3xdsp_program_map)
MCFG_CPU_DATA_MAP(ds3xdsp_data_map)
MCFG_TIMER_ADD("ds3xdsp_timer", ds3xdsp_internal_timer_callback)
MCFG_TIMER_DRIVER_ADD("ds3xdsp_timer", harddriv_state, ds3xdsp_internal_timer_callback)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

View File

@ -205,6 +205,9 @@ public:
DECLARE_DRIVER_INIT(vbowl);
DECLARE_DRIVER_INIT(vbowlj);
DECLARE_DRIVER_INIT(ryukobou);
TIMER_DEVICE_CALLBACK_MEMBER(lev5_timer_irq_cb);
TIMER_DEVICE_CALLBACK_MEMBER(lhb_timer_irq_cb);
TIMER_DEVICE_CALLBACK_MEMBER(lev3_timer_irq_cb);
virtual void video_start();
UINT32 screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_vbowl(screen_device &screen, bool state);
@ -3950,18 +3953,16 @@ static MACHINE_CONFIG_START( igs011_base, igs011_state )
MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK ( lev5_timer_irq_cb )
TIMER_DEVICE_CALLBACK_MEMBER( igs011_state::lev5_timer_irq_cb )
{
igs011_state *state = timer.machine().driver_data<igs011_state>();
state->m_maincpu->set_input_line(5, HOLD_LINE);
m_maincpu->set_input_line(5, HOLD_LINE);
}
static MACHINE_CONFIG_DERIVED( drgnwrld, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(drgnwrld)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
@ -3982,30 +3983,27 @@ INTERRUPT_GEN_MEMBER(igs011_state::lhb_vblank_irq)
m_maincpu->set_input_line(6, HOLD_LINE);
}
static TIMER_DEVICE_CALLBACK ( lhb_timer_irq_cb )
TIMER_DEVICE_CALLBACK_MEMBER( igs011_state::lhb_timer_irq_cb )
{
igs011_state *state = timer.machine().driver_data<igs011_state>();
if (!state->m_lhb_irq_enable)
if (!m_lhb_irq_enable)
return;
state->m_maincpu->set_input_line(5, HOLD_LINE);
m_maincpu->set_input_line(5, HOLD_LINE);
}
static MACHINE_CONFIG_DERIVED( lhb, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(lhb)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, lhb_vblank_irq)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lhb_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lhb_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
// irq 3 points to an apparently unneeded routine
MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK ( lev3_timer_irq_cb )
TIMER_DEVICE_CALLBACK_MEMBER( igs011_state::lev3_timer_irq_cb )
{
igs011_state *state = timer.machine().driver_data<igs011_state>();
state->m_maincpu->set_input_line(3, HOLD_LINE);
m_maincpu->set_input_line(3, HOLD_LINE);
}
@ -4013,7 +4011,7 @@ static MACHINE_CONFIG_DERIVED( wlcc, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(wlcc)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MACHINE_CONFIG_END
@ -4022,7 +4020,7 @@ static MACHINE_CONFIG_DERIVED( xymg, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(xymg)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MACHINE_CONFIG_END
@ -4031,7 +4029,7 @@ static MACHINE_CONFIG_DERIVED( lhb2, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(lhb2)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev5_timer_irq_cb, attotime::from_hz(240)) // lev5 frequency drives the music tempo
// MCFG_GFXDECODE_ADD("gfxdecode", "palette", igs011_hi)
@ -4045,7 +4043,7 @@ static MACHINE_CONFIG_DERIVED( nkishusp, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(nkishusp)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
// VSync 60.0052Hz, HSync 15.620kHz
@ -4066,7 +4064,7 @@ static MACHINE_CONFIG_DERIVED( vbowl, igs011_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(vbowl)
MCFG_CPU_VBLANK_INT_DRIVER("screen", igs011_state, irq6_line_hold)
MCFG_TIMER_ADD_PERIODIC("timer_irq", lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", igs011_state, lev3_timer_irq_cb, attotime::from_hz(240)) // lev3 frequency drives the music tempo
// irq 5 points to a debug function (all routines are clearly patched out)
// irq 4 points to an apparently unneeded routine

View File

@ -114,6 +114,7 @@ public:
DECLARE_WRITE16_MEMBER(io_data_w);
DECLARE_WRITE16_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(oki_setbank);
TIMER_DEVICE_CALLBACK_MEMBER(obj_irq_cb);
virtual void video_start();
UINT32 screen_update_sliver(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b);
@ -454,18 +455,16 @@ static ADDRESS_MAP_START( ramdac_map, AS_0, 8, sliver_state )
AM_RANGE(0x000, 0x3ff) AM_RAM AM_SHARE("colorram")
ADDRESS_MAP_END
static TIMER_DEVICE_CALLBACK ( obj_irq_cb )
TIMER_DEVICE_CALLBACK_MEMBER ( sliver_state::obj_irq_cb )
{
sliver_state *state = timer.machine().driver_data<sliver_state>();
state->m_maincpu->set_input_line(3, HOLD_LINE);
m_maincpu->set_input_line(3, HOLD_LINE);
}
static MACHINE_CONFIG_START( sliver, sliver_state )
MCFG_CPU_ADD("maincpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(sliver_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", sliver_state, irq4_line_hold)
MCFG_TIMER_ADD_PERIODIC("obj_actel", obj_irq_cb, attotime::from_hz(60)) /* unknown clock, causes "obj actel ready error" without this */
MCFG_TIMER_DRIVER_ADD_PERIODIC("obj_actel", sliver_state, obj_irq_cb, attotime::from_hz(60)) /* unknown clock, causes "obj actel ready error" without this */
// irq 2 valid but not used?
MCFG_CPU_ADD("audiocpu", I8051, 8000000)

View File

@ -450,6 +450,11 @@ public:
/* DSK board */
DECLARE_WRITE32_MEMBER(hddsk_update_pif);
/* DS III/IV board */
TIMER_DEVICE_CALLBACK_MEMBER( ds3sdsp_internal_timer_callback );
TIMER_DEVICE_CALLBACK_MEMBER( ds3xdsp_internal_timer_callback );
};
@ -459,9 +464,6 @@ public:
void hdgsp_irq_gen(device_t *device, int state);
void hdmsp_irq_gen(device_t *device, int state);
/* DS III/IV board */
TIMER_DEVICE_CALLBACK( ds3sdsp_internal_timer_callback );
TIMER_DEVICE_CALLBACK( ds3xdsp_internal_timer_callback );
/*----------- defined in video/harddriv.c -----------*/

View File

@ -1223,18 +1223,16 @@ WRITE16_MEMBER( harddriv_state::hdds3_xdsp_control_w )
}
}
TIMER_DEVICE_CALLBACK( ds3sdsp_internal_timer_callback )
TIMER_DEVICE_CALLBACK_MEMBER( harddriv_state::ds3sdsp_internal_timer_callback )
{
harddriv_state *state = timer.machine().driver_data<harddriv_state>();
UINT16 period = m_ds3sdsp_regs[0x1d];
UINT16 scale = m_ds3sdsp_regs[0x1b] + 1;
UINT16 period = state->m_ds3sdsp_regs[0x1d];
UINT16 scale = state->m_ds3sdsp_regs[0x1b] + 1;
state->m_ds3sdsp_internal_timer->adjust(state->m_ds3sdsp->cycles_to_attotime(period * scale));
m_ds3sdsp_internal_timer->adjust(m_ds3sdsp->cycles_to_attotime(period * scale));
/* the IRQ line is edge triggered */
state->m_ds3sdsp->set_input_line(ADSP2105_TIMER, ASSERT_LINE);
state->m_ds3sdsp->set_input_line(ADSP2105_TIMER, CLEAR_LINE);
m_ds3sdsp->set_input_line(ADSP2105_TIMER, ASSERT_LINE);
m_ds3sdsp->set_input_line(ADSP2105_TIMER, CLEAR_LINE);
}
@ -1260,18 +1258,16 @@ WRITE_LINE_MEMBER(harddriv_state::hdds3sdsp_timer_enable_callback)
}
TIMER_DEVICE_CALLBACK( ds3xdsp_internal_timer_callback )
TIMER_DEVICE_CALLBACK_MEMBER( harddriv_state::ds3xdsp_internal_timer_callback )
{
harddriv_state *state = timer.machine().driver_data<harddriv_state>();
UINT16 period = m_ds3xdsp_regs[0x1d];
UINT16 scale = m_ds3xdsp_regs[0x1b] + 1;
UINT16 period = state->m_ds3xdsp_regs[0x1d];
UINT16 scale = state->m_ds3xdsp_regs[0x1b] + 1;
state->m_ds3xdsp_internal_timer->adjust(state->m_ds3xdsp->cycles_to_attotime(period * scale));
m_ds3xdsp_internal_timer->adjust(m_ds3xdsp->cycles_to_attotime(period * scale));
/* the IRQ line is edge triggered */
state->m_ds3xdsp->set_input_line(ADSP2105_TIMER, ASSERT_LINE);
state->m_ds3xdsp->set_input_line(ADSP2105_TIMER, CLEAR_LINE);
m_ds3xdsp->set_input_line(ADSP2105_TIMER, ASSERT_LINE);
m_ds3xdsp->set_input_line(ADSP2105_TIMER, CLEAR_LINE);
}