From 33451307ae4e3a4119dd6be46b25aec03aa51b5d Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 10 May 2024 17:49:56 +0200 Subject: Ensure long irs sequencer_tick can be interrupted --- src/gba/gba.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gba/gba.h') diff --git a/src/gba/gba.h b/src/gba/gba.h index 3f629fd..1bb3afd 100644 --- a/src/gba/gba.h +++ b/src/gba/gba.h @@ -534,6 +534,14 @@ void irs_set(IrqIndex idx, IrsFunc func); // assembly and enable interrupts. void irq_init(void); +// Only should be used inside an IrsFunc to enable it being interrupted by the +// given interrupt (nested IRS). +static inline void +irs_interruptible(IrqIndex idx) { + IRQ_ENABLE |= (1 << idx); + IRQ_CTRL = 1; +} + // // BIOS function declarations. // -- cgit v1.2.1