1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-09 22:56:53 +02:00

Toggle 3DS lower screen backlight by touching screen (#190)

This commit is contained in:
vaguerant
2019-06-23 17:35:37 +10:00
committed by Timur Gagiev
parent 3cd52ae3bc
commit 7dd02f914c

View File

@@ -37,6 +37,9 @@ bool osJoyReady(int index) {
return index == 0;
}
// backlight
bool bottomScreenOn = true;
void osJoyVibrate(int index, float L, float R) {
//
}
@@ -67,6 +70,18 @@ void inputUpdate() {
if (fabsf(stickL.x) < 0.3f && fabsf(stickL.y) < 0.3f) stickL = vec2(0.0f);
Input::setJoyPos(0, jkL, stickL);
if (hidKeysDown() & KEY_TOUCH) {
gspLcdInit();
if (bottomScreenOn) {
GSPLCD_PowerOffBacklight(GSPLCD_SCREEN_BOTTOM);
bottomScreenOn = false;
} else {
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM);
bottomScreenOn = true;
}
gspLcdExit();
}
}
void inputFree() {
@@ -181,6 +196,11 @@ int main() {
inputFree();
sndFree();
if (!bottomScreenOn) {
gspLcdInit();
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM);
gspLcdExit();
}
Game::deinit();
return 0;