From 498c2b0550be2a27268c77ad1d10271f0f14eb78 Mon Sep 17 00:00:00 2001 From: mightymax Date: Sun, 7 Jan 2007 22:30:11 +0000 Subject: [PATCH] fixed and commented interrupt waiting for cp15 --- desmume/src/armcpu.h | 2 ++ desmume/src/cp15.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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; }