Change Brightness On Boot


WarmFluffyUK

The Big Wad Bolf.
Joined
Sep 4, 2004
Messages
3,384
Location
UK
Website
www.retrotech.one
Hi guys,

I was wondering if any of you can help me with a little problem. I want to change the brightness of my LCD, I have written a batch file called gamma.gpe with the following in it:

Code:
#!/bin/sh
/mnt/sd/Util/cpu/cpu_speed.gpe --gamma 1.5
sync
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu

The above works perfectly, but now I want to run this on boot, so I tried changing the file name from gamma.gpe to autorun.gpu. After booting all I got was a blank screen and no menu. Does anyone know what's up?

By the way, what does sync do?
 
Sync causes the file system buffers to be flushed to the SD card. Unless cpu_speed.gpe is writing to a file there's no point doing this, but it should not hurt either.

I've done a few experiments and what happens is ...

The autorun file is detected and run by gp2xmenu when it starts. If you end the script with a call to gp2xmenu, it executes autorun again. This means it gets stuck in a loop executing the autorun file.

My hacky solution so far is to get autorun.gpu to rename itself, call another script in background then starts gp2xmenu. The background script waits a few seconds then renames autorun back to its proper name. It works but is obviously pants :)
 
There is a noboot option i think that you have to use if you want it to only run the autorun.gpu once. Lemme whip out my SD and see if I can find the script. In the mean time, if anyone else knows it, then please post it.
 
woogal posted on Oct 15 2006 at 10:52 AM said:
./gp2xmenu --disable-autorun
Yayyy, thanks that worked perfectly.

So I am guessing that every time gp2xmenu is invoked it executed the autorun script and that was re running gp2xmenu, so it got itself in a loop.

Thanks for the solution :wub:
 
Last edited by a moderator:
I have mine set up so I have to options in settings under GMenu2x. G. High and G. Norm
High sets it to 2.0 and Norm of course goes back to 1.0 I do this because some videos (varies from show to show) are almost impossible to watch at the normal gamma setting. And, it keeps me from having to change it from within cpu_speed.
 
Sorry to resurrect that old thread, but I was wondering if it was possible to keep the gamma settings when an emulator is launched.

In other words, I can clearly see the difference in brightness in the menu (firmware 3.0.0), but once I launch, for instance, Outcast, the gamma level reverts to the original one.

here is my autorun.gpu:

QUOTE
#!/bin/sh

/mnt/sd/tweaker/cpu_speed.gpe 1 1 200 1.6
sync
cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu --boot --disable-autorun


By the way, I'm no programmer :)
 
I added the ability to change the gamma for every link in GMenu2X but it seems like a lot of apps reset the value when they start so it doesn't work everytime.
Does cpuspeed work for every application or this happens also with it?
 
Ryo said:
I added the ability to change the gamma for every link in GMenu2X but it seems like a lot of apps reset the value when they start so it doesn't work everytime.
Does cpuspeed work for every application or this happens also with it?
Well, the gamma correction is done through cpuspeed.gpe, and I have never been able to launch anything after using cpuspeed with the gamma level being maintained.
I haven't tried to alter the cpu speed either, as all I'm really interested in is having a brighter screen with a better viewing angle, which gamma correction seems to provide.

Would I have to write specific command lines for every application? What would that look like? As I said, I'm not much of a programmer...
 
Last edited by a moderator:
Has anyone actually managed to maintain a higher (or lower) level of brightness after launching an application?

If you have, please enlighten me :D
 
well, a save way would be to first execute the app and then run the tweaker a few seconsd later.

like

#!/bin/sh
&./your\ app.gpe
sleep 2
exec /mnt/sd/tweaker/cpu_speed.gpe 1 1 200 1.6
 
hmmm, it seems that whatever I do, the app (outcast in this instance) resets the gamma to default...
 
Here is my (not working) gpe:

CODE
#!/bin/sh

cd /mnt/sd//emulators/outcast/
./outcast.gpe
sleep 4
exec /mnt/sd/tweaker/cpu_speed.gpe --gamma 0.2


outcast launches, but with no difference as far as gamma is concerned
 
Thanks for the input, guys

As you can see, I'm a bit out of my depth here.

Anyway, Ryo, now outcast launches, then within a few seconds freezes, probably when cpu_speed tries to launch :angry:
 
Back
Top