sceDisplayEnable & sceDisplaySetBrightness in User Mode

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
n0w
Posts: 4
Joined: Tue Feb 16, 2010 4:21 am
Location: Spain
Contact:

sceDisplayEnable & sceDisplaySetBrightness in User Mode

Post by n0w »

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: Select all

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/
unsigned int
Posts: 18
Joined: Thu Aug 13, 2009 11:42 pm

Post by unsigned int »

Just use

Code: Select all

scePowerTick(PSP_POWER_TICK_DISPLAY);
somewhere in your game loop to prevent the PSP from turning off the display.
n0w
Posts: 4
Joined: Tue Feb 16, 2010 4:21 am
Location: Spain
Contact:

Post by n0w »

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/
unsigned int
Posts: 18
Joined: Thu Aug 13, 2009 11:42 pm

Post by unsigned int »

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/ .
n0w
Posts: 4
Joined: Tue Feb 16, 2010 4:21 am
Location: Spain
Contact:

Post by n0w »

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

http://www.n0w-dev.net/
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

PSP_POWER_TICK_DISPLAY

Will only reset the screen dim/off timer. The suspend timer will still fire.
carl0sgs
Posts: 33
Joined: Thu Dec 10, 2009 3:51 am
Contact:

Post by carl0sgs »

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

Cheers
Post Reply