mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-11 15:45:05 +02:00
Toggle 3DS lower screen backlight by touching screen (#190)
This commit is contained in:
@@ -37,6 +37,9 @@ bool osJoyReady(int index) {
|
|||||||
return index == 0;
|
return index == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// backlight
|
||||||
|
bool bottomScreenOn = true;
|
||||||
|
|
||||||
void osJoyVibrate(int index, float L, float R) {
|
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);
|
if (fabsf(stickL.x) < 0.3f && fabsf(stickL.y) < 0.3f) stickL = vec2(0.0f);
|
||||||
Input::setJoyPos(0, jkL, stickL);
|
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() {
|
void inputFree() {
|
||||||
@@ -181,6 +196,11 @@ int main() {
|
|||||||
|
|
||||||
inputFree();
|
inputFree();
|
||||||
sndFree();
|
sndFree();
|
||||||
|
if (!bottomScreenOn) {
|
||||||
|
gspLcdInit();
|
||||||
|
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM);
|
||||||
|
gspLcdExit();
|
||||||
|
}
|
||||||
Game::deinit();
|
Game::deinit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user