forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sceDisplayEnable & sceDisplaySetBrightness in User Mode

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
n0w



Joined: 16 Feb 2010
Posts: 4
Location: Spain

PostPosted: Wed Feb 17, 2010 2:38 am    Post subject: sceDisplayEnable & sceDisplaySetBrightness in User Mode Reply with quote

Hi!

I am writing a program that needs to keep the screen always turned on, but in a few seconds, if you don't press any button, psp's power management turns the brightness low and finally it turns the whole screen off.

I need to prevent psp doing this so i was thinking about something like:

Code:

sceDisplayEnable();
sceDisplaySetBrightness(100, 0);
sceKernelDelayThread(400000);


at the main loop of my program in order to prevent lcd's backlight turning off.

The problem is (i think), that i can only do these calls from a user-level thread, and as far I know, sceDisplayEnable & SetBrightness functions can only be called from a kernel-level thread...

Any idea?

Thanks for reading ;-)
_________________
"The only people who never fail are those who never try."

http://www.n0w-dev.net/
Back to top
View user's profile Send private message Visit poster's website
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Wed Feb 17, 2010 5:00 am    Post subject: Reply with quote

Just use

Code:
scePowerTick(PSP_POWER_TICK_DISPLAY);


somewhere in your game loop to prevent the PSP from turning off the display.
Back to top
View user's profile Send private message
n0w



Joined: 16 Feb 2010
Posts: 4
Location: Spain

PostPosted: Wed Feb 17, 2010 5:06 am    Post subject: Reply with quote

Wow!! I wasn't know about that function... Do you know some site with something like a well documented sce api?

I was looking for information but i only have founded info about gu programming...

Thanks :)
_________________
"The only people who never fail are those who never try."

http://www.n0w-dev.net/
Back to top
View user's profile Send private message Visit poster's website
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Wed Feb 17, 2010 5:15 am    Post subject: Reply with quote

There should be documentation about everything included in your PSPSDK installation (/usr/local/pspdev/psp/sdk/doc/ or c:\pspsdk\doc\pspsdk) or online http://psp.jim.sh/pspsdk-doc/ .
Back to top
View user's profile Send private message
n0w



Joined: 16 Feb 2010
Posts: 4
Location: Spain

PostPosted: Wed Feb 17, 2010 5:46 am    Post subject: Reply with quote

Ok man thanks!! ^^
_________________
"The only people who never fail are those who never try."

http://www.n0w-dev.net/
Back to top
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Feb 21, 2010 7:15 am    Post subject: Reply with quote

PSP_POWER_TICK_DISPLAY

Will only reset the screen dim/off timer. The suspend timer will still fire.
Back to top
View user's profile Send private message
carl0sgs



Joined: 10 Dec 2009
Posts: 41

PostPosted: Sun Feb 21, 2010 9:36 am    Post subject: Reply with quote

I use scePowerTick(0); and -i think- it prevents the psp from suspending and everything (like if you pressed a button.

Cheers
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group