From 6d55813a5902a69f4fb8d88d1c23afd7d63063ed Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 9 May 2017 18:56:17 +0200 Subject: [PATCH] a couple timer_set removed (nw) --- src/mame/drivers/dday.cpp | 3 --- src/mame/drivers/metro.cpp | 10 ++++++++-- src/mame/includes/dday.h | 7 +++++-- src/mame/includes/metro.h | 4 +++- src/mame/video/dday.cpp | 4 +++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/mame/drivers/dday.cpp b/src/mame/drivers/dday.cpp index 941572aa623..ed66022be8b 100644 --- a/src/mame/drivers/dday.cpp +++ b/src/mame/drivers/dday.cpp @@ -55,7 +55,6 @@ write: #include "includes/dday.h" #include "cpu/z80/z80.h" -#include "sound/ay8910.h" #include "speaker.h" @@ -240,8 +239,6 @@ GFXDECODE_END void dday_state::machine_start() { - m_ay1 = machine().device("ay1"); - save_item(NAME(m_control)); save_item(NAME(m_sl_enable)); save_item(NAME(m_sl_image)); diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp index bf85a0207cb..83e09f7ad90 100644 --- a/src/mame/drivers/metro.cpp +++ b/src/mame/drivers/metro.cpp @@ -235,7 +235,7 @@ INTERRUPT_GEN_MEMBER(metro_state::karatour_interrupt) m_requested_int[m_vblank_bit] = 1; /* write to scroll registers, the duration is a guess */ - timer_set(attotime::from_usec(2500), TIMER_KARATOUR_IRQ); + m_karatour_irq_timer->adjust(attotime::from_usec(2500)); m_requested_int[5] = 1; update_irq_state(); @@ -617,7 +617,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w) another blit. */ if (b1 == 0) { - timer_set(attotime::from_usec(500), TIMER_METRO_BLIT_DONE); + m_blit_done_timer->adjust(attotime::from_usec(500)); return; } @@ -6214,6 +6214,8 @@ void metro_state::metro_common( ) m_irq_line = 2; *m_irq_enable = 0; + + m_blit_done_timer = timer_alloc(TIMER_METRO_BLIT_DONE); } @@ -6241,6 +6243,8 @@ DRIVER_INIT_MEMBER(metro_state,karatour) m_vram_2[i] = machine().rand(); } + m_karatour_irq_timer = timer_alloc(TIMER_KARATOUR_IRQ); + DRIVER_INIT_CALL(metro); } @@ -6297,6 +6301,8 @@ DRIVER_INIT_MEMBER(metro_state,blzntrnd) { metro_common(); m_irq_line = 1; + + m_karatour_irq_timer = timer_alloc(TIMER_KARATOUR_IRQ); } DRIVER_INIT_MEMBER(metro_state,vmetal) diff --git a/src/mame/includes/dday.h b/src/mame/includes/dday.h index 405a9db04a9..e844a732ce1 100644 --- a/src/mame/includes/dday.h +++ b/src/mame/includes/dday.h @@ -6,6 +6,7 @@ *************************************************************************/ #include "screen.h" +#include "sound/ay8910.h" class dday_state : public driver_device @@ -20,7 +21,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_ay1(*this, "ay1") { } /* memory pointers */ required_shared_ptr m_textvideoram; @@ -38,9 +40,9 @@ public: int m_sl_image; int m_sl_enable; int m_timer_value; + emu_timer *m_countdown_timer; /* devices */ - device_t *m_ay1; DECLARE_READ8_MEMBER(dday_countdown_timer_r); DECLARE_WRITE8_MEMBER(dday_bgvideoram_w); DECLARE_WRITE8_MEMBER(dday_fgvideoram_w); @@ -64,4 +66,5 @@ public: required_device m_gfxdecode; required_device m_screen; required_device m_palette; + required_device m_ay1; }; diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h index 1b66b4e6b2a..b8f10d34285 100644 --- a/src/mame/includes/metro.h +++ b/src/mame/includes/metro.h @@ -98,6 +98,7 @@ public: int m_sprite_xoffs; int m_sprite_yoffs; int m_sprite_xoffs_dx; + emu_timer *m_blit_done_timer; std::unique_ptr m_expanded_gfx1; @@ -105,8 +106,9 @@ public: int m_vblank_bit; int m_blitter_bit; int m_irq_line; - uint8_t m_requested_int[8]; + uint8_t m_requested_int[8]; emu_timer *m_mouja_irq_timer; + emu_timer *m_karatour_irq_timer; /* sound related */ uint16_t m_soundstatus; diff --git a/src/mame/video/dday.cpp b/src/mame/video/dday.cpp index d6e2ee36aac..43fa2cc6811 100644 --- a/src/mame/video/dday.cpp +++ b/src/mame/video/dday.cpp @@ -37,7 +37,7 @@ void dday_state::start_countdown_timer() { m_timer_value = 0; - machine().scheduler().timer_pulse(attotime::from_seconds(1), timer_expired_delegate(FUNC(dday_state::countdown_timer_callback),this)); + m_countdown_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); } @@ -216,6 +216,8 @@ void dday_state::video_start() m_fg_tilemap->set_transparent_pen(0); m_text_tilemap->set_transparent_pen(0); + m_countdown_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dday_state::countdown_timer_callback), this)); + start_countdown_timer(); }