Screen Brightness Adjustment In Apps


DaveC

Internal Development
Joined
Mar 4, 2004
Messages
9,208
I was wondering if apps could set the screen brightness (not the gamma of the image itself like the current settings in emus)through the app itself? I am talking the max OLED light output like when done through the settings menu (low, medium, high etc). I also wonder if more in-between steps could be made other than the 4 that is in the Wiz menu now.

If this could be done in apps, brightness could be set on a per game basis in an emu and saved in their respective config file. I am thinking of MAME in particular. I wouldn't want every game brighter just some.
 
I've checked the source, and there's an fb ioctl for this. The command is FBIO_LCD_CHANGE_CONTROL (_IOW(FBIO_MAGIC, 90, unsigned int[2])), with cmd LCD_LIGHT_SET_CMD (enum value of 3) and the value you want to set it to.. that sets a duty cycle, which is a value between 0 and 1023 (but there's a remark that 0 is like 100%). The period is actually set to 4, so you should really only use values between 0 and 3 or perhaps 4, I believe - the default is 2.

So you'd want to do something like this

int params[] = { LCD_LIGHT_SET_CMD, 3 };
ioctl(fb_dev, FBIO_LCD_CHANGE_CONTROL, params);
 
So, here's a question, could you run a program in the background and accept some hotkeys to change the brightness? Like if someone wrote script to open up some background program that registers, say, L+R+SELECT+VOLUMEUP as bringing the LCD brightness up by 1?

Just a thought.
 
b1ueskycomp1ex said:
So, here's a question, could you run a program in the background and accept some hotkeys to change the brightness? Like if someone wrote script to open up some background program that registers, say, L+R+SELECT+VOLUMEUP as bringing the LCD brightness up by 1?

Just a thought.
It could just be an option in a menu too. This way settings could be saved on a per game basis. Darker games would have the screen set brighter, bright games could have the screen darker.
 
Last edited by a moderator:
Back
Top