forked from moonlight-stream/moonlight-embedded
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vita: New configure option
disable_powersave
If option set true, psvita never go suspend mode.
- Loading branch information
1 parent
3f6608b
commit f075b8a
Showing
8 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* This file is part of Moonlight Embedded. | ||
* | ||
* Copyright (C) 2015 Iwan Timmer, Sunguk Lee | ||
* | ||
* Moonlight is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Moonlight is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include <stdbool.h> | ||
|
||
#include <psp2/kernel/processmgr.h> | ||
#include <psp2/power.h> | ||
|
||
static bool powersave = false; | ||
|
||
int vitapower_thread(SceSize args, void *argp) { | ||
while (1) { | ||
if (powersave) { | ||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND); | ||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF); | ||
} | ||
if (!scePowerIsBatteryCharging() && scePowerIsLowBattery()) { | ||
// TODO print warning message | ||
} | ||
sceKernelDelayThread(10 * 1000 * 1000); | ||
} | ||
return 0; | ||
} | ||
|
||
void vitapower_init() { | ||
SceUID thid = sceKernelCreateThread("vitapower_thread", vitapower_thread, 0x10000100, 0x40000, 0, 0, NULL); | ||
if (thid >= 0) | ||
sceKernelStartThread(thid, 0, NULL); | ||
} | ||
|
||
void vitapower_disable_powersave() { | ||
powersave = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This file is part of Moonlight Embedded. | ||
* | ||
* Copyright (C) 2015 Iwan Timmer, Sunguk Lee | ||
* | ||
* Moonlight is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Moonlight is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
void vitapower_init(); | ||
void vitapower_disable_powersave(); |