From 7f63cfec02e1c439b7e02d42e8a14c3ffcdc5b4a Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 10 Apr 2017 17:41:26 +0200 Subject: flyball.cpp, gaplus.cpp, gcpinbal.cpp: removed anonymous timers (nw) --- src/mame/drivers/flyball.cpp | 5 ++++- src/mame/drivers/gaplus.cpp | 35 +++++++++++++++++++---------------- src/mame/drivers/gcpinbal.cpp | 4 +++- src/mame/includes/gaplus.h | 8 ++++++-- src/mame/includes/gcpinbal.h | 2 ++ 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp index 05c7d9b5b87..08d11615f2d 100644 --- a/src/mame/drivers/flyball.cpp +++ b/src/mame/drivers/flyball.cpp @@ -65,6 +65,7 @@ public: uint8_t m_potmask; uint8_t m_potsense; + emu_timer *m_pot_assert_timer[64]; emu_timer *m_pot_clear_timer; emu_timer *m_quarter_timer; @@ -206,7 +207,7 @@ TIMER_CALLBACK_MEMBER(flyball_state::quarter_callback) for (i = 0; i < 64; i++) if (potsense[i] != 0) - timer_set(m_screen->time_until_pos(scanline + i), TIMER_POT_ASSERT, potsense[i]); + m_pot_assert_timer[potsense[i]]->adjust(m_screen->time_until_pos(scanline + i), potsense[i]); scanline += 0x40; scanline &= 0xff; @@ -432,6 +433,8 @@ void flyball_state::machine_start() buf[i ^ 0x1ff] = ROM[i]; memcpy(ROM, &buf[0], len); + for (int i = 0; i < 64; i++) + m_pot_assert_timer[i] = timer_alloc(TIMER_POT_ASSERT); m_pot_clear_timer = timer_alloc(TIMER_POT_CLEAR); m_quarter_timer = timer_alloc(TIMER_QUARTER); diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp index 805f51ac5b6..eee69f03b61 100644 --- a/src/mame/drivers/gaplus.cpp +++ b/src/mame/drivers/gaplus.cpp @@ -214,25 +214,25 @@ void gaplus_state::device_timer(emu_timer &timer, device_timer_id id, int param, { switch (id) { - case TIMER_NAMCOIO_RUN: - namcoio_run(ptr, param); + case TIMER_NAMCOIO0_RUN: + namcoio0_run(ptr, param); + break; + case TIMER_NAMCOIO1_RUN: + namcoio1_run(ptr, param); break; default: assert_always(false, "Unknown id in gaplus_state::device_timer"); } } -TIMER_CALLBACK_MEMBER(gaplus_state::namcoio_run) +TIMER_CALLBACK_MEMBER(gaplus_state::namcoio0_run) { - switch (param) - { - case 0: - m_namco58xx->customio_run(); - break; - case 1: - m_namco56xx->customio_run(); - break; - } + m_namco58xx->customio_run(); +} + +TIMER_CALLBACK_MEMBER(gaplus_state::namcoio1_run) +{ + m_namco56xx->customio_run(); } INTERRUPT_GEN_MEMBER(gaplus_state::vblank_main_irq) @@ -241,10 +241,10 @@ INTERRUPT_GEN_MEMBER(gaplus_state::vblank_main_irq) m_maincpu->set_input_line(0, ASSERT_LINE); if (!m_namco58xx->read_reset_line()) /* give the cpu a tiny bit of time to write the command before processing it */ - timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 0); + m_namcoio0_run_timer->adjust(attotime::from_usec(50)); if (!m_namco56xx->read_reset_line()) /* give the cpu a tiny bit of time to write the command before processing it */ - timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1); + m_namcoio1_run_timer->adjust(attotime::from_usec(50)); } INTERRUPT_GEN_MEMBER(gaplus_state::gapluso_vblank_main_irq) @@ -253,10 +253,10 @@ INTERRUPT_GEN_MEMBER(gaplus_state::gapluso_vblank_main_irq) m_maincpu->set_input_line(0, ASSERT_LINE); if (!m_namco58xx->read_reset_line()) /* give the cpu a tiny bit of time to write the command before processing it */ - timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1); + m_namcoio1_run_timer->adjust(attotime::from_usec(50)); if (!m_namco56xx->read_reset_line()) /* give the cpu a tiny bit of time to write the command before processing it */ - timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 0); + m_namcoio0_run_timer->adjust(attotime::from_usec(50)); } INTERRUPT_GEN_MEMBER(gaplus_state::vblank_sub_irq) @@ -490,6 +490,9 @@ WRITE8_MEMBER(gaplus_state::out_lamps1) void gaplus_state::machine_start() { + m_namcoio0_run_timer = timer_alloc(TIMER_NAMCOIO0_RUN); + m_namcoio1_run_timer = timer_alloc(TIMER_NAMCOIO1_RUN); + switch (m_type) { case GAME_GALAGA3: diff --git a/src/mame/drivers/gcpinbal.cpp b/src/mame/drivers/gcpinbal.cpp index ffda8f064cc..4dde3173039 100644 --- a/src/mame/drivers/gcpinbal.cpp +++ b/src/mame/drivers/gcpinbal.cpp @@ -112,7 +112,7 @@ INTERRUPT_GEN_MEMBER(gcpinbal_state::gcpinbal_interrupt) { /* Unsure of actual sequence */ - timer_set(downcast(&device)->cycles_to_attotime(500), TIMER_GCPINBAL_INTERRUPT1); + m_int1_timer->adjust(m_maincpu->cycles_to_attotime(500)); device.execute().set_input_line(4, HOLD_LINE); } @@ -411,6 +411,8 @@ GFXDECODE_END void gcpinbal_state::machine_start() { + m_int1_timer = timer_alloc(TIMER_GCPINBAL_INTERRUPT1); + save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); save_item(NAME(m_bg0_gfxset)); diff --git a/src/mame/includes/gaplus.h b/src/mame/includes/gaplus.h index c7ae5acf6cb..75e00946876 100644 --- a/src/mame/includes/gaplus.h +++ b/src/mame/includes/gaplus.h @@ -18,7 +18,8 @@ class gaplus_state : public driver_device public: enum { - TIMER_NAMCOIO_RUN + TIMER_NAMCOIO0_RUN, + TIMER_NAMCOIO1_RUN }; enum @@ -66,6 +67,8 @@ public: uint8_t m_main_irq_mask; uint8_t m_sub_irq_mask; uint8_t m_sub2_irq_mask; + emu_timer *m_namcoio0_run_timer; + emu_timer *m_namcoio1_run_timer; DECLARE_WRITE8_MEMBER(irq_1_ctrl_w); DECLARE_WRITE8_MEMBER(irq_2_ctrl_w); @@ -94,7 +97,8 @@ public: INTERRUPT_GEN_MEMBER(gapluso_vblank_main_irq); INTERRUPT_GEN_MEMBER(vblank_sub_irq); INTERRUPT_GEN_MEMBER(vblank_sub2_irq); - TIMER_CALLBACK_MEMBER(namcoio_run); + TIMER_CALLBACK_MEMBER(namcoio0_run); + TIMER_CALLBACK_MEMBER(namcoio1_run); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(screen_vblank); diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h index c9f97ef746f..ce557b289a6 100644 --- a/src/mame/includes/gcpinbal.h +++ b/src/mame/includes/gcpinbal.h @@ -45,6 +45,8 @@ public: required_device m_gfxdecode; required_device m_palette; + emu_timer *m_int1_timer; + /* video-related */ tilemap_t *m_tilemap[3]; uint16_t m_scrollx[3]; -- cgit v1.2.3