diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c index 12503ccd752..6466a0ae0d6 100644 --- a/src/mame/audio/jedi.c +++ b/src/mame/audio/jedi.c @@ -73,18 +73,16 @@ WRITE8_MEMBER(jedi_state::jedi_audio_reset_w) } -static TIMER_CALLBACK( delayed_audio_latch_w ) +TIMER_CALLBACK_MEMBER(jedi_state::delayed_audio_latch_w) { - jedi_state *state = machine.driver_data(); - - state->m_audio_latch = param; - *state->m_audio_comm_stat |= 0x80; + m_audio_latch = param; + *m_audio_comm_stat |= 0x80; } WRITE8_MEMBER(jedi_state::jedi_audio_latch_w) { - machine().scheduler().synchronize(FUNC(delayed_audio_latch_w), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(jedi_state::delayed_audio_latch_w), this), data); } diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c index 7e2ad9073fa..2f8d6e4c22e 100644 --- a/src/mame/audio/starwars.c +++ b/src/mame/audio/starwars.c @@ -61,12 +61,11 @@ WRITE_LINE_MEMBER(starwars_state::snd_interrupt) * *************************************/ -static TIMER_CALLBACK( sound_callback ) +TIMER_CALLBACK_MEMBER(starwars_state::sound_callback) { - starwars_state *state = machine.driver_data(); - state->m_riot->porta_in_set(0x40, 0x40); - state->m_main_data = param; - machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); + m_riot->porta_in_set(0x40, 0x40); + m_main_data = param; + machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } @@ -79,7 +78,7 @@ READ8_MEMBER(starwars_state::starwars_sin_r) WRITE8_MEMBER(starwars_state::starwars_sout_w) { - machine().scheduler().synchronize(FUNC(sound_callback), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(starwars_state::sound_callback), this), data); } @@ -102,20 +101,19 @@ READ8_MEMBER(starwars_state::starwars_main_ready_flag_r) return m_riot->porta_in_get() & 0xc0; /* only upper two flag bits mapped */ } -static TIMER_CALLBACK( main_callback ) +TIMER_CALLBACK_MEMBER(starwars_state::main_callback ) { - starwars_state *state = machine.driver_data(); - if (state->m_riot->porta_in_get() & 0x80) - logerror("Sound data not read %x\n",state->m_sound_data); + if (m_riot->porta_in_get() & 0x80) + logerror("Sound data not read %x\n", m_sound_data); - state->m_riot->porta_in_set(0x80, 0x80); - state->m_sound_data = param; - machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); + m_riot->porta_in_set(0x80, 0x80); + m_sound_data = param; + machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } WRITE8_MEMBER(starwars_state::starwars_main_wr_w) { - machine().scheduler().synchronize(FUNC(main_callback), data); + machine().scheduler().synchronize(timer_expired_delegate(FUNC(starwars_state::main_callback), this), data); } diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c index 609d60701dc..4cb6d472b45 100644 --- a/src/mame/audio/turbo.c +++ b/src/mame/audio/turbo.c @@ -39,7 +39,7 @@ static void turbo_update_samples(turbo_state *state, samples_device *samples) #if (DISCRETE_TEST) -static TIMER_CALLBACK( update_sound_a ) +TIMER_CALLBACK_MEMBER(turbo_state::update_sound_a) { discrete_device *discrete = machine.device("discrete"); int data = param; diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h index 5761711216f..a85a6b73c2f 100644 --- a/src/mame/includes/harddriv.h +++ b/src/mame/includes/harddriv.h @@ -382,6 +382,8 @@ public: void hdds3sdsp_reset_timer(); void hdds3xdsp_reset_timer(); + + TIMER_CALLBACK_MEMBER( xsdp_sport1_irq_off_callback ); /* DSK board */ DECLARE_WRITE16_MEMBER( hd68k_dsk_control_w ); diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h index 2bad6a28524..f831a6648b1 100644 --- a/src/mame/includes/jedi.h +++ b/src/mame/includes/jedi.h @@ -83,6 +83,7 @@ public: DECLARE_VIDEO_START(jedi); UINT32 screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(generate_interrupt); + TIMER_CALLBACK_MEMBER(delayed_audio_latch_w); void get_pens(pen_t *pens); void do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_background_and_text(bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/midzeus.h b/src/mame/includes/midzeus.h index 6586eaf1cbc..c43e2748546 100644 --- a/src/mame/includes/midzeus.h +++ b/src/mame/includes/midzeus.h @@ -97,6 +97,7 @@ public: DECLARE_READ32_MEMBER( zeus2_r ); DECLARE_WRITE32_MEMBER( zeus2_w ); private: + TIMER_CALLBACK_MEMBER(int_timer_callback); void exit_handler2(); void zeus2_register32_w(offs_t offset, UINT32 data, int logit); void zeus2_register_update(offs_t offset, UINT32 oldval, int logit); diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h index 0a145459e2e..babed5b9951 100644 --- a/src/mame/includes/starwars.h +++ b/src/mame/includes/starwars.h @@ -67,6 +67,8 @@ public: DECLARE_DRIVER_INIT(starwars); virtual void machine_reset(); TIMER_CALLBACK_MEMBER(math_run_clear); + TIMER_CALLBACK_MEMBER(main_callback); + TIMER_CALLBACK_MEMBER(sound_callback); DECLARE_READ8_MEMBER(r6532_porta_r); DECLARE_WRITE8_MEMBER(r6532_porta_w); DECLARE_WRITE_LINE_MEMBER(snd_interrupt); diff --git a/src/mame/includes/turbo.h b/src/mame/includes/turbo.h index f28dbd2862e..d78d51a6778 100644 --- a/src/mame/includes/turbo.h +++ b/src/mame/includes/turbo.h @@ -151,6 +151,7 @@ public: UINT32 screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(delayed_i8255_w); + TIMER_CALLBACK_MEMBER(update_sound_a); DECLARE_WRITE8_MEMBER(turbo_sound_a_w); DECLARE_WRITE8_MEMBER(turbo_sound_b_w); DECLARE_WRITE8_MEMBER(turbo_sound_c_w); diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c index cd8f433af01..dee08c13ca0 100644 --- a/src/mame/machine/harddriv.c +++ b/src/mame/machine/harddriv.c @@ -1297,10 +1297,9 @@ WRITE_LINE_MEMBER(harddriv_state::hdds3xdsp_timer_enable_callback) /* TODO: The following does not work correctly */ -static TIMER_CALLBACK( xsdp_sport1_irq_off_callback ) +TIMER_CALLBACK_MEMBER(harddriv_state::xsdp_sport1_irq_off_callback) { - harddriv_state *state = machine.driver_data(); - state->m_ds3xdsp->set_input_line(ADSP2105_SPORT1_RX, CLEAR_LINE); + m_ds3xdsp->set_input_line(ADSP2105_SPORT1_RX, CLEAR_LINE); } @@ -1312,7 +1311,7 @@ WRITE32_MEMBER(harddriv_state::hdds3sdsp_serial_tx_callback) m_ds3sdsp_sdata = data; m_ds3xdsp->set_input_line(ADSP2105_SPORT1_RX, ASSERT_LINE); - machine().scheduler().timer_set(attotime::from_nsec(200), FUNC(xsdp_sport1_irq_off_callback)); + machine().scheduler().timer_set(attotime::from_nsec(200), timer_expired_delegate(FUNC(harddriv_state::xsdp_sport1_irq_off_callback), this)); } diff --git a/src/mame/machine/kaneko_calc3.c b/src/mame/machine/kaneko_calc3.c index 1d7c173627d..7e069f1b420 100644 --- a/src/mame/machine/kaneko_calc3.c +++ b/src/mame/machine/kaneko_calc3.c @@ -34,18 +34,17 @@ kaneko_calc3_device::kaneko_calc3_device(const machine_config &mconfig, const ch } -static TIMER_CALLBACK( kaneko_calc3_run_callback ) +TIMER_CALLBACK_MEMBER( kaneko_calc3_device::run_callback ) { - kaneko_calc3_device* dev = (kaneko_calc3_device*)ptr; - dev->calc3_mcu_run(machine); - dev->reset_run_timer(); + calc3_mcu_run(machine()); + reset_run_timer(); } void kaneko_calc3_device::device_start() { m_calc3_mcuram = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x10000/2); initial_scan_tables(this->machine()); - m_runtimer = machine().scheduler().timer_alloc(FUNC(kaneko_calc3_run_callback), (void*)this); + m_runtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kaneko_calc3_device::run_callback), this)); save_item(NAME(m_calc3.mcu_status)); diff --git a/src/mame/machine/kaneko_calc3.h b/src/mame/machine/kaneko_calc3.h index b49210cd223..401c24220a8 100644 --- a/src/mame/machine/kaneko_calc3.h +++ b/src/mame/machine/kaneko_calc3.h @@ -53,6 +53,7 @@ private: UINT16* m_calc3_mcuram; void calc3_mcu_init(running_machine &machine); void initial_scan_tables(running_machine& machine); + TIMER_CALLBACK_MEMBER(run_callback); calc3_t m_calc3; void calc3_mcu_com_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_); diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index 82b08312569..8522bca85d6 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -245,9 +245,9 @@ INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width) * *************************************/ -static TIMER_CALLBACK( int_timer_callback ) +TIMER_CALLBACK_MEMBER(midzeus2_state::int_timer_callback) { - machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE); + m_maincpu->set_input_line(2, ASSERT_LINE); } @@ -268,7 +268,7 @@ VIDEO_START_MEMBER(midzeus2_state,midzeus2) texel_width = 256; zeus_renderbase = waveram[1]; - int_timer = machine().scheduler().timer_alloc(FUNC(int_timer_callback)); + int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus2_state::int_timer_callback), this)); /* save states */ save_pointer(NAME(waveram[0]), WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));