mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-11 15:45:05 +02:00
Merge branch 'master' of https://github.com/XProger/OpenLara
This commit is contained in:
@@ -32,19 +32,42 @@ int osGetTimeMS() {
|
|||||||
return int(osGetTime() - osStartTime);
|
return int(osGetTime() - osStartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// backlight
|
||||||
|
bool bottomScreenOn = true;
|
||||||
|
|
||||||
|
void setBottomScreen(bool enable) {
|
||||||
|
gspLcdInit();
|
||||||
|
enable ? GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM) : GSPLCD_PowerOffBacklight(GSPLCD_SCREEN_BOTTOM);
|
||||||
|
gspLcdExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
aptHookCookie(cookie);
|
||||||
|
|
||||||
|
void checkAptHook(APT_HookType hook, void *param) {
|
||||||
|
if (!bottomScreenOn) {
|
||||||
|
switch(hook) {
|
||||||
|
case APTHOOK_ONSUSPEND : setBottomScreen(1);
|
||||||
|
break;
|
||||||
|
case APTHOOK_ONRESTORE :
|
||||||
|
case APTHOOK_ONWAKEUP : setBottomScreen(0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// input
|
// input
|
||||||
bool osJoyReady(int index) {
|
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) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
void inputInit() {
|
void inputInit() {
|
||||||
|
aptHook(&cookie, checkAptHook, NULL);
|
||||||
hidInit();
|
hidInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,22 +97,13 @@ void inputUpdate() {
|
|||||||
|
|
||||||
if (down & KEY_TOUCH) {
|
if (down & KEY_TOUCH) {
|
||||||
bottomScreenOn = !bottomScreenOn;
|
bottomScreenOn = !bottomScreenOn;
|
||||||
gspLcdInit();
|
bottomScreenOn ? setBottomScreen(1) : setBottomScreen(0);
|
||||||
if (bottomScreenOn) {
|
|
||||||
GSPLCD_PowerOffBacklight(GSPLCD_SCREEN_BOTTOM);
|
|
||||||
} else {
|
|
||||||
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM);
|
|
||||||
}
|
|
||||||
gspLcdExit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void inputFree() {
|
void inputFree() {
|
||||||
if (!bottomScreenOn) {
|
if (!bottomScreenOn)
|
||||||
gspLcdInit();
|
setBottomScreen(1);
|
||||||
GSPLCD_PowerOnBacklight(GSPLCD_SCREEN_BOTTOM);
|
|
||||||
gspLcdExit();
|
|
||||||
}
|
|
||||||
hidExit();
|
hidExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user