paulo@0: #include "ljgba.h" paulo@0: #define BIOS_IF (*(volatile unsigned short *)0x03FFFFF8) paulo@0: paulo@0: volatile int curTime = 0; paulo@0: paulo@0: void isr(void) { paulo@0: unsigned int interrupts = REG_IF; paulo@0: paulo@0: if (interrupts & IRQ_VBLANK) { paulo@0: ++curTime; paulo@0: } paulo@0: paulo@0: BIOS_IF |= interrupts; paulo@0: REG_IF = interrupts; paulo@0: }