diff --git a/PSVshellPlus_Kernel/PSVshellPlus_Kernel.vcxproj b/PSVshellPlus_Kernel/PSVshellPlus_Kernel.vcxproj index 8d07948..28d496f 100644 --- a/PSVshellPlus_Kernel/PSVshellPlus_Kernel.vcxproj +++ b/PSVshellPlus_Kernel/PSVshellPlus_Kernel.vcxproj @@ -106,7 +106,7 @@ ;-lSceProcessmgrForDriver_stub;-lSceSysrootForKernel_stub;-ltaihenForKernel_stub;-ltaihenModuleUtils_stub;%(AdditionalDependencies) - "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(OutDir)_$(TargetName).skprx" + "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(OutDir)$(TargetName).skprx" "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump lib.emd --stub-archive diff --git a/PSVshellPlus_Kernel/common.h b/PSVshellPlus_Kernel/common.h index 98f4442..775208c 100644 --- a/PSVshellPlus_Kernel/common.h +++ b/PSVshellPlus_Kernel/common.h @@ -103,6 +103,10 @@ typedef struct PSVSVenezia { SceInt32 peak; } PSVSVenezia; +typedef struct PSVSBattery { + SceInt32 current; +} PSVSBattery; + typedef struct PSVSKPLS { SceUInt32 lock; } PSVSKPLS; diff --git a/PSVshellPlus_Kernel/info.c b/PSVshellPlus_Kernel/info.c index dc1c914..909df02 100644 --- a/PSVshellPlus_Kernel/info.c +++ b/PSVshellPlus_Kernel/info.c @@ -183,5 +183,18 @@ SceInt32 psvsGetVeneziaInfo(PSVSVenezia *data) sceKernelCopyToUser(data, &kdata, sizeof(PSVSVenezia)); + return ret; +} + +SceInt32 psvsGetBatteryInfo(PSVSBattery *data) +{ + PSVSBattery kdata; + SceInt32 ret = SCE_KERNEL_ERROR_UNSUP; + + kdata.current = 0; + ret = sceSysconGetBatteryCurrent(&kdata.current); + kdata.current = -kdata.current; + + sceKernelCopyToUser(data, &kdata, sizeof(PSVSBattery)); return ret; } \ No newline at end of file diff --git a/PSVshellPlus_Kernel/info.h b/PSVshellPlus_Kernel/info.h index 3511be8..f6471eb 100644 --- a/PSVshellPlus_Kernel/info.h +++ b/PSVshellPlus_Kernel/info.h @@ -7,4 +7,6 @@ int(*sceKernelGetPhyMemPartInfoCore)(SceKernelPhyMemPart *pPhyMemPart, ScePhyMemPartInfoCore *pInfo); +int(*sceSysconGetBatteryCurrent)(SceInt32 *res); + SceVoid psvsCalcFps(); \ No newline at end of file diff --git a/PSVshellPlus_Kernel/lib.emd b/PSVshellPlus_Kernel/lib.emd index 2ff5cc8..56e29b0 100644 --- a/PSVshellPlus_Kernel/lib.emd +++ b/PSVshellPlus_Kernel/lib.emd @@ -15,6 +15,7 @@ Library: PSVshellPlus_KernelForUser function: psvsSetGpuXbarClockFrequency Library: PSVshellPlus_KernelForUser function: psvsSetBusClockFrequency Library: PSVshellPlus_KernelForUser function: psvsGetClockFrequency Library: PSVshellPlus_KernelForUser function: psvsGetVeneziaInfo +Library: PSVshellPlus_KernelForUser function: psvsGetBatteryInfo Library: PSVshellPlus_KernelForUser function: psvsClockFrequencyLockProc Library: PSVshellPlus_KernelForUser function: psvsClockFrequencyUnlockProc Library: PSVshellPlus_KernelForUser function: psvsClockFrequencyIsLockedProc diff --git a/PSVshellPlus_Kernel/libPSVshellPlus_KernelForUser_stub.a b/PSVshellPlus_Kernel/libPSVshellPlus_KernelForUser_stub.a index e49d5bd..56262d9 100644 Binary files a/PSVshellPlus_Kernel/libPSVshellPlus_KernelForUser_stub.a and b/PSVshellPlus_Kernel/libPSVshellPlus_KernelForUser_stub.a differ diff --git a/PSVshellPlus_Kernel/main.c b/PSVshellPlus_Kernel/main.c index 3079fcd..2ae99a3 100644 --- a/PSVshellPlus_Kernel/main.c +++ b/PSVshellPlus_Kernel/main.c @@ -19,7 +19,9 @@ static SceUID s_reqPid = -1; static SceUInt32 *scePowerKPLSKey = NULL; -int(*scePervasiveArmSetClock)(int mul, int ndiv); +static SceUInt32 **ScePervasiveBaseClk = NULL; + +int(*scePervasiveArmClockSelect)(int mul, int ndiv); SceVoid psvsSetFpsCounterTarget(SceInt32 target) { @@ -67,7 +69,7 @@ int scePowerSetArmClockFrequency_patched(int clock) ret = psvsClockFrequencyLockProc(pid, PSVS_500_MHZ_KEY); if (ret == SCE_OK) { // Apply mul:div (15:0) - ret = scePervasiveArmSetClock(15, 16 - 0); + ret = scePervasiveArmClockSelect(15, 16 - 0); } return ret; @@ -143,6 +145,11 @@ int __module_start(SceSize args, const void * argp) module_get_offset(KERNEL_PID, tai_info.modid, 1, 0, (uintptr_t *)&scePowerKPLSKey); + tai_info.size = sizeof(tai_module_info_t); + taiGetModuleInfoForKernel(KERNEL_PID, "SceLowio", &tai_info); + + module_get_offset(KERNEL_PID, tai_info.modid, 1, 0xa0, (uintptr_t *)&ScePervasiveBaseClk); + s_hookId[0] = taiHookFunctionExportForKernel(KERNEL_PID, &s_hookRef[0], "SceDisplay", 0x9FED47AC, 0x16466675, sceDisplaySetFrameBufInternal_patched); @@ -164,7 +171,10 @@ int __module_start(SceSize args, const void * argp) } module_get_export_func(KERNEL_PID, - "SceLowio", 0xE692C727, 0xE9D95643, (uintptr_t *)&scePervasiveArmSetClock); + "SceLowio", 0xE692C727, 0xE9D95643, (uintptr_t *)&scePervasiveArmClockSelect); + + module_get_export_func(KERNEL_PID, + "SceSyscon", 0x60A35F64, 0x0826BA07, (uintptr_t *)&sceSysconGetBatteryCurrent); /* ret = module_get_export_func(KERNEL_PID, @@ -227,7 +237,7 @@ int __module_start(SceSize args, const void * argp) const SceUInt8 nop[] = { 0x00, 0xBF }; s_injectId[0] = taiInjectAbsForKernel(KERNEL_PID, - (void *)((uintptr_t)scePervasiveArmSetClock + 0x1D), &nop, 2); + (void *)((uintptr_t)scePervasiveArmClockSelect + 0x1D), &nop, 2); return SCE_KERNEL_START_SUCCESS; } diff --git a/PSVshellPlus_Shell/PSVshellPlus_Shell.vcxproj b/PSVshellPlus_Shell/PSVshellPlus_Shell.vcxproj index b0a5a96..e1864c6 100644 --- a/PSVshellPlus_Shell/PSVshellPlus_Shell.vcxproj +++ b/PSVshellPlus_Shell/PSVshellPlus_Shell.vcxproj @@ -76,7 +76,7 @@ true - "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(OutDir)_$(TargetName).suprx" + "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(LocalDebuggerCommand)" @@ -86,6 +86,7 @@ NotUsing $(SCE_PSP2_SDK_DIR)\target\include\vdsuite\user;$(SCE_PSP2_SDK_DIR)\target\include\vdsuite\common;%(AdditionalIncludeDirectories) Cpp11 + true --no-standard-libraries --no-required-files @@ -96,7 +97,7 @@ true - "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(OutDir)_$(TargetName).suprx" + "$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --compress "$(LocalDebuggerCommand)" "$(LocalDebuggerCommand)" diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_en.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_en.xml index 9a2edbd..fcf375b 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_en.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_en.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_fr.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_fr.xml index 087b9db..4de8973 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_fr.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_fr.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ja.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ja.xml index 449a3fe..34f6a16 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ja.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ja.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ru.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ru.xml index e0fe69b..f7827fa 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ru.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_ru.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-s.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-s.xml index 0c3fea1..38593cf 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-s.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-s.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-t.xml b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-t.xml index 47b6f61..fe6e9ec 100644 --- a/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-t.xml +++ b/PSVshellPlus_Shell/RES_RCO/locale/psvshell_locale_zh-t.xml @@ -2,6 +2,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/PSVshellPlus_Shell/RES_RCO/psvshell_plugin.xml b/PSVshellPlus_Shell/RES_RCO/psvshell_plugin.xml index 5f1ec33..34dc74f 100644 --- a/PSVshellPlus_Shell/RES_RCO/psvshell_plugin.xml +++ b/PSVshellPlus_Shell/RES_RCO/psvshell_plugin.xml @@ -35,7 +35,18 @@ + -