gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Sleep mode

#44822 - ANeo7782 - Sun Jun 05, 2005 8:55 pm

Has anybody figured out how to implement sleep mode yet? (with or without the blinking light)

I'd like to be able to make the screens shut off and sleep the CPUs if possible, and if anyone's done it, code and/or an example (a demo that uses it?) would be excellent. I know I sure don't like leaving the screens on to take my DS to a friend's to show him a homebrew app :P

Thanks!
_________________
AndrewNeo - Username disallowed.
NCN DSDev Team Leader

#44823 - strager - Sun Jun 05, 2005 8:59 pm

Use swi 3 in ARM7. Not sure about the other processor. Remember to set up an interrupt to cancel the sleep before hand, or nothing will happen.

#44826 - ANeo7782 - Sun Jun 05, 2005 9:07 pm

I see swi 3 (it's in both processors, I'd assume it'd be used with the arm9 as well), but this is why I asked for code.. how do I check for the lid closed? Where would I put the checks, inside the IRQ interrupt function? How do I actually turn the power off to the screens?
_________________
AndrewNeo - Username disallowed.
NCN DSDev Team Leader

#44833 - strager - Sun Jun 05, 2005 9:41 pm

http://www.bottledlight.com/ds/index.php/Misc/KeyInput

The XKEYS register, bit 7. I don't know how you would set up an interrupt with XKEYS. Might have to look around.

Edit: OK, I was wrong. It is swi 7. I was thinking about the GBA. :-)