(nw) invaders revenge: cleaned up nmi code

This commit is contained in:
Robbbert 2019-05-05 23:13:41 +10:00
parent 8e5450ed88
commit 144b37ec75
2 changed files with 3 additions and 8 deletions

View File

@ -1023,14 +1023,8 @@ WRITE8_MEMBER(_8080bw_state::invrvnge_port05_w)
// The timer frequency controls the speed of the sounds
TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::nmi_timer)
{
// This is to prevent an instant NMI and crash before the CPU can set up its environment
m_timer_state++;
if (m_timer_state < 0x1000)
return;
m_timer_state ^= 1;
m_audiocpu->set_input_line(INPUT_LINE_NMI, BIT(m_timer_state, 0) ? ASSERT_LINE : CLEAR_LINE );
if (m_timer_state == 0xf000)
m_timer_state = 0x8000;
}

View File

@ -39,6 +39,7 @@ public:
, m_palette(*this, "palette")
, m_gunx(*this, "GUNX")
, m_guny(*this, "GUNY")
, m_timer_state(1)
{ }
void indianbtbr(machine_config &config);
@ -111,7 +112,7 @@ private:
uint8_t m_schaser_background_select;
uint16_t m_claybust_gun_pos;
u8 m_sound_data;
u16 m_timer_state;
bool m_timer_state;
TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
DECLARE_READ8_MEMBER(indianbt_r);