From 028b0b557d34767cb92c4e57432012c4ea3715a6 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 14 Apr 2017 09:21:03 +0200 Subject: small batch of anonymous timers removal (nw) --- src/mame/drivers/segaorun.cpp | 4 +++- src/mame/includes/dcheese.h | 1 + src/mame/includes/segaorun.h | 1 + src/mame/includes/stfight.h | 2 ++ src/mame/machine/stfight.cpp | 4 +++- src/mame/video/dcheese.cpp | 7 ++++--- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp index ec48b1d206c..6597cc255c4 100644 --- a/src/mame/drivers/segaorun.cpp +++ b/src/mame/drivers/segaorun.cpp @@ -610,7 +610,7 @@ void segaorun_state::device_timer(emu_timer &timer, device_timer_id id, int para case 65: case 129: case 193: - timer_set(m_screen->time_until_pos(scanline, m_screen->visible_area().max_x + 1), TID_IRQ2_GEN); + m_irq2_gen_timer->adjust(m_screen->time_until_pos(scanline, m_screen->visible_area().max_x + 1)); next_scanline = scanline + 1; break; @@ -2925,6 +2925,8 @@ DRIVER_INIT_MEMBER(segaorun_state,generic) // allocate a scanline timer m_scanline_timer = timer_alloc(TID_SCANLINE); + m_irq2_gen_timer = timer_alloc(TID_IRQ2_GEN); + // configure the NVRAM to point to our workram if (m_nvram != nullptr) m_nvram->set_base(m_workram, m_workram.bytes()); diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h index 56815c02fc1..4d7e25627ce 100644 --- a/src/mame/includes/dcheese.h +++ b/src/mame/includes/dcheese.h @@ -36,6 +36,7 @@ public: std::unique_ptr m_dstbitmap; emu_timer *m_blitter_timer; + emu_timer *m_signal_irq_timer; /* misc */ uint8_t m_irq_state[5]; diff --git a/src/mame/includes/segaorun.h b/src/mame/includes/segaorun.h index d4c580fb2d0..d06a1ff66bf 100644 --- a/src/mame/includes/segaorun.h +++ b/src/mame/includes/segaorun.h @@ -145,6 +145,7 @@ protected: // internal state emu_timer * m_scanline_timer; + emu_timer * m_irq2_gen_timer; uint8_t m_irq2_state; uint8_t m_adc_select; uint8_t m_vblank_irq_state; diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h index 7197093f469..2cf4167e905 100644 --- a/src/mame/includes/stfight.h +++ b/src/mame/includes/stfight.h @@ -88,4 +88,6 @@ protected: bool m_vck2; bool m_adpcm_reset; uint16_t m_adpcm_data_offs; + + emu_timer *m_int1_timer; }; diff --git a/src/mame/machine/stfight.cpp b/src/mame/machine/stfight.cpp index bc8ceeb09fe..199659d145c 100644 --- a/src/mame/machine/stfight.cpp +++ b/src/mame/machine/stfight.cpp @@ -78,6 +78,8 @@ void stfight_state::machine_start() m_main_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); m_main_bank->set_entry(0); + m_int1_timer = timer_alloc(TIMER_STFIGHT_INTERRUPT_1); + save_item(NAME(m_coin_state)); save_item(NAME(m_fm_data)); @@ -131,7 +133,7 @@ INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt) { // Do a RST10 device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); - timer_set(attotime::from_hz(120), TIMER_STFIGHT_INTERRUPT_1); + m_int1_timer->adjust(attotime::from_hz(120)); } /* diff --git a/src/mame/video/dcheese.cpp b/src/mame/video/dcheese.cpp index 37c0fe12b69..ad4cb6619d7 100644 --- a/src/mame/video/dcheese.cpp +++ b/src/mame/video/dcheese.cpp @@ -99,8 +99,9 @@ void dcheese_state::video_start() /* the destination bitmap is not directly accessible to the CPU */ m_dstbitmap = std::make_unique(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT); - /* create a timer */ + /* create timers */ m_blitter_timer = timer_alloc(TIMER_BLITTER_SCANLINE); + m_signal_irq_timer = timer_alloc(TIMER_SIGNAL_IRQ); /* register for saving */ save_item(NAME(m_blitter_color)); @@ -151,7 +152,7 @@ void dcheese_state::do_clear( ) memset(&m_dstbitmap->pix16(y % DSTBITMAP_HEIGHT), 0, DSTBITMAP_WIDTH * 2); /* signal an IRQ when done (timing is just a guess) */ - timer_set(m_screen->scan_period(), TIMER_SIGNAL_IRQ, 1); + m_signal_irq_timer->adjust(m_screen->scan_period(), 1); } @@ -205,7 +206,7 @@ void dcheese_state::do_blit( ) } /* signal an IRQ when done (timing is just a guess) */ - timer_set(m_screen->scan_period() / 2, TIMER_SIGNAL_IRQ, 2); + m_signal_irq_timer->adjust(m_screen->scan_period() / 2, 2); /* these extra parameters are written but they are always zero, so I don't know what they do */ if (m_blitter_xparam[8] != 0 || m_blitter_xparam[9] != 0 || m_blitter_xparam[10] != 0 || m_blitter_xparam[11] != 0 || -- cgit v1.2.3