diff --git a/desmume/src/armcpu.h b/desmume/src/armcpu.h index a1556cb7d..10c68cdc3 100644 --- a/desmume/src/armcpu.h +++ b/desmume/src/armcpu.h @@ -183,12 +183,14 @@ static INLINE void NDS_makeARM9Int(u32 num) { MMU.reg_IF[0] |= (1<wirq) { + /* check wether an irq was issued */ if(!cpu->waitIRQ) { cpu->waitIRQ = 0; cpu->wirq = 0; - //cpu->switchMode(oldmode[cpu->proc_ID]); - return 1; + return 1; /* return execution */ } + /* otherwise, repeat this instruction */ cpu->R[15] = cpu->instruct_adr; cpu->next_instruction = cpu->R[15]; return 1; } + /* first run, set us into waiting state */ cpu->waitIRQ = 1; cpu->wirq = 1; + /* and set next instruction to repeat this */ cpu->R[15] = cpu->instruct_adr; cpu->next_instruction = cpu->R[15]; + /* CHECKME: IME shouldn't be modified (?) */ MMU.reg_IME[0] = 1; return 1; }