From 7dd02f914c0c4e7eadcda1c50d11f1bf230d1703 Mon Sep 17 00:00:00 2001 From: vaguerant Date: Sun, 23 Jun 2019 17:35:37 +1000 Subject: [PATCH] Toggle 3DS lower screen backlight by touching screen (#190) --- src/platform/3ds/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/platform/3ds/main.cpp b/src/platform/3ds/main.cpp index 4346fa0..2d37cea 100644 --- a/src/platform/3ds/main.cpp +++ b/src/platform/3ds/main.cpp @@ -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;