mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(platform_psp.c) Add some Vita ifdefs
This commit is contained in:
parent
273788cdf9
commit
536b7fad0b
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
|
#include <psp2/moduleinfo.h>
|
||||||
#include <psp2/power.h>
|
#include <psp2/power.h>
|
||||||
#else
|
#else
|
||||||
#include <pspkernel.h>
|
#include <pspkernel.h>
|
||||||
@ -41,7 +42,11 @@
|
|||||||
#include "../../psp1/kernel_functions.h"
|
#include "../../psp1/kernel_functions.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PSP_MODULE_INFO("RetroArch PSP", 0, 1, 1);
|
#ifdef VITA
|
||||||
|
PSP2_MODULE_INFO(0, 0, "RetroArch");
|
||||||
|
#else
|
||||||
|
PSP_MODULE_INFO("RetroArch", 0, 1, 1);
|
||||||
|
#endif
|
||||||
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER|THREAD_ATTR_VFPU);
|
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER|THREAD_ATTR_VFPU);
|
||||||
#ifdef BIG_STACK
|
#ifdef BIG_STACK
|
||||||
PSP_MAIN_THREAD_STACK_SIZE_KB(4*1024);
|
PSP_MAIN_THREAD_STACK_SIZE_KB(4*1024);
|
||||||
@ -252,20 +257,25 @@ static int frontend_psp_get_rating(void)
|
|||||||
static enum frontend_powerstate frontend_psp_get_powerstate(int *seconds, int *percent)
|
static enum frontend_powerstate frontend_psp_get_powerstate(int *seconds, int *percent)
|
||||||
{
|
{
|
||||||
enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE;
|
enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE;
|
||||||
|
#ifndef VITA
|
||||||
int battery = scePowerIsBatteryExist(); /* this function does not exist on Vita? */
|
int battery = scePowerIsBatteryExist(); /* this function does not exist on Vita? */
|
||||||
|
#endif
|
||||||
int plugged = scePowerIsPowerOnline();
|
int plugged = scePowerIsPowerOnline();
|
||||||
int charging = scePowerIsBatteryCharging();
|
int charging = scePowerIsBatteryCharging();
|
||||||
|
|
||||||
*percent = scePowerGetBatteryLifePercent();
|
*percent = scePowerGetBatteryLifePercent();
|
||||||
*seconds = scePowerGetBatteryLifeTime() * 60;
|
*seconds = scePowerGetBatteryLifeTime() * 60;
|
||||||
|
|
||||||
|
#ifndef VITA
|
||||||
if (!battery)
|
if (!battery)
|
||||||
{
|
{
|
||||||
ret = FRONTEND_POWERSTATE_NO_SOURCE;
|
ret = FRONTEND_POWERSTATE_NO_SOURCE;
|
||||||
*seconds = -1;
|
*seconds = -1;
|
||||||
*percent = -1;
|
*percent = -1;
|
||||||
}
|
}
|
||||||
else if (charging)
|
else
|
||||||
|
#endif
|
||||||
|
if (charging)
|
||||||
ret = FRONTEND_POWERSTATE_CHARGING;
|
ret = FRONTEND_POWERSTATE_CHARGING;
|
||||||
else if (plugged)
|
else if (plugged)
|
||||||
ret = FRONTEND_POWERSTATE_CHARGED;
|
ret = FRONTEND_POWERSTATE_CHARGED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user