2012-11-01 16:19:01 +01:00
// Copyright (c) 2012- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
2012-11-04 23:01:49 +01:00
// the Free Software Foundation, version 2.0 or later versions.
2012-11-01 16:19:01 +01:00
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2012-11-11 22:50:48 +01:00
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2012-11-01 16:19:01 +01:00
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
2012-11-10 10:15:11 +01:00
# include <map>
2013-08-21 01:10:30 -07:00
# include "Common/ChunkFile.h"
# include "Core/HLE/HLE.h"
# include "Core/CoreTiming.h"
# include "Core/Reporting.h"
2013-06-12 17:15:45 -04:00
# include "Core/Config.h"
2012-11-01 16:19:01 +01:00
2013-08-21 01:10:30 -07:00
# include "Core/HLE/scePower.h"
# include "Core/HLE/sceKernelThread.h"
2012-12-09 13:48:25 -08:00
const int PSP_POWER_ERROR_TAKEN_SLOT = 0x80000020 ;
const int PSP_POWER_ERROR_SLOTS_FULL = 0x80000022 ;
const int PSP_POWER_ERROR_PRIVATE_SLOT = 0x80000023 ;
const int PSP_POWER_ERROR_EMPTY_SLOT = 0x80000025 ;
const int PSP_POWER_ERROR_INVALID_CB = 0x80000100 ;
const int PSP_POWER_ERROR_INVALID_SLOT = 0x80000102 ;
const int PSP_POWER_CB_AC_POWER = 0x00001000 ;
const int PSP_POWER_CB_BATTERY_EXIST = 0x00000080 ;
const int PSP_POWER_CB_BATTERY_FULL = 0x00000064 ;
2012-11-11 21:32:44 +00:00
const int POWER_CB_AUTO = - 1 ;
2012-12-09 13:48:25 -08:00
2013-03-19 06:32:43 +08:00
const int PSP_MODEL_FAT = 0 ;
const int PSP_MODEL_SLIM = 1 ;
2013-03-19 06:09:37 +08:00
2012-11-11 21:32:44 +00:00
const int numberOfCBPowerSlots = 16 ;
2012-12-09 13:48:25 -08:00
const int numberOfCBPowerSlotsPrivate = 32 ;
2012-11-11 21:32:44 +00:00
2012-12-23 22:47:52 -08:00
static bool volatileMemLocked ;
static int powerCbSlots [ numberOfCBPowerSlots ] ;
2012-11-10 10:15:11 +01:00
2013-03-02 14:32:31 +01:00
// this should belong here on in CoreTiming?
static int pllFreq = 222 ;
static int busFreq = 111 ;
2012-11-10 10:15:11 +01:00
void __PowerInit ( ) {
memset ( powerCbSlots , 0 , sizeof ( powerCbSlots ) ) ;
2012-12-23 22:47:52 -08:00
volatileMemLocked = false ;
2013-06-12 17:15:45 -04:00
if ( g_Config . iLockedCPUSpeed > 0 ) {
CoreTiming : : SetClockFrequencyMHz ( g_Config . iLockedCPUSpeed ) ;
pllFreq = g_Config . iLockedCPUSpeed ;
busFreq = g_Config . iLockedCPUSpeed / 2 ;
}
2012-11-10 10:15:11 +01:00
}
2012-12-27 23:00:04 -08:00
void __PowerDoState ( PointerWrap & p ) {
p . DoArray ( powerCbSlots , ARRAY_SIZE ( powerCbSlots ) ) ;
p . Do ( volatileMemLocked ) ;
p . DoMarker ( " scePower " ) ;
}
2012-12-09 19:41:19 +07:00
int scePowerGetBatteryLifePercent ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 100=scePowerGetBatteryLifePercent " ) ;
2012-11-11 21:32:44 +00:00
return 100 ;
2012-11-01 16:19:01 +01:00
}
2012-11-11 22:50:48 +01:00
2013-01-11 00:15:16 -08:00
int scePowerGetBatteryLifeTime ( ) {
DEBUG_LOG ( HLE , " 0=scePowerGetBatteryLifeTime() " ) ;
// 0 means we're on AC power.
return 0 ;
}
2013-06-23 16:52:41 +09:00
int scePowerGetBatteryTemp ( ) {
DEBUG_LOG ( HLE , " 0=scePowerGetBatteryTemp() " ) ;
// 0 means celsius temperature of the battery
return 0 ;
}
2012-12-09 19:41:19 +07:00
int scePowerIsPowerOnline ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 1=scePowerIsPowerOnline " ) ;
2012-11-11 21:32:44 +00:00
return 1 ;
2012-11-01 16:19:01 +01:00
}
2012-11-11 22:50:48 +01:00
2012-12-09 19:41:19 +07:00
int scePowerIsBatteryExist ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 1=scePowerIsBatteryExist " ) ;
2012-11-11 21:32:44 +00:00
return 1 ;
2012-11-01 16:19:01 +01:00
}
2012-11-11 22:50:48 +01:00
2012-12-09 19:41:19 +07:00
int scePowerIsBatteryCharging ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 0=scePowerIsBatteryCharging " ) ;
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-11-11 22:50:48 +01:00
2012-12-09 19:41:19 +07:00
int scePowerGetBatteryChargingStatus ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 0=scePowerGetBatteryChargingStatus " ) ;
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-11-11 22:50:48 +01:00
2012-12-09 19:41:19 +07:00
int scePowerIsLowBattery ( ) {
2012-11-01 16:19:01 +01:00
DEBUG_LOG ( HLE , " 0=scePowerIsLowBattery " ) ;
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-12-09 19:41:19 +07:00
int scePowerRegisterCallback ( int slot , int cbId ) {
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " 0=scePowerRegisterCallback(%i, %i) " , slot , cbId ) ;
if ( slot < - 1 | | slot > = numberOfCBPowerSlotsPrivate ) {
return PSP_POWER_ERROR_INVALID_SLOT ;
}
if ( slot > = numberOfCBPowerSlots ) {
return PSP_POWER_ERROR_PRIVATE_SLOT ;
}
// TODO: If cbId is invalid return PSP_POWER_ERROR_INVALID_CB.
if ( cbId = = 0 ) {
return PSP_POWER_ERROR_INVALID_CB ;
}
int retval = - 1 ;
2012-11-11 21:32:44 +00:00
2012-12-09 19:41:19 +07:00
if ( slot = = POWER_CB_AUTO ) { // -1 signifies auto select of bank
for ( int i = 0 ; i < numberOfCBPowerSlots ; i + + ) {
2012-12-09 13:48:25 -08:00
if ( powerCbSlots [ i ] = = 0 & & retval = = - 1 ) { // found an empty slot
2012-11-11 21:32:44 +00:00
powerCbSlots [ i ] = cbId ;
2012-12-09 13:48:25 -08:00
retval = i ;
2012-11-11 19:30:48 +01:00
}
}
2012-12-09 13:48:25 -08:00
if ( retval = = - 1 ) {
return PSP_POWER_ERROR_SLOTS_FULL ;
}
2012-12-09 19:41:19 +07:00
} else {
if ( powerCbSlots [ slot ] = = 0 ) {
2012-11-11 21:32:44 +00:00
powerCbSlots [ slot ] = cbId ;
2012-12-09 13:48:25 -08:00
retval = 0 ;
2012-12-09 19:41:19 +07:00
} else {
2012-12-09 13:48:25 -08:00
return PSP_POWER_ERROR_TAKEN_SLOT ;
2012-11-11 19:30:48 +01:00
}
}
2012-12-09 13:48:25 -08:00
if ( retval > = 0 ) {
2012-11-11 21:32:44 +00:00
__KernelRegisterCallback ( THREAD_CALLBACK_POWER , cbId ) ;
2012-12-09 13:48:25 -08:00
int arg = PSP_POWER_CB_AC_POWER | PSP_POWER_CB_BATTERY_EXIST | PSP_POWER_CB_BATTERY_FULL ;
__KernelNotifyCallbackType ( THREAD_CALLBACK_POWER , cbId , arg ) ;
2012-11-11 21:32:44 +00:00
}
2012-12-09 13:48:25 -08:00
return retval ;
2012-11-10 10:15:11 +01:00
}
2012-12-09 19:41:19 +07:00
int scePowerUnregisterCallback ( int slotId ) {
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " 0=scePowerUnregisterCallback(%i) " , slotId ) ;
if ( slotId < 0 | | slotId > = numberOfCBPowerSlotsPrivate ) {
return PSP_POWER_ERROR_INVALID_SLOT ;
}
if ( slotId > = numberOfCBPowerSlots ) {
return PSP_POWER_ERROR_PRIVATE_SLOT ;
2012-11-11 22:50:48 +01:00
}
2012-11-11 21:32:44 +00:00
2012-12-09 19:41:19 +07:00
if ( powerCbSlots [ slotId ] ! = 0 ) {
2012-11-11 19:30:48 +01:00
int cbId = powerCbSlots [ slotId ] ;
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " 0=scePowerUnregisterCallback(%i) (cbid = %i) " , slotId , cbId ) ;
2012-11-11 19:30:48 +01:00
__KernelUnregisterCallback ( THREAD_CALLBACK_POWER , cbId ) ;
powerCbSlots [ slotId ] = 0 ;
2012-12-09 19:41:19 +07:00
} else {
2012-12-09 13:48:25 -08:00
return PSP_POWER_ERROR_EMPTY_SLOT ;
2012-11-11 22:50:48 +01:00
}
2012-11-11 21:32:44 +00:00
2012-11-11 22:50:48 +01:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-11-10 10:15:11 +01:00
2012-12-09 19:41:19 +07:00
int sceKernelPowerLock ( int lockType ) {
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " 0=sceKernelPowerLock(%i) " , lockType ) ;
if ( lockType = = 0 ) {
return 0 ;
} else {
2013-03-31 23:42:56 -07:00
return SCE_KERNEL_ERROR_INVALID_MODE ;
2012-12-09 13:48:25 -08:00
}
2012-11-01 16:19:01 +01:00
}
2012-12-09 19:41:19 +07:00
int sceKernelPowerUnlock ( int lockType ) {
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " 0=sceKernelPowerUnlock(%i) " , lockType ) ;
if ( lockType = = 0 ) {
return 0 ;
} else {
2013-03-31 23:42:56 -07:00
return SCE_KERNEL_ERROR_INVALID_MODE ;
2012-12-09 13:48:25 -08:00
}
2012-11-01 16:19:01 +01:00
}
2012-12-09 19:41:19 +07:00
int sceKernelPowerTick ( int flag ) {
2012-12-09 13:48:25 -08:00
DEBUG_LOG ( HLE , " UNIMPL 0=sceKernelPowerTick(%i) " , flag ) ;
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
# define ERROR_POWER_VMEM_IN_USE 0x802b0200
2012-12-09 19:41:19 +07:00
int sceKernelVolatileMemTryLock ( int type , int paddr , int psize ) {
if ( ! volatileMemLocked ) {
2012-11-11 21:32:44 +00:00
INFO_LOG ( HLE , " sceKernelVolatileMemTryLock(%i, %08x, %i) - success " , type , paddr , psize ) ;
volatileMemLocked = true ;
2012-12-09 19:41:19 +07:00
} else {
2013-08-21 01:10:30 -07:00
ERROR_LOG_REPORT ( HLE , " sceKernelVolatileMemTryLock(%i, %08x, %i) - already locked! " , type , paddr , psize ) ;
2012-11-11 21:32:44 +00:00
return ERROR_POWER_VMEM_IN_USE ;
}
2012-11-01 16:19:01 +01:00
2012-11-11 21:32:44 +00:00
// Volatile RAM is always at 0x08400000 and is of size 0x00400000.
// It's always available in the emu.
2012-11-19 09:25:50 +01:00
// TODO: Should really reserve this properly!
2012-11-11 21:32:44 +00:00
Memory : : Write_U32 ( 0x08400000 , paddr ) ;
Memory : : Write_U32 ( 0x00400000 , psize ) ;
2012-11-01 16:19:01 +01:00
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-12-09 19:41:19 +07:00
int sceKernelVolatileMemUnlock ( int type ) {
if ( volatileMemLocked ) {
INFO_LOG ( HLE , " sceKernelVolatileMemUnlock(%i) " , type ) ;
volatileMemLocked = false ;
} else {
2013-08-21 01:10:30 -07:00
ERROR_LOG_REPORT ( HLE , " sceKernelVolatileMemUnlock(%i) FAILED - not locked " , type ) ;
2012-12-09 19:41:19 +07:00
}
2012-11-11 21:32:44 +00:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-12-09 19:41:19 +07:00
int sceKernelVolatileMemLock ( int type , int paddr , int psize ) {
2012-11-11 21:32:44 +00:00
return sceKernelVolatileMemTryLock ( type , paddr , psize ) ;
2012-11-01 16:19:01 +01:00
}
2013-03-03 02:08:10 +08:00
u32 scePowerSetClockFrequency ( u32 pllfreq , u32 cpufreq , u32 busfreq ) {
2013-06-12 17:15:45 -04:00
if ( g_Config . iLockedCPUSpeed > 0 ) {
INFO_LOG ( HLE , " scePowerSetClockFrequency(%i,%i,%i): locked by user config at %i, %i, %i " , pllfreq , cpufreq , busfreq , g_Config . iLockedCPUSpeed , g_Config . iLockedCPUSpeed , busFreq ) ;
}
else {
CoreTiming : : SetClockFrequencyMHz ( cpufreq ) ;
pllFreq = pllfreq ;
busFreq = busfreq ;
INFO_LOG ( HLE , " scePowerSetClockFrequency(%i,%i,%i) " , pllfreq , cpufreq , busfreq ) ;
}
2013-03-03 02:08:10 +08:00
return 0 ;
2012-11-01 16:19:01 +01:00
}
2012-12-26 21:08:41 +01:00
u32 scePowerSetCpuClockFrequency ( u32 cpufreq ) {
2013-06-12 17:15:45 -04:00
if ( g_Config . iLockedCPUSpeed > 0 ) {
DEBUG_LOG ( HLE , " scePowerSetCpuClockFrequency(%i): locked by user config at %i " , cpufreq , g_Config . iLockedCPUSpeed ) ;
}
else {
CoreTiming : : SetClockFrequencyMHz ( cpufreq ) ;
DEBUG_LOG ( HLE , " scePowerSetCpuClockFrequency(%i) " , cpufreq ) ;
}
2012-12-26 21:08:41 +01:00
return 0 ;
}
u32 scePowerSetBusClockFrequency ( u32 busfreq ) {
2013-06-12 17:15:45 -04:00
if ( g_Config . iLockedCPUSpeed > 0 ) {
DEBUG_LOG ( HLE , " scePowerSetBusClockFrequency(%i): locked by user config at %i " , busfreq , busFreq ) ;
}
else {
busFreq = busfreq ;
DEBUG_LOG ( HLE , " scePowerSetBusClockFrequency(%i) " , busfreq ) ;
}
2012-12-26 21:08:41 +01:00
return 0 ;
}
2013-03-19 06:09:37 +08:00
u32 scePowerGetCpuClockFrequency ( ) {
int cpuFreq = CoreTiming : : GetClockFrequencyMHz ( ) ;
DEBUG_LOG ( HLE , " %i=scePowerGetCpuClockFrequency() " , cpuFreq ) ;
return cpuFreq ;
}
u32 scePowerGetBusClockFrequency ( ) {
INFO_LOG ( HLE , " %i=scePowerGetBusClockFrequency() " , busFreq ) ;
return busFreq ;
}
2012-12-09 19:41:19 +07:00
u32 scePowerGetCpuClockFrequencyInt ( ) {
2013-03-19 06:09:37 +08:00
int cpuFreq = CoreTiming : : GetClockFrequencyMHz ( ) ;
DEBUG_LOG ( HLE , " %i=scePowerGetCpuClockFrequencyInt() " , cpuFreq ) ;
return cpuFreq ;
2012-11-12 00:04:57 +01:00
}
2012-12-09 19:41:19 +07:00
u32 scePowerGetPllClockFrequencyInt ( ) {
2013-03-02 14:32:31 +01:00
INFO_LOG ( HLE , " %i=scePowerGetPllClockFrequencyInt() " , pllFreq ) ;
return pllFreq ;
2012-11-12 00:04:57 +01:00
}
2013-03-19 06:09:37 +08:00
u32 scePowerGetBusClockFrequencyInt ( ) {
INFO_LOG ( HLE , " %i=scePowerGetBusClockFrequencyInt() " , busFreq ) ;
return busFreq ;
}
float scePowerGetCpuClockFrequencyFloat ( ) {
int cpuFreq = CoreTiming : : GetClockFrequencyMHz ( ) ;
INFO_LOG ( HLE , " %f=scePowerGetCpuClockFrequencyFloat() " , ( float ) cpuFreq ) ;
return ( float ) cpuFreq ;
}
2013-03-04 23:39:59 +01:00
float scePowerGetPllClockFrequencyFloat ( ) {
INFO_LOG ( HLE , " %f=scePowerGetPllClockFrequencyFloat() " , ( float ) pllFreq ) ;
return ( float ) pllFreq ;
}
2013-03-19 06:09:37 +08:00
float scePowerGetBusClockFrequencyFloat ( ) {
INFO_LOG ( HLE , " %f=scePowerGetBusClockFrequencyFloat() " , ( float ) busFreq ) ;
return ( float ) busFreq ;
2012-11-01 16:19:01 +01:00
}
2013-06-11 11:48:45 +02:00
int scePowerTick ( ) {
DEBUG_LOG ( HLE , " scePowerTick() " ) ;
// Don't think we need to do anything.
return 0 ;
}
2013-03-19 06:09:37 +08:00
2013-02-02 00:22:01 +01:00
u32 IsPSPNonFat ( ) {
2013-03-19 06:32:43 +08:00
return PSP_MODEL_FAT ;
2013-02-02 00:22:01 +01:00
}
2012-12-09 19:41:19 +07:00
static const HLEFunction scePower [ ] = {
2012-11-11 21:32:44 +00:00
{ 0x04B7766E , & WrapI_II < scePowerRegisterCallback > , " scePowerRegisterCallback " } ,
{ 0x2B51FE2F , 0 , " scePower_2B51FE2F " } ,
{ 0x442BFBAC , 0 , " scePowerGetBacklightMaximum " } ,
2013-06-11 11:48:45 +02:00
{ 0xEFD3C963 , & WrapI_V < scePowerTick > , " scePowerTick " } ,
2012-11-11 21:32:44 +00:00
{ 0xEDC13FE5 , 0 , " scePowerGetIdleTimer " } ,
{ 0x7F30B3B1 , 0 , " scePowerIdleTimerEnable " } ,
{ 0x972CE941 , 0 , " scePowerIdleTimerDisable " } ,
{ 0x27F3292C , 0 , " scePowerBatteryUpdateInfo " } ,
{ 0xE8E4E204 , 0 , " scePower_E8E4E204 " } ,
{ 0xB999184C , 0 , " scePowerGetLowBatteryCapacity " } ,
{ 0x87440F5E , & WrapI_V < scePowerIsPowerOnline > , " scePowerIsPowerOnline " } ,
{ 0x0AFD0D8B , & WrapI_V < scePowerIsBatteryExist > , " scePowerIsBatteryExist " } ,
{ 0x1E490401 , & WrapI_V < scePowerIsBatteryCharging > , " scePowerIsBatteryCharging " } ,
{ 0xB4432BC8 , & WrapI_V < scePowerGetBatteryChargingStatus > , " scePowerGetBatteryChargingStatus " } ,
{ 0xD3075926 , & WrapI_V < scePowerIsLowBattery > , " scePowerIsLowBattery " } ,
{ 0x78A1A796 , 0 , " scePowerIsSuspendRequired " } ,
{ 0x94F5A53F , 0 , " scePowerGetBatteryRemainCapacity " } ,
{ 0xFD18A0FF , 0 , " scePowerGetBatteryFullCapacity " } ,
{ 0x2085D15D , & WrapI_V < scePowerGetBatteryLifePercent > , " scePowerGetBatteryLifePercent " } ,
2013-01-11 00:15:16 -08:00
{ 0x8EFB3FA2 , & WrapI_V < scePowerGetBatteryLifeTime > , " scePowerGetBatteryLifeTime " } ,
2013-06-23 16:52:41 +09:00
{ 0x28E12023 , & WrapI_V < scePowerGetBatteryTemp > , " scePowerGetBatteryTemp " } ,
2012-11-11 21:32:44 +00:00
{ 0x862AE1A6 , 0 , " scePowerGetBatteryElec " } ,
{ 0x483CE86B , 0 , " scePowerGetBatteryVolt " } ,
2013-08-22 23:04:55 -07:00
{ 0xcb49f5ce , 0 , " scePowerGetBatteryChargeCycle " } ,
2012-11-11 21:32:44 +00:00
{ 0x23436A4A , 0 , " scePowerGetInnerTemp " } ,
{ 0x0CD21B1F , 0 , " scePowerSetPowerSwMode " } ,
{ 0x165CE085 , 0 , " scePowerGetPowerSwMode " } ,
{ 0xD6D016EF , 0 , " scePowerLock " } ,
{ 0xCA3D34C1 , 0 , " scePowerUnlock " } ,
{ 0xDB62C9CF , 0 , " scePowerCancelRequest " } ,
{ 0x7FA406DD , 0 , " scePowerIsRequest " } ,
{ 0x2B7C7CF4 , 0 , " scePowerRequestStandby " } ,
{ 0xAC32C9CC , 0 , " scePowerRequestSuspend " } ,
{ 0x2875994B , 0 , " scePower_2875994B " } ,
{ 0x0074EF9B , 0 , " scePowerGetResumeCount " } ,
2012-12-09 19:41:19 +07:00
{ 0xDFA8BAF8 , WrapI_I < scePowerUnregisterCallback > , " scePowerUnregisterCallback " } ,
2013-03-19 06:09:37 +08:00
{ 0xDB9D28DD , WrapI_I < scePowerUnregisterCallback > , " scePowerUnregitserCallback " } ,
2012-12-26 21:08:41 +01:00
{ 0x843FBF43 , WrapU_U < scePowerSetCpuClockFrequency > , " scePowerSetCpuClockFrequency " } ,
{ 0xB8D7B3FB , WrapU_U < scePowerSetBusClockFrequency > , " scePowerSetBusClockFrequency " } ,
2013-03-19 06:09:37 +08:00
{ 0xFEE03A2F , WrapU_V < scePowerGetCpuClockFrequency > , " scePowerGetCpuClockFrequency " } ,
{ 0x478FE6F5 , WrapU_V < scePowerGetBusClockFrequency > , " scePowerGetBusClockFrequency " } ,
2012-12-09 19:41:19 +07:00
{ 0xFDB5BFE9 , WrapU_V < scePowerGetCpuClockFrequencyInt > , " scePowerGetCpuClockFrequencyInt " } ,
{ 0xBD681969 , WrapU_V < scePowerGetBusClockFrequencyInt > , " scePowerGetBusClockFrequencyInt " } ,
2013-03-19 06:09:37 +08:00
{ 0xB1A52C83 , WrapF_V < scePowerGetCpuClockFrequencyFloat > , " scePowerGetCpuClockFrequencyFloat " } ,
{ 0x9BADB3EB , WrapF_V < scePowerGetBusClockFrequencyFloat > , " scePowerGetBusClockFrequencyFloat " } ,
2013-03-03 02:08:10 +08:00
{ 0x737486F2 , WrapU_UUU < scePowerSetClockFrequency > , " scePowerSetClockFrequency " } ,
2012-12-09 19:41:19 +07:00
{ 0x34f9c463 , WrapU_V < scePowerGetPllClockFrequencyInt > , " scePowerGetPllClockFrequencyInt " } ,
2013-03-04 23:39:59 +01:00
{ 0xea382a27 , WrapF_V < scePowerGetPllClockFrequencyFloat > , " scePowerGetPllClockFrequencyFloat " } ,
2013-05-19 19:21:59 -07:00
{ 0xebd177d6 , WrapU_UUU < scePowerSetClockFrequency > , " scePower_EBD177D6 " } , // This is also the same as SetClockFrequency
2013-08-22 23:04:55 -07:00
{ 0x469989ad , WrapU_UUU < scePowerSetClockFrequency > , " scePower_469989ad " } , // This is also the same as SetClockFrequency
{ 0x545a7f3c , 0 , " scePower_545A7F3C " } , // TODO: Supposedly the same as SetClockFrequency also?
{ 0xa4e93389 , 0 , " scePower_A4E93389 " } , // TODO: Supposedly the same as SetClockFrequency also?
2013-02-02 00:22:01 +01:00
{ 0xa85880d0 , WrapU_V < IsPSPNonFat > , " scePower_a85880d0_IsPSPNonFat " } ,
2013-07-31 00:01:21 -07:00
{ 0x3951af53 , 0 , " scePowerWaitRequestCompletion " } ,
2013-08-22 23:04:55 -07:00
{ 0x0442d852 , 0 , " scePowerRequestColdReset " } ,
{ 0xbafa3df0 , 0 , " scePowerGetCallbackMode " } ,
{ 0xa9d22232 , 0 , " scePowerSetCallbackMode " } ,
{ 0x23c31ffe , 0 , " scePowerVolatileMemLock " } ,
{ 0xfa97a599 , 0 , " scePowerVolatileMemTryLock " } ,
{ 0xb3edd801 , 0 , " scePowerVolatileMemUnlock " } ,
2012-11-01 16:19:01 +01:00
} ;
//890129c in tyshooter looks bogus
2012-12-09 19:41:19 +07:00
const HLEFunction sceSuspendForUser [ ] = {
2012-11-11 21:32:44 +00:00
{ 0xEADB1BD7 , & WrapI_I < sceKernelPowerLock > , " sceKernelPowerLock " } , //(int param) set param to 0
{ 0x3AEE7261 , & WrapI_I < sceKernelPowerUnlock > , " sceKernelPowerUnlock " } , //(int param) set param to 0
{ 0x090ccb3f , & WrapI_I < sceKernelPowerTick > , " sceKernelPowerTick " } ,
// There's an extra 4MB that can be allocated, which seems to be "volatile". These functions
// let you grab it.
{ 0xa14f40b2 , & WrapI_III < sceKernelVolatileMemTryLock > , " sceKernelVolatileMemTryLock " } ,
{ 0xa569e425 , & WrapI_I < sceKernelVolatileMemUnlock > , " sceKernelVolatileMemUnlock " } ,
{ 0x3e0271d3 , & WrapI_III < sceKernelVolatileMemLock > , " sceKernelVolatileMemLock " } , //when "acquiring mem pool" (fired up)
2012-11-01 16:19:01 +01:00
} ;
void Register_scePower ( ) {
2012-11-11 21:32:44 +00:00
RegisterModule ( " scePower " , ARRAY_SIZE ( scePower ) , scePower ) ;
2012-11-01 16:19:01 +01:00
}
void Register_sceSuspendForUser ( ) {
2012-11-11 21:32:44 +00:00
RegisterModule ( " sceSuspendForUser " , ARRAY_SIZE ( sceSuspendForUser ) , sceSuspendForUser ) ;
2012-11-01 16:19:01 +01:00
}