Skip to content

Conversation

gm-matthew
Copy link
Contributor

If a particular IRQ line is already high, trying to assert another IRQ on the same line no longer has any effect; the IRQ line must be cleared/lowered first before another IRQ can be asserted.

IRQ acknowledgement logic has been implemented for Namco System FL, since it is now required with the i960 update.

Machine is responsible for clearing IRQ lines on reset
Comment on lines +660 to +664
const int irq_type[4] = { I960_IRQ0, I960_IRQ1, I960_IRQ2, I960_IRQ3 };
for (int i = 0; i < 4; i++)
{
m_maincpu->set_input_line(irq_type[i], CLEAR_LINE);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move your array of interrupt numbers to an anonymous namespace and make it constexpr so it doesn’t need to be repeated?
Why not use a rang-based for loop here to avoid pitfalls, like

	for (auto line : irqs)
		m_maincpu->set_input_line(line, CLEAR_LINE);

Comment on lines +273 to +277
const int irq_type[4] = { I960_IRQ0, I960_IRQ1, I960_IRQ2, I960_IRQ3 };
for (int i = 0; i < 4; i++)
{
m_maincpu->set_input_line(irq_type[i], CLEAR_LINE);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a case for a range-based for loop as well.

@angelosa
Copy link
Member

Is it known if the i960 really has this internally rather than having external circuitry doing the job? i.e. is there a page from manual stating so?

@cuavas
Copy link
Member

cuavas commented Sep 18, 2025

Is it known if the i960 really has this internally rather than having external circuitry doing the job? i.e. is there a page from manual stating so?

The code as it stands is just a buggy implementation of edge-triggered interrupts. It’s wrong either way. If the chip inherently has edge-triggered interrupts, then this is the correct fix, but it it doesn’t, it should still only be checking for changes, but should clear the condition when it gets the clear line state.

As far as I can tell, the 80960 core has level-sensitive interrupts. You need a separate interrupt controller to implement edge-triggered interrupts.

However the i960 Jx has an integrated interrupt controller that can be configured for level-sensitive or edge-triggered interrupts. It also has eight interrupt pins, and allows them to be treated as independent interrupt inputs, a bitfield allowing one of 240 interrupt interrupts to be signaled (68k style but with eight pins instead of three), or a hybrid mode with three independent interrupts and five pins used as a bitfield for signaling one of 32 interrupts.

What is MAME actually supposed to be emulating here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants