From 2ff1340a30c74dfab6ce09c2d9d1aa7330002259 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 26 Apr 2017 18:55:27 +0200 Subject: A few timer_set removals (nw) --- src/devices/machine/k054321.cpp | 2 +- src/mame/drivers/m10.cpp | 10 ++++++---- src/mame/includes/lethalj.h | 4 +--- src/mame/includes/m10.h | 1 + src/mame/includes/m92.h | 1 + src/mame/video/lethalj.cpp | 4 +++- src/mame/video/m92.cpp | 10 ++++------ 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/devices/machine/k054321.cpp b/src/devices/machine/k054321.cpp index cd28b50f65c..66b30b03d17 100644 --- a/src/devices/machine/k054321.cpp +++ b/src/devices/machine/k054321.cpp @@ -16,7 +16,7 @@ output. The 054321 manages three latches (maybe four) to allow communication - between the main cpu and the soud cpu, and provides two independant + between the main cpu and the sound cpu, and provides two independent busses to ensure decoupling. It also manages one global volume and a per-channel mute for two channels. diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp index 8489e7787b3..e07a81cc188 100644 --- a/src/mame/drivers/m10.cpp +++ b/src/mame/drivers/m10.cpp @@ -170,6 +170,8 @@ PALETTE_INIT_MEMBER(m10_state,m10) MACHINE_START_MEMBER(m10_state,m10) { + m_interrupt_timer = timer_alloc(TIMER_INTERRUPT); + save_item(NAME(m_bottomline)); save_item(NAME(m_flip)); save_item(NAME(m_last)); @@ -475,12 +477,12 @@ TIMER_CALLBACK_MEMBER(m10_state::interrupt_callback) if (param == 0) { m_maincpu->set_input_line(0, ASSERT_LINE); - timer_set(m_screen->time_until_pos(IREMM10_VBSTART + 16), TIMER_INTERRUPT, 1); + m_interrupt_timer->adjust(m_screen->time_until_pos(IREMM10_VBSTART + 16), 1); } if (param == 1) { m_maincpu->set_input_line(0, ASSERT_LINE); - timer_set(m_screen->time_until_pos(IREMM10_VBSTART + 24), TIMER_INTERRUPT, 2); + m_interrupt_timer->adjust(m_screen->time_until_pos(IREMM10_VBSTART + 24), 2); } if (param == -1) m_maincpu->set_input_line(0, CLEAR_LINE); @@ -502,7 +504,7 @@ void m10_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo INTERRUPT_GEN_MEMBER(m10_state::m11_interrupt) { device.execute().set_input_line(0, ASSERT_LINE); - //timer_set(m_screen->time_until_pos(IREMM10_VBEND), TIMER_INTERRUPT, -1); + //m_interrupt_timer->adjust(m_screen->time_until_pos(IREMM10_VBEND), -1); } INTERRUPT_GEN_MEMBER(m10_state::m10_interrupt) @@ -514,7 +516,7 @@ INTERRUPT_GEN_MEMBER(m10_state::m10_interrupt) INTERRUPT_GEN_MEMBER(m10_state::m15_interrupt) { device.execute().set_input_line(0, ASSERT_LINE); - timer_set(m_screen->time_until_pos(IREMM10_VBSTART + 1, 80), TIMER_INTERRUPT, -1); + m_interrupt_timer->adjust(m_screen->time_until_pos(IREMM10_VBSTART + 1, 80), -1); } /************************************* diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h index 6cb1ae765a9..df87de7d8aa 100644 --- a/src/mame/includes/lethalj.h +++ b/src/mame/includes/lethalj.h @@ -44,6 +44,7 @@ public: optional_ioport m_light1_x; optional_ioport m_light1_y; + emu_timer *m_gen_ext1_int_timer; uint16_t m_blitter_data[8]; std::unique_ptr m_screenram; uint8_t m_vispage; @@ -70,7 +71,4 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; -/*----------- defined in video/lethalj.c -----------*/ -void lethalj_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int scanline, const tms34010_display_params *params); - #endif // MAME_INCLUDES_LETHALJ_H diff --git a/src/mame/includes/m10.h b/src/mame/includes/m10.h index adfad1d2840..f7b9ec43733 100644 --- a/src/mame/includes/m10.h +++ b/src/mame/includes/m10.h @@ -75,6 +75,7 @@ public: /* misc */ int m_last; + emu_timer *m_interrupt_timer; /* devices */ required_device m_maincpu; diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h index 1d83a93617b..84ae25cbc72 100644 --- a/src/mame/includes/m92.h +++ b/src/mame/includes/m92.h @@ -55,6 +55,7 @@ public: required_device m_upd71059c; optional_device m_soundlatch; + emu_timer *m_spritebuffer_timer; uint16_t m_sound_status; uint32_t m_raster_irq_position; uint16_t m_videocontrol; diff --git a/src/mame/video/lethalj.cpp b/src/mame/video/lethalj.cpp index c23f2e5f987..09d3a4c06e7 100644 --- a/src/mame/video/lethalj.cpp +++ b/src/mame/video/lethalj.cpp @@ -91,6 +91,8 @@ void lethalj_state::video_start() /* predetermine blitter info */ m_blitter_base = (uint16_t *)memregion("gfx1")->base(); m_blitter_rows = memregion("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH); + + m_gen_ext1_int_timer = timer_alloc(TIMER_GEN_EXT1_INT); } @@ -168,7 +170,7 @@ WRITE16_MEMBER(lethalj_state::lethalj_blitter_w) else do_blit(); - timer_set(attotime::from_hz(XTAL_32MHz) * ((m_blitter_data[5] + 1) * (m_blitter_data[7] + 1)), TIMER_GEN_EXT1_INT); + m_gen_ext1_int_timer->adjust(attotime::from_hz(XTAL_32MHz) * ((m_blitter_data[5] + 1) * (m_blitter_data[7] + 1))); } /* clear the IRQ on offset 0 */ diff --git a/src/mame/video/m92.cpp b/src/mame/video/m92.cpp index 1329b260427..40337285486 100644 --- a/src/mame/video/m92.cpp +++ b/src/mame/video/m92.cpp @@ -91,7 +91,7 @@ WRITE16_MEMBER(m92_state::m92_spritecontrol_w) /* Pixel clock is 26.6666MHz (some boards 27MHz??), we have 0x800 bytes, or 0x400 words to copy from spriteram to the buffer. It seems safe to assume 1 word can be copied per clock. */ - timer_set(attotime::from_hz(XTAL_26_66666MHz) * 0x400, TIMER_SPRITEBUFFER); + m_spritebuffer_timer->adjust(attotime::from_hz(XTAL_26_66666MHz) * 0x400); } // logerror("%04x: m92_spritecontrol_w %08x %08x\n",space.device().safe_pc(),offset,data); } @@ -247,10 +247,10 @@ WRITE16_MEMBER(m92_state::m92_master_control_w) VIDEO_START_MEMBER(m92_state,m92) { - int laynum; + m_spritebuffer_timer = timer_alloc(TIMER_SPRITEBUFFER); memset(&m_pf_layer, 0, sizeof(m_pf_layer)); - for (laynum = 0; laynum < 3; laynum++) + for (int laynum = 0; laynum < 3; laynum++) { M92_pf_layer_info *layer = &m_pf_layer[laynum]; @@ -301,11 +301,9 @@ VIDEO_START_MEMBER(m92_state,m92) VIDEO_START_MEMBER(m92_state,ppan) { - int laynum; - VIDEO_START_CALL_MEMBER(m92); - for (laynum = 0; laynum < 3; laynum++) + for (int laynum = 0; laynum < 3; laynum++) { M92_pf_layer_info *layer = &m_pf_layer[laynum]; -- cgit v1.2.3