z80.c: Allow daisy chain functionality to be used in a situation where there are more interrupt sources besides the daisy chain devices. [Wilbert Pol]

This commit is contained in:
Wilbert Pol 2011-01-05 20:32:29 +00:00
parent d195592e6c
commit 4245ddbc5e
2 changed files with 6 additions and 3 deletions

View File

@ -3679,7 +3679,7 @@ static void set_irq_line(z80_state *z80, int irqline, int state)
/* update the IRQ state via the daisy chain */
z80->irq_state = state;
if (z80->daisy.present())
z80->irq_state = z80->daisy.update_irq_state();
z80->irq_state = ( z80->daisy.update_irq_state() == ASSERT_LINE ) ? ASSERT_LINE : z80->irq_state;
/* the main execute loop will take the interrupt */
}

View File

@ -144,16 +144,19 @@ int z80_daisy_chain::update_irq_state()
int z80_daisy_chain::call_ack_device()
{
int vector = 0;
// loop over all devices; dev[0] is the highest priority
for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
{
// if this device is asserting the INT line, that's the one we want
int state = daisy->m_interface->z80daisy_irq_state();
vector = daisy->m_interface->z80daisy_irq_ack();
if (state & Z80_DAISY_INT)
return daisy->m_interface->z80daisy_irq_ack();
return vector;
}
logerror("z80daisy_call_ack_device: failed to find an device to ack!\n");
return 0;
return vector;
}