#62917 - Dannon - Tue Dec 06, 2005 10:22 pm
I have looked around for info on this and can't seem to find what I'm looking for. When I close the hinge on my DS I want the screens to turn off, this works fine using:
Code: |
if ( hingeClosed )
powerOFF( POWER_ALL );
|
I'm not too sure if this is the correct code for turning the screens off but it does work, does this just turn of the entire power to the system?. Anyhoo, I've tried using this function when the DS is closed:
Code: |
void HingeClosed()
{
if ( hingeClosed )
powerOFF( POWER_ALL );
while ( 1 )
if ( !hingeClosed )
{
powerON( POWER_ALL );
return;
}
}
|
but the DS screens do not turn back on when the DS is opened up again, I'm sure I'm doing something wrong again. If this is infacting turning off all power to the DS when the DS is closed surely powerON() should at least turn all the power back on.
Anyway, the overall question that I ask is....How do I turn the screens back on?
--Dannon
#63258 - dantheman - Sat Dec 10, 2005 7:26 pm
I am by no means a coder of any sort, but this seems sort of silly:
Quote: |
If this is infacting turning off all power to the DS when the DS is closed surely powerON() should at least turn all the power back on. |
Wouldn't it be common sense that once you turn it off, you can't turn it back on unless you physically press the power button? TVs will turn on when you press the Power button on a remote control because the TV is supplied with a small amount of power so it's never really truly off, unless of course you unplug it. If you do the equivalent of "unplugging" the DS, then how is it going to know when to turn back on? All your instructions would be lost when you turn off the power, right?
Like I said, I do not code. At all. Therefore, this is just a guess. I'm most likely wrong.
#63262 - MaHe - Sat Dec 10, 2005 9:21 pm
He probably wants to turn the screens off. But he turned off the whole system.
#63267 - FloFri - Sat Dec 10, 2005 10:26 pm
normally powerOFF does not power off the system power, but all components of the system (screens, sound, etc.).
Normally your code should work, but where do you get "hingeClosed" from? I could not find it in libnds. If it is your own function, maybe it returns always true, wher it returned true one time before.
#63268 - Dannon - Sat Dec 10, 2005 11:08 pm
hingeClosed is a bool in my input class, its in my button check update function the hinge check looks like this:
hingeClosed in my previous bit of code is actually pInput->m_bHinge, I just simplified it in the post.
Code: |
// If the hinge is open
if ( (specialKeysPressed & (1 << 7)) )
m_bHinge = true;
else
m_bHinge = false;
|
I know all the input works as I have just printed to the console when the DS is closed and open, it all works fine with all of the inputs on the DS.
When the DS uses the powerOFF() function the screens go off but the green LED light stays on, so I would imagine it can be powered on again with the right commands. Can you turn off just the screens by passing any flags to powerOFF() or vice versa power on the screens like that.
--Dannon
#63269 - Frz - Sat Dec 10, 2005 11:13 pm
Just to further clarify
You are actually updating the variable during that loop, correct?
#63270 - Dannon - Sat Dec 10, 2005 11:28 pm
No, no I'm not.
As soon as I started reading that post I realised my rather large mistake. Thanks a lot, it all seems to be working ok I think, I haven't tested whether everything has been powered back on but the screens do come on again. I did remember to re initialise the display though and everything seems cool.
Thanks again
--Dannon
#63276 - mymateo - Sun Dec 11, 2005 2:24 am
Nevermind...
I had suggested something, but without looking closely, either at the code or the fact that by the time I looked the problem was solved a couple hours ago...
Let's chalk this one up to carelessness
#66039 - Didou - Sat Jan 07, 2006 8:04 pm
Hi,
I tried in Fushido.
The results are rather unexpected:
Code: |
powerOFF (POWER_LCD) |
shuts down the entire system (like button on/off).
Code: |
powerOFF (POWER_ALL) |
only shuts down the screens (at least that is visible) but does not shut down the whole DS.
Ideas ?
-- Didou
#66051 - SeanMon - Sat Jan 07, 2006 10:48 pm
Is there another swi function (like swiWaitForVblank) that could be used after the powerOFF call to wait for the hinge to open? Would it even do anything?
Some homebrew (nesDS I think) goes into sleep mode like commercial games do: the screens shutoff, the game state is frozen, and the power button blinks green when the hinge is closed. From this topic, it seems that powerOFF doesn't put the DS into the sleep state.
_________________
null
#66098 - Dannon - Sun Jan 08, 2006 5:32 am
PowerOff does not put the system into standby, I'm not entirely sure how to put it into standby, I just power off everything I don't need (for the moment just POWER_ALL as it is just a test), also I'm sure there is a way to make the green light blink but I don't know it
--Dannon
#66209 - olimar - Mon Jan 09, 2006 1:07 am