//go:build gameboyadvance package interrupt // This is good documentation of the GBA: https://www.akkit.org/info/gbatek.htm import ( "device/gba" ) // Enable enables this interrupt. Right after calling this function, the // interrupt may be invoked if it was already pending. func (irq Interrupt) Enable() { gba.INTERRUPT.IE.SetBits(1 << uint(irq.num)) } var inInterrupt bool //export handleInterrupt func handleInterrupt() { inInterrupt = true flags := gba.INTERRUPT.IF.Get() for i := 0; i < 14; i++ { if flags&(1<