From 03214b3848fc6f458bf6e7317a6cf0484c3d43df Mon Sep 17 00:00:00 2001 From: riccardom Date: Thu, 12 Nov 2009 21:12:05 +0000 Subject: [PATCH] Move wait4IRQ before intrWaitARM since it used by the latter. --- desmume/src/bios.cpp | 50 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/desmume/src/bios.cpp b/desmume/src/bios.cpp index 2fd188ec8..0dcfda028 100644 --- a/desmume/src/bios.cpp +++ b/desmume/src/bios.cpp @@ -212,6 +212,31 @@ TEMPLATE static u32 WaitByLoop() return cpu->R[0] * 4; } +TEMPLATE static u32 wait4IRQ() +{ + //execute= FALSE; + u32 instructAddr = cpu->instruct_adr; + if(cpu->wirq) + { + if(!cpu->waitIRQ) + { + cpu->waitIRQ = 0; + cpu->wirq = 0; + //cpu->switchMode(oldmode[cpu->proc_ID]); + return 1; + } + cpu->R[15] = instructAddr; + cpu->next_instruction = instructAddr; + return 1; + } + cpu->waitIRQ = 1; + cpu->wirq = 1; + cpu->R[15] = instructAddr; + cpu->next_instruction = instructAddr; + //oldmode[cpu->proc_ID] = cpu->switchMode(SVC); + return 1; +} + //u32 oldmode[2]; TEMPLATE u32 intrWaitARM() @@ -259,31 +284,6 @@ TEMPLATE static u32 waitVBlankARM() return intrWaitARM(); } -TEMPLATE static u32 wait4IRQ() -{ - //execute= FALSE; - u32 instructAddr = cpu->instruct_adr; - if(cpu->wirq) - { - if(!cpu->waitIRQ) - { - cpu->waitIRQ = 0; - cpu->wirq = 0; - //cpu->switchMode(oldmode[cpu->proc_ID]); - return 1; - } - cpu->R[15] = instructAddr; - cpu->next_instruction = instructAddr; - return 1; - } - cpu->waitIRQ = 1; - cpu->wirq = 1; - cpu->R[15] = instructAddr; - cpu->next_instruction = instructAddr; - //oldmode[cpu->proc_ID] = cpu->switchMode(SVC); - return 1; -} - TEMPLATE static u32 sleep() { _MMU_write08(0x04000301, 0xC0);