From e22564a29c1662fbdbca5dd8c008136f11a6faa7 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Fri, 25 Jun 2021 23:34:58 +0100 Subject: [PATCH] disable interrupts during handler --- agb/interrupt_simple.s | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/agb/interrupt_simple.s b/agb/interrupt_simple.s index d6cb80d7..940f75b4 100644 --- a/agb/interrupt_simple.s +++ b/agb/interrupt_simple.s @@ -6,6 +6,11 @@ InterruptHandlerSimple: ldr r2, =0x04000200 @ interrupt enable register location + mov r1, #0 + strh r1, [r2, #8] + + push {r2} + ldrh r1, [r2] @ load 16 bit interrupt enable to r1 ldrh r3, [r2, #2] @ load 16 bit interrupt request to r3 and r0, r1, r3 @ interrupts both enabled and requested @@ -33,5 +38,10 @@ InterruptHandlerSimple: bic r2, r2, #0xD msr cpsr_c, r2 + pop {r2} + + mov r1, #0 + strh r1, [r2, #8] + bx lr @ return to bios .pool