Skip to content

sinclair/specnext.cpp: Refactored INT/IRQ and implemented configurable DMA halt (delay)#14739

Merged
galibert merged 1 commit intomamedev:masterfrom
holub:next-irq
Feb 5, 2026
Merged

sinclair/specnext.cpp: Refactored INT/IRQ and implemented configurable DMA halt (delay)#14739
galibert merged 1 commit intomamedev:masterfrom
holub:next-irq

Conversation

@holub
Copy link
Contributor

@holub holub commented Dec 28, 2025

No description provided.

@galibert galibert merged commit c2c0b28 into mamedev:master Feb 5, 2026
7 checks passed
@holub holub deleted the next-irq branch February 6, 2026 00:20
Comment on lines +34 to +40
void z80n_device::nmi(int state)
{
if (state != CLEAR_LINE)
set_service_attention<SA_NMI_PENDING, 1>();
else
set_service_attention<SA_NMI_PENDING, 0>();
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this CPU really allow NMI to be deasserted externally (rather than the common edge-triggered behaviour)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Multiface button NMI holding while button pressed.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but NMI is edge-triggered for most Z80-like CPUs, so dropping the NMI input won’t actually deassert the NMI condition. A logical 0->1 transition (after taking active low inputs into account) on the input triggers the condition, and it won’t be retriggered until there’s another 0->1 condition, but a 1->0 transition doesn’t clear the condition.

Unless I’m missing something (which is entirely possible), this looks like it’s treating NMI as a level-sensitive input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly that's beyond my expertise. Don't forget z80n is software cpu so anything is possible. I can only judge by testcases I've tried, it's sometime very exhausting to do everything "right" by comparing to Verilog, sorry.

Copy link
Member

Choose a reason for hiding this comment

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

The verilog is available somewhere? I can probably check whether it's edge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Why does it have this member function at all, rather than just using set_input_line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm positive set_input_line didn't work for me in some case. Let me try to recall what was it.

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.

3 participants