profi200 / open_agb_firm

open_agb_firm is a bare metal app for running GBA homebrew/games using the 3DS builtin GBA hardware.
GNU General Public License v3.0
850 stars 42 forks source link

Brightness Control #74

Closed spitzeqc closed 2 years ago

spitzeqc commented 2 years ago

Added controls for adjusting display brightness in game.

Partially fulfills #58. It does not use the 3ds slider, but rather the X button along with UP/DOWN buttons to make it compatible with 2ds as well. Additionally, screen can be completely turned off with X+LEFT, and turned back on X+RIGHT.

While this implementation is limited (screen brightness is reset to ini value after reset) and a bit clunky (game still registers d-pad presses, and controls are not necessarily intuitive), it does allow for users to change brightness without restarting the console

profi200 commented 2 years ago

I will take a look later. Thanks.

spitzeqc commented 2 years ago

Adjustments have been made. Turning on and off display have been switched to using GFX_powerOffBacklight() and GFX_powerOnBacklight(). Additionally, all brightness related controls have been put into its own function which is called from 'main' instead of 'gbaGfxHandler'.

One thing that still needs to be tested is turning on and off the display(s) on an o2ds. Currently, power related functions are called on GFX_BLIGHT_TOP and GFX_BLIGHT_BOTH for release and non-release (debug?) versions respectively. I lack the proper hardware to test if this will cause issues on the o2ds as it only contains one panel.