; Game cart IRQ routine handlers. ; Dummy function for all unhandled interrupts. unhandled_irq: reti ; Interrupt handler for power key. ; (The PM never really turns off but instead goes into ; a software controlled sleep mode.) int_power_key: ; Write to the interrupt flag register, instead of setting the bit ; it will clear the bit that indicates that the power key is pressed ; so that the PM knows that we handled this interrupt movb [nn+0x29], (1<<7) ; Test if power key is pressed (if you don't test it is possible that ; the PM will turn off right after you turn it on). test [nn+0x52], (1<<7) jnz noturnoff ; Pokemon Mini IRQ #24: shutdown (thus: software controlled sleep mode). cint 0x24 noturnoff: reti ; Return from interrupt (if the power key is not pressed)