From d1904214a8dec01f6c7d02b349b852c9b8f66842 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 12 May 2022 09:30:06 -0400 Subject: avalnche: Change periodic interrupt to scanline interrupt; add watchdog timeout --- src/mame/drivers/avalnche.cpp | 10 ++++++++-- src/mame/includes/avalnche.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/avalnche.cpp b/src/mame/drivers/avalnche.cpp index 7c8896238b9..588ffe46791 100644 --- a/src/mame/drivers/avalnche.cpp +++ b/src/mame/drivers/avalnche.cpp @@ -40,6 +40,11 @@ #include "avalnche.lh" +TIMER_DEVICE_CALLBACK_MEMBER(avalnche_state::nmi_16v) +{ + m_maincpu->pulse_input_line(m6502_device::NMI_LINE, attotime::zero); +} + /************************************* * * Video update @@ -216,7 +221,8 @@ void avalnche_state::avalnche_base(machine_config &config) /* basic machine hardware */ M6502(config, m_maincpu, 12.096_MHz_XTAL / 16); /* clock input is the "2H" signal divided by two */ m_maincpu->set_addrmap(AS_PROGRAM, &avalnche_state::main_map); - m_maincpu->set_periodic_int(FUNC(avalnche_state::nmi_line_pulse), attotime::from_hz(8*60)); + + TIMER(config, "16v").configure_scanline(FUNC(avalnche_state::nmi_16v), "screen", 32, 32); // 8 interrupts per frame F9334(config, m_latch); // F8 m_latch->q_out_cb<0>().set_output("led0"); // 1 CREDIT LAMP @@ -225,7 +231,7 @@ void avalnche_state::avalnche_base(machine_config &config) m_latch->q_out_cb<7>().set_output("led2"); // START LAMP // Q1, Q4, Q5, Q6 are configured in audio/avalnche.cpp - WATCHDOG_TIMER(config, "watchdog"); + WATCHDOG_TIMER(config, "watchdog").set_vblank_count("screen", 10); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/includes/avalnche.h b/src/mame/includes/avalnche.h index 14d2b97c89e..ffd004e4824 100644 --- a/src/mame/includes/avalnche.h +++ b/src/mame/includes/avalnche.h @@ -7,6 +7,7 @@ *************************************************************************/ #include "machine/74259.h" +#include "machine/timer.h" #include "sound/discrete.h" class avalnche_state : public driver_device @@ -39,6 +40,7 @@ private: DECLARE_WRITE_LINE_MEMBER(credit_2_lamp_w); DECLARE_WRITE_LINE_MEMBER(start_lamp_w); virtual void machine_start() override; + TIMER_DEVICE_CALLBACK_MEMBER(nmi_16v); uint32_t screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void avalnche_noise_amplitude_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER(catch_aud0_w); -- cgit v1.2.3