From 920be714ac1ee862df04633cc1b1bfec9d725c77 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Sun, 8 Feb 2009 21:38:30 +0000 Subject: [PATCH] Stub implementation for ARM7 SWI #7 (Sleep), by writing 0xC0 to HALTCNT, exactly as on the DS. TODO: implement HALTCNT at the MMU side. --- desmume/src/bios.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desmume/src/bios.cpp b/desmume/src/bios.cpp index 1c1d4cba3..bd1b0b997 100644 --- a/desmume/src/bios.cpp +++ b/desmume/src/bios.cpp @@ -312,6 +312,12 @@ TEMPLATE static u32 wait4IRQ() return 1; } +TEMPLATE static u32 sleep() +{ + _MMU_write08(cpu->proc_ID, 0x04000301, 0xC0); + return 1; +} + TEMPLATE static u32 divide() { s32 num = (s32)cpu->R[0]; @@ -1059,7 +1065,7 @@ u32 (* ARM7_swi_tab[32])()={ intrWaitARM, // 0x04 waitVBlankARM, // 0x05 wait4IRQ, // 0x06 - wait4IRQ, // 0x07 + sleep, // 0x07 SoundBias, // 0x08 divide, // 0x09 bios_nop, // 0x0A