diff options
Diffstat (limited to 'src/mame/video/exidy440.cpp')
-rw-r--r-- | src/mame/video/exidy440.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mame/video/exidy440.cpp b/src/mame/video/exidy440.cpp index 57ad8a06d80..602b1d3f479 100644 --- a/src/mame/video/exidy440.cpp +++ b/src/mame/video/exidy440.cpp @@ -42,6 +42,7 @@ void exidy440_state::video_start() m_palettebank_vis = 0; m_firq_vblank = 0; m_firq_beam = 0; + m_beam_firq_count = 0; /* allocate a buffer for VRAM */ m_local_videoram = std::make_unique<uint8_t[]>(256 * 256 * 2); @@ -51,6 +52,7 @@ void exidy440_state::video_start() m_local_paletteram = std::make_unique<uint8_t[]>(512 * 2); memset(m_local_paletteram.get(), 0, 512 * 2); + m_beam_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback), this)); m_collide_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::collide_firq_callback), this)); } @@ -262,6 +264,9 @@ TIMER_CALLBACK_MEMBER(exidy440_state::beam_firq_callback) /* latch the x value; this convolution comes from the read routine */ m_latched_x = (param + 3) ^ 2; + + if (m_beam_firq_count++ < 12) + m_beam_firq_timer->adjust(m_screen->scan_period(), param); } @@ -420,8 +425,6 @@ uint32_t exidy440_state::screen_update_exidy440(screen_device &screen, bitmap_in /* generate an interrupt once/frame for the beam */ if (cliprect.bottom() == screen.visible_area().bottom()) { - int i; - int beamx = ((ioport("AN0")->read() & 0xff) * (HBSTART - HBEND)) >> 8; int beamy = ((ioport("AN1")->read() & 0xff) * (VBSTART - VBEND)) >> 8; @@ -433,11 +436,9 @@ uint32_t exidy440_state::screen_update_exidy440(screen_device &screen, bitmap_in This is how it is implemented. */ attotime increment = screen.scan_period(); attotime time = screen.time_until_pos(beamy, beamx) - increment * 6; - for (i = 0; i <= 12; i++) - { - machine().scheduler().timer_set(time, timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback),this), beamx); - time += increment; - } + + m_beam_firq_count = 0; + m_beam_firq_timer->adjust(time, beamx); } return 0; |