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 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -72,80 +83,87 @@
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
-
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -291,26 +309,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PSVshellPlus_Shell/gen_rco.bat b/PSVshellPlus_Shell/gen_rco.bat
index 6f8f5c0..0118b70 100644
--- a/PSVshellPlus_Shell/gen_rco.bat
+++ b/PSVshellPlus_Shell/gen_rco.bat
@@ -1,27 +1,15 @@
@echo off
-SET PYTHON=%SCE_PSP2_SDK_DIR%/host_tools/build/rco/Python27/python.exe
-SET Z=%SCE_PSP2_SDK_DIR%/host_tools/build/rco/bin\zdrop.exe
-SET RCS=%SCE_PSP2_SDK_DIR%/host_tools/build/rco/cxml/appinfo/rcs_compiler.py
-SET RCO=%SCE_PSP2_SDK_DIR%/host_tools/build/rco/cxml/appinfo/appinfo_compiler.py
+SET PLUGIN=psvshell
+SET COMPILER=%SCE_PSP2_SDK_DIR%/host_tools/build/rco/bin/acdc.exe
SET TMP=RES_RCO/RES_RCO_TMP
@RD /S /Q "%TMP%"
mkdir "%TMP%"
-copy /b "%Z%" "%TMP%"
for %%f in (RES_RCO/locale/*.xml) do (
-"%PYTHON%" "%RCS%" -o "%TMP%/%%f.rcs" RES_RCO/locale/%%f
-"%TMP%/zdrop.exe" "%TMP%/%%f.rcs"
+"%COMPILER%" -c -i "RES_RCO/locale/%%f" -s "%SCE_PSP2_SDK_DIR%/host_tools/build/rco/def/rcs.cxmldef" -o "%TMP%/%%f.rcs"
)
-
-for %%f in (RES_RCO/file/*) do (
-
-copy /b "RES_RCO/file\%%f" "%TMP%"
-"%TMP%/zdrop.exe" "%TMP%/%%f"
-
-)
-
-"%PYTHON%" "%RCO%" -o psvshell_plugin.rco RES_RCO/psvshell_plugin.xml
+"%COMPILER%" -c -i "RES_RCO/%PLUGIN%_plugin.xml" -s "%SCE_PSP2_SDK_DIR%/host_tools/build/rco/def/rco.cxmldef" -o "%PLUGIN%_plugin.rco"
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/global.h b/PSVshellPlus_Shell/global.h
index 02d1724..ad5a329 100644
--- a/PSVshellPlus_Shell/global.h
+++ b/PSVshellPlus_Shell/global.h
@@ -2,8 +2,6 @@
#include
#include
-#include
extern paf::Plugin *g_corePlugin;
-extern paf::ui::ScrollView *g_imposeRoot;
-extern paf::ui::Scene *g_coreRoot;
\ No newline at end of file
+extern paf::ui::ScrollView *g_imposeRoot;
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/hud.cpp b/PSVshellPlus_Shell/hud.cpp
index 782afe2..08a06ad 100644
--- a/PSVshellPlus_Shell/hud.cpp
+++ b/PSVshellPlus_Shell/hud.cpp
@@ -13,35 +13,41 @@ using namespace paf;
namespace psvs
{
static psvs::Hud *s_currentHud = NULL;
- static SceInt32 s_casShift = -1;
+ static int32_t s_casShift = -1;
Hud *Hud::GetCurrentHud()
{
return s_currentHud;
}
- SceVoid Hud::SetCasShift(SceInt32 shift)
+ void Hud::SetCasShift(int32_t shift)
{
s_casShift = shift;
}
Hud::Hud(BaseType type)
{
- rco::Element element;
- Plugin::TemplateInitParam tmpParam;
+ Plugin::TemplateOpenParam tmpParam;
+ Plugin::PageOpenParam pgiParam;
+
+ pgiParam.overwrite_draw_priority = 6;
+ coreRoot = g_corePlugin->PageOpen("psvs_page_hud", pgiParam);
switch (type) {
case BaseType_Mini:
- element.hash = psvs_template_hud_bg_mini;
- g_corePlugin->TemplateOpen(g_coreRoot, &element, &tmpParam);
- this->root = g_coreRoot->GetChild(g_coreRoot->childNum - 1);
- this->root->PlayEffect(0.0f, effect::EffectType_Fadein1);
+ g_corePlugin->TemplateOpen(coreRoot, psvs_template_hud_bg_mini, tmpParam);
+ this->root = coreRoot->GetChild(coreRoot->GetChildrenNum() - 1);
+ this->root->Show(common::transition::Type_Fadein1);
break;
case BaseType_Full:
- element.hash = psvs_template_hud_bg_full;
- g_corePlugin->TemplateOpen(g_coreRoot, &element, &tmpParam);
- this->root = g_coreRoot->GetChild(g_coreRoot->childNum - 1);
- this->root->PlayEffect(0.0f, effect::EffectType_Fadein1);
+ g_corePlugin->TemplateOpen(coreRoot, psvs_template_hud_bg_full, tmpParam);
+ this->root = coreRoot->GetChild(coreRoot->GetChildrenNum() - 1);
+ this->root->Show(common::transition::Type_Fadein1);
+ break;
+ case BaseType_Dev:
+ g_corePlugin->TemplateOpen(coreRoot, psvs_template_hud_bg_dev, tmpParam);
+ this->root = coreRoot->GetChild(coreRoot->GetChildrenNum() - 1);
+ this->root->Show(common::transition::Type_Fadein1);
break;
default:
break;
@@ -52,61 +58,61 @@ namespace psvs
Hud::~Hud()
{
+ Plugin::PageCloseParam pgcParam;
+
psvsSetFpsCounterTarget(PSVS_FPS_COUNTER_TARGET_NONE);
- effect::Play(0.0f, this->root, effect::EffectType_Fadein1, true, false);
+
+ pgcParam.fade = true;
+ g_corePlugin->PageClose("psvs_page_hud", pgcParam);
+
s_currentHud = NULL;
}
HudMicro::HudMicro() : Hud::Hud(Hud::BaseType_None)
{
- rco::Element element;
- Plugin::TemplateInitParam tmpParam;
+ Plugin::TemplateOpenParam tmpParam;
this->oldFps = 0;
- element.hash = psvs_template_hud_micro;
- g_corePlugin->TemplateOpen(g_coreRoot, &element, &tmpParam);
- element.hash = psvs_text_fps_micro;
- this->fps = (ui::Text *)g_coreRoot->GetChild(&element, 0);
+ g_corePlugin->TemplateOpen(coreRoot, psvs_template_hud_micro, tmpParam);
+ this->fps = (ui::Text *)coreRoot->FindChild(psvs_text_fps_micro);
this->root = this->fps;
- task::Register(Update, this);
+ common::MainThreadCallList::Register(Update, this);
s_currentHud = this;
}
HudMicro::~HudMicro()
{
- task::Unregister(Update, this);
+ common::MainThreadCallList::Unregister(Update, this);
}
- SceVoid HudMicro::SetPosition(Position pos)
+ void HudMicro::SetPosition(Position pos)
{
- Vector4 vec;
- vec.z = 0.0f;
- vec.w = 0.0f;
+ math::v4 vec(0.0f);
switch (pos) {
case Position_UpLeft:
- vec.x = -920.0f;
- vec.y = -10.0f;
+ vec.set_x(-920.0f);
+ vec.set_y(-10.0f);
break;
case Position_UpRight:
- vec.x = -16.0f;
- vec.y = -10.0f;
+ vec.set_x(-16.0f);
+ vec.set_y(-10.0f);
break;
case Position_DownLeft:
- vec.x = -920.0f;
- vec.y = -520.0f;
+ vec.set_x(-920.0f);
+ vec.set_y(-520.0f);
break;
case Position_DownRight:
- vec.x = -16.0f;
- vec.y = -520.0f;
+ vec.set_x(-16.0f);
+ vec.set_y(-520.0f);
break;
}
- this->root->SetPosition(&vec);
+ this->root->SetPos(vec);
}
- SceVoid HudMicro::Update(ScePVoid arg)
+ void HudMicro::Update(void *arg)
{
wstring wtext;
wchar_t wbuf[6];
@@ -114,12 +120,12 @@ namespace psvs
//Update FPS
psvsSetFpsCounterTarget(tracker::GetFpsCounterTarget());
- SceInt32 fps = psvsGetFps();
+ int32_t fps = psvsGetFps();
if (fps != obj->oldFps) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L"%d", fps);
+ sce_paf_swprintf(wbuf, 6, L"%d", fps);
wtext = wbuf;
- obj->fps->SetLabel(&wtext);
+ obj->fps->SetString(wtext);
}
obj->oldFps = fps;
@@ -127,71 +133,56 @@ namespace psvs
HudMini::HudMini(Hud::BaseType type) : Hud::Hud(type)
{
- rco::Element element;
- Plugin::TemplateInitParam tmpParam;
+ Plugin::TemplateOpenParam tmpParam;
this->oldFps = 0;
- element.hash = psvs_template_hud_mini;
- g_corePlugin->TemplateOpen(this->root, &element, &tmpParam);
-
- element.hash = psvs_text_cpu_0;
- this->cpuAvg[0] = (ui::Text *)this->root->GetChild(&element, 0);
+ g_corePlugin->TemplateOpen(this->root, psvs_template_hud_mini, tmpParam);
- element.hash = psvs_text_cpu_1;
- this->cpuAvg[1] = (ui::Text *)this->root->GetChild(&element, 0);
+ this->cpuAvg[0] = (ui::Text *)this->root->FindChild(psvs_text_cpu_0);
+ this->cpuAvg[1] = (ui::Text *)this->root->FindChild(psvs_text_cpu_1);
+ this->cpuAvg[2] = (ui::Text *)this->root->FindChild(psvs_text_cpu_2);
+ this->cpuAvg[3] = (ui::Text *)this->root->FindChild(psvs_text_cpu_3);
+ this->cpuPeak = (ui::Text *)this->root->FindChild(psvs_text_cpu_peak);
+ this->fps = (ui::Text *)this->root->FindChild(psvs_text_fps);
- element.hash = psvs_text_cpu_2;
- this->cpuAvg[2] = (ui::Text *)this->root->GetChild(&element, 0);
-
- element.hash = psvs_text_cpu_3;
- this->cpuAvg[3] = (ui::Text *)this->root->GetChild(&element, 0);
-
- element.hash = psvs_text_cpu_peak;
- this->cpuPeak = (ui::Text *)this->root->GetChild(&element, 0);
-
- element.hash = psvs_text_fps;
- this->fps = (ui::Text *)this->root->GetChild(&element, 0);
-
- task::Register(Update, this);
+ common::MainThreadCallList::Register(Update, this);
s_currentHud = this;
}
HudMini::~HudMini()
{
- task::Unregister(Update, this);
+ common::MainThreadCallList::Unregister(Update, this);
}
- SceVoid HudMini::SetPosition(Position pos)
+ void HudMini::SetPosition(Position pos)
{
- Vector4 vec;
- vec.z = 0.0f;
- vec.w = 0.0f;
+ math::v4 vec(0.0f);
switch (pos) {
case Position_UpLeft:
- vec.x = 10.0f;
- vec.y = -10.0f;
+ vec.set_x(10.0f);
+ vec.set_y(-10.0f);
break;
case Position_UpRight:
- vec.x = 600.0f;
- vec.y = -10.0f;
+ vec.set_x(600.0f);
+ vec.set_y(-10.0f);
break;
case Position_DownLeft:
- vec.x = 10.0f;
- vec.y = -470.0f;
+ vec.set_x(10.0f);
+ vec.set_y(-470.0f);
break;
case Position_DownRight:
- vec.x = 600.0f;
- vec.y = -470.0f;
+ vec.set_x(600.0f);
+ vec.set_y(-470.0f);
break;
}
- this->root->SetPosition(&vec);
+ this->root->SetPos(vec);
}
- SceVoid HudMini::Update(ScePVoid arg)
+ void HudMini::Update(void *arg)
{
wstring wtext;
wchar_t wbuf[16];
@@ -200,12 +191,12 @@ namespace psvs
//Update FPS
psvsSetFpsCounterTarget(tracker::GetFpsCounterTarget());
- SceInt32 fps = psvsGetFps();
+ int32_t fps = psvsGetFps();
if (fps != obj->oldFps) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d FPS", fps);
+ sce_paf_swprintf(wbuf, 16, L" %d FPS", fps);
wtext = wbuf;
- obj->fps->SetLabel(&wtext);
+ obj->fps->SetString(wtext);
//obj->fps->SetColor(ui::Text::ColorType_Text, 1, 2, &ScaleColor(30 - fps, 0, 30));
}
@@ -215,206 +206,294 @@ namespace psvs
psvsGetCpu(&cpu);
for (int i = 0; i < SCE_KERNEL_MAX_CPU; i++) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", cpu.avg[i]);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", cpu.avg[i]);
wtext = wbuf;
- obj->cpuAvg[i]->SetLabel(&wtext);
+ obj->cpuAvg[i]->SetString(wtext);
//obj->cpuAvg[i]->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(cpu.avg[i]), &ScaleColor(cpu.avg[i], 0, 100));
}
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", cpu.peak);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", cpu.peak);
wtext = wbuf;
- obj->cpuPeak->SetLabel(&wtext);
+ obj->cpuPeak->SetString(wtext);
//obj->cpuPeak->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(cpu.peak), &ScaleColor(cpu.peak, 0, 100));
}
HudFull::HudFull() : HudMini::HudMini(Hud::BaseType_Full)
{
- rco::Element element;
- Plugin::TemplateInitParam tmpParam;
+ Plugin::TemplateOpenParam tmpParam;
this->oldMem.mainTotal = __INT_MAX__;
this->oldMem.cdramTotal = __INT_MAX__;
this->oldMem.phycontTotal = __INT_MAX__;
this->oldMem.cdialogTotal = __INT_MAX__;
- this->oldVnz.core0 = __INT_MAX__;
- this->oldVnz.core1 = __INT_MAX__;
- this->oldVnz.core2 = __INT_MAX__;
- this->oldVnz.core3 = __INT_MAX__;
- this->oldVnz.core4 = __INT_MAX__;
- this->oldVnz.core5 = __INT_MAX__;
- this->oldVnz.core6 = __INT_MAX__;
- this->oldVnz.core7 = __INT_MAX__;
- this->oldVnz.average = __INT_MAX__;
- this->oldVnz.peak = __INT_MAX__;
this->memTick = 0;
- element.hash = psvs_template_hud_vnz;
- g_corePlugin->TemplateOpen(this->root, &element, &tmpParam);
+ g_corePlugin->TemplateOpen(this->root, psvs_template_hud_full, tmpParam);
- element.hash = psvs_text_vnz_0;
- this->vnz[0] = (ui::Text *)this->root->GetChild(&element, 0);
+ this->ramUsed = (ui::Text *)this->root->FindChild(psvs_text_ram_used);
+ this->cdramUsed = (ui::Text *)this->root->FindChild(psvs_text_cdram_used);
+ this->phyUsed = (ui::Text *)this->root->FindChild(psvs_text_phy_used);
+ this->cdlgUsed = (ui::Text *)this->root->FindChild(psvs_text_cdlg_used);
+ this->ramTotal = (ui::Text *)this->root->FindChild(psvs_text_ram_total);
+ this->cdramTotal = (ui::Text *)this->root->FindChild(psvs_text_cdram_total);
+ this->phyTotal = (ui::Text *)this->root->FindChild(psvs_text_phy_total);
+ this->cdlgTotal = (ui::Text *)this->root->FindChild(psvs_text_cdlg_total);
+ this->app = (ui::Text *)this->root->FindChild(psvs_text_app);
- element.hash = psvs_text_vnz_1;
- this->vnz[1] = (ui::Text *)this->root->GetChild(&element, 0);
+ common::MainThreadCallList::Register(Update, this);
- element.hash = psvs_text_vnz_2;
- this->vnz[2] = (ui::Text *)this->root->GetChild(&element, 0);
+ s_currentHud = this;
+ }
- element.hash = psvs_text_vnz_3;
- this->vnz[3] = (ui::Text *)this->root->GetChild(&element, 0);
+ HudFull::~HudFull()
+ {
+ common::MainThreadCallList::Unregister(Update, this);
+ }
- element.hash = psvs_text_vnz_4;
- this->vnz[4] = (ui::Text *)this->root->GetChild(&element, 0);
+ void HudFull::SetPosition(Position pos)
+ {
+ math::v4 vec(0.0f);
- element.hash = psvs_text_vnz_5;
- this->vnz[5] = (ui::Text *)this->root->GetChild(&element, 0);
+ switch (pos) {
+ case Position_UpLeft:
+ vec.set_x(10.0f);
+ vec.set_y(-10.0f);
+ break;
+ case Position_UpRight:
+ vec.set_x(600.0f);
+ vec.set_y(-10.0f);
+ break;
+ case Position_DownLeft:
+ vec.set_x(10.0f);
+ vec.set_y(-334.0f);
+ break;
+ case Position_DownRight:
+ vec.set_x(600.0f);
+ vec.set_y(-334.0f);
+ break;
+ }
- element.hash = psvs_text_vnz_6;
- this->vnz[6] = (ui::Text *)this->root->GetChild(&element, 0);
+ this->root->SetPos(vec);
+ }
- element.hash = psvs_text_vnz_7;
- this->vnz[7] = (ui::Text *)this->root->GetChild(&element, 0);
+ void HudFull::Update(void *arg)
+ {
+ wstring wtext;
+ PSVSMem mem;
+ uint32_t tickNow = sceKernelGetProcessTimeLow();
+ HudFull *obj = (HudFull *)arg;
- element.hash = psvs_text_vnz_peak;
- this->vnzPeak = (ui::Text *)this->root->GetChild(&element, 0);
+ if (tickNow - obj->memTick > PSVS_FULL_UPDATE_WINDOW_USEC) {
+ //Update memory
+ psvsGetMem(s_casShift, &mem);
- element.hash = psvs_template_hud_full;
- g_corePlugin->TemplateOpen(this->root, &element, &tmpParam);
+ if (obj->oldMem.mainTotal != mem.mainTotal || obj->oldMem.mainFree != mem.mainFree)
+ SetMemLabel(mem.mainTotal - mem.mainFree, mem.mainTotal, obj->ramUsed, obj->ramTotal);
+ if (obj->oldMem.cdramTotal != mem.cdramTotal || obj->oldMem.cdramFree != mem.cdramFree)
+ SetMemLabel(mem.cdramTotal - mem.cdramFree, mem.cdramTotal, obj->cdramUsed, obj->cdramTotal);
+ if (obj->oldMem.phycontTotal != mem.phycontTotal || obj->oldMem.phycontFree != mem.phycontFree)
+ SetMemLabel(mem.phycontTotal - mem.phycontFree, mem.phycontTotal, obj->phyUsed, obj->phyTotal);
+ if (obj->oldMem.cdialogTotal != mem.cdialogTotal || obj->oldMem.cdialogFree != mem.cdialogFree)
+ SetMemLabel(mem.cdialogTotal - mem.cdialogFree, mem.cdialogTotal, obj->cdlgUsed, obj->cdlgTotal);
- element.hash = psvs_text_ram_used;
- this->ramUsed = (ui::Text *)this->root->GetChild(&element, 0);
+ //Update fg app
+ obj->app->SetString(*tracker::GetCurrentAppName());
- element.hash = psvs_text_cdram_used;
- this->cdramUsed = (ui::Text *)this->root->GetChild(&element, 0);
+ obj->memTick = tickNow;
+ obj->oldMem = mem;
+ }
+ }
- element.hash = psvs_text_phy_used;
- this->phyUsed = (ui::Text *)this->root->GetChild(&element, 0);
+ void HudFull::SetMemLabel(uint32_t used, uint32_t total, paf::ui::Text *usedText, paf::ui::Text *totalText)
+ {
+ wstring wtext;
+ wchar_t wbuf[32];
+ math::v4 green(0.0f, 1.0f, 0.0f, 1.0f);
- element.hash = psvs_text_cdlg_used;
- this->cdlgUsed = (ui::Text *)this->root->GetChild(&element, 0);
+ int32_t usedValue = ValueFromSize(used);
+ int32_t totalValue = ValueFromSize(total);
- element.hash = psvs_text_ram_total;
- this->ramTotal = (ui::Text *)this->root->GetChild(&element, 0);
+ sce_paf_swprintf(wbuf, 32, L" %d %ls /", usedValue, UnitsFromSize(used));
+ wtext = wbuf;
+ usedText->SetString(wtext);
+ //usedText->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(usedValue), &ScaleColor(used, total - (total / 10), total + (total / 10)));
- element.hash = psvs_text_cdram_total;
- this->cdramTotal = (ui::Text *)this->root->GetChild(&element, 0);
+ sce_paf_swprintf(wbuf, 32, L" %d %ls", totalValue, UnitsFromSize(total));
+ wtext = wbuf;
+ totalText->SetString(wtext);
+ //totalText->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(totalValue), &green);
+ }
- element.hash = psvs_text_phy_total;
- this->phyTotal = (ui::Text *)this->root->GetChild(&element, 0);
+ HudDev::HudDev() : HudMini::HudMini(Hud::BaseType_Dev)
+ {
+ Plugin::TemplateOpenParam tmpParam;
- element.hash = psvs_text_cdlg_total;
- this->cdlgTotal = (ui::Text *)this->root->GetChild(&element, 0);
+ this->oldMem.mainTotal = __INT_MAX__;
+ this->oldMem.cdramTotal = __INT_MAX__;
+ this->oldMem.phycontTotal = __INT_MAX__;
+ this->oldMem.cdialogTotal = __INT_MAX__;
+ this->oldVnz.core0 = __INT_MAX__;
+ this->oldVnz.core1 = __INT_MAX__;
+ this->oldVnz.core2 = __INT_MAX__;
+ this->oldVnz.core3 = __INT_MAX__;
+ this->oldVnz.core4 = __INT_MAX__;
+ this->oldVnz.core5 = __INT_MAX__;
+ this->oldVnz.core6 = __INT_MAX__;
+ this->oldVnz.core7 = __INT_MAX__;
+ this->oldVnz.average = __INT_MAX__;
+ this->oldVnz.peak = __INT_MAX__;
+ this->vnzNeedUpdate = false;
+ this->memTickCommon = 0;
+ this->memTickVnzUpd = 0;
+ this->memTickBat = 0;
+
+ g_corePlugin->TemplateOpen(this->root, psvs_template_hud_dev, tmpParam);
+
+ this->vnz[0] = (ui::Text *)this->root->FindChild(psvs_text_vnz_0);
+ this->vnz[1] = (ui::Text *)this->root->FindChild(psvs_text_vnz_1);
+ this->vnz[2] = (ui::Text *)this->root->FindChild(psvs_text_vnz_2);
+ this->vnz[3] = (ui::Text *)this->root->FindChild(psvs_text_vnz_3);
+ this->vnz[4] = (ui::Text *)this->root->FindChild(psvs_text_vnz_4);
+ this->vnz[5] = (ui::Text *)this->root->FindChild(psvs_text_vnz_5);
+ this->vnz[6] = (ui::Text *)this->root->FindChild(psvs_text_vnz_6);
+ this->vnz[7] = (ui::Text *)this->root->FindChild(psvs_text_vnz_7);
+ this->vnzPeak = (ui::Text *)this->root->FindChild(psvs_text_vnz_peak);
+ this->batCur = (ui::Text *)this->root->FindChild(psvs_text_bat_cur);
+
+ if (SCE_PAF_IS_DOLCE) {
+ wstring wtext = L"DOLCE";
+ this->batCur->SetString(wtext);
+ }
- element.hash = psvs_text_app;
- this->app = (ui::Text *)this->root->GetChild(&element, 0);
+ this->ramUsed = (ui::Text *)this->root->FindChild(HudFull::psvs_text_ram_used);
+ this->cdramUsed = (ui::Text *)this->root->FindChild(HudFull::psvs_text_cdram_used);
+ this->phyUsed = (ui::Text *)this->root->FindChild(HudFull::psvs_text_phy_used);
+ this->cdlgUsed = (ui::Text *)this->root->FindChild(HudFull::psvs_text_cdlg_used);
+ this->ramTotal = (ui::Text *)this->root->FindChild(HudFull::psvs_text_ram_total);
+ this->cdramTotal = (ui::Text *)this->root->FindChild(HudFull::psvs_text_cdram_total);
+ this->phyTotal = (ui::Text *)this->root->FindChild(HudFull::psvs_text_phy_total);
+ this->cdlgTotal = (ui::Text *)this->root->FindChild(HudFull::psvs_text_cdlg_total);
+ this->app = (ui::Text *)this->root->FindChild(HudFull::psvs_text_app);
- task::Register(Update, this);
+ common::MainThreadCallList::Register(Update, this);
s_currentHud = this;
}
- HudFull::~HudFull()
+ HudDev::~HudDev()
{
- task::Unregister(Update, this);
+ common::MainThreadCallList::Unregister(Update, this);
}
- SceVoid HudFull::SetPosition(Position pos)
+ void HudDev::SetPosition(Position pos)
{
- Vector4 vec;
- vec.z = 0.0f;
- vec.w = 0.0f;
+ math::v4 vec(0.0f);
switch (pos) {
case Position_UpLeft:
- vec.x = 10.0f;
- vec.y = -10.0f;
+ vec.set_x(10.0f);
+ vec.set_y(-10.0f);
break;
case Position_UpRight:
- vec.x = 600.0f;
- vec.y = -10.0f;
+ vec.set_x(600.0f);
+ vec.set_y(-10.0f);
break;
case Position_DownLeft:
- vec.x = 10.0f;
- vec.y = -288.0f;
+ vec.set_x(10.0f);
+ vec.set_y(-256.0f);
break;
case Position_DownRight:
- vec.x = 600.0f;
- vec.y = -288.0f;
+ vec.set_x(600.0f);
+ vec.set_y(-256.0f);
break;
}
- this->root->SetPosition(&vec);
+ this->root->SetPos(vec);
}
- SceVoid HudFull::Update(ScePVoid arg)
+ void HudDev::Update(void *arg)
{
wstring wtext;
- wchar_t wbuf[8];
+ wchar_t wbuf[16];
PSVSMem mem;
PSVSVenezia vnz;
- SceUInt32 tickNow = sceKernelGetProcessTimeLow();
- SceUInt32 used = 0;
- SceUInt32 total = 0;
- SceBool vnzUpdateFrame = SCE_FALSE;
- HudFull *obj = (HudFull *)arg;
+ PSVSBattery bat;
+ uint32_t tickNow = sceKernelGetProcessTimeLow();
+ HudDev *obj = (HudDev *)arg;
- if (tickNow - obj->memTick > PSVS_VNZ_UPDATE_WINDOW_USEC) {
+ if (tickNow - obj->memTickVnzUpd > PSVS_VNZ_UPDATE_WINDOW_USEC) {
//Update Venezia
sceCodecEnginePmonStop();
psvsGetVeneziaInfo(&vnz);
sceCodecEnginePmonReset();
sceCodecEnginePmonStart();
- vnzUpdateFrame = SCE_TRUE;
+ obj->vnzNeedUpdate = true;
+ obj->memTickVnzUpd = tickNow;
}
- if (tickNow - obj->memTick > PSVS_FULL_UPDATE_WINDOW_USEC) {
+ if (!SCE_PAF_IS_DOLCE && (tickNow - obj->memTickBat > PSVS_BAT_UPDATE_WINDOW_USEC)) {
+ //Update battery
+ psvsGetBatteryInfo(&bat);
+
+ if (obj->oldBat.current != bat.current) {
+ sce_paf_swprintf(wbuf, 16, L" %d mA", bat.current);
+ wtext = wbuf;
+ obj->batCur->SetString(wtext);
+ }
- if (vnzUpdateFrame) {
+ obj->memTickBat = tickNow;
+ obj->oldBat = bat;
+ }
+
+ if (tickNow - obj->memTickCommon > PSVS_FULL_UPDATE_WINDOW_USEC) {
+
+ if (obj->vnzNeedUpdate) {
if (obj->oldVnz.core0 != vnz.core0) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core0);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core0);
wtext = wbuf;
- obj->vnz[0]->SetLabel(&wtext);
+ obj->vnz[0]->SetString(wtext);
}
if (obj->oldVnz.core1 != vnz.core1) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core1);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core1);
wtext = wbuf;
- obj->vnz[1]->SetLabel(&wtext);
+ obj->vnz[1]->SetString(wtext);
}
if (obj->oldVnz.core2 != vnz.core2) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core2);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core2);
wtext = wbuf;
- obj->vnz[2]->SetLabel(&wtext);
+ obj->vnz[2]->SetString(wtext);
}
if (obj->oldVnz.core3 != vnz.core3) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core3);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core3);
wtext = wbuf;
- obj->vnz[3]->SetLabel(&wtext);
+ obj->vnz[3]->SetString(wtext);
}
if (obj->oldVnz.core4 != vnz.core4) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core4);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core4);
wtext = wbuf;
- obj->vnz[4]->SetLabel(&wtext);
+ obj->vnz[4]->SetString(wtext);
}
if (obj->oldVnz.core5 != vnz.core5) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core5);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core5);
wtext = wbuf;
- obj->vnz[5]->SetLabel(&wtext);
+ obj->vnz[5]->SetString(wtext);
}
if (obj->oldVnz.core6 != vnz.core6) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core6);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core6);
wtext = wbuf;
- obj->vnz[6]->SetLabel(&wtext);
+ obj->vnz[6]->SetString(wtext);
}
if (obj->oldVnz.core7 != vnz.core7) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.core7);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.core7);
wtext = wbuf;
- obj->vnz[7]->SetLabel(&wtext);
+ obj->vnz[7]->SetString(wtext);
}
if (obj->oldVnz.peak != vnz.peak) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d%%", vnz.peak);
+ sce_paf_swprintf(wbuf, 16, L" %d%%", vnz.peak);
wtext = wbuf;
- obj->vnzPeak->SetLabel(&wtext);
+ obj->vnzPeak->SetString(wtext);
}
+ obj->vnzNeedUpdate = SCE_FALSE;
}
//Update memory
@@ -430,31 +509,31 @@ namespace psvs
SetMemLabel(mem.cdialogTotal - mem.cdialogFree, mem.cdialogTotal, obj->cdlgUsed, obj->cdlgTotal);
//Update fg app
- obj->app->SetLabel(tracker::GetCurrentAppName());
+ obj->app->SetString(*tracker::GetCurrentAppName());
- obj->memTick = tickNow;
+ obj->memTickCommon = tickNow;
obj->oldMem = mem;
obj->oldVnz = vnz;
}
}
- SceVoid HudFull::SetMemLabel(SceUInt32 used, SceUInt32 total, paf::ui::Text *usedText, paf::ui::Text *totalText)
+ void HudDev::SetMemLabel(uint32_t used, uint32_t total, paf::ui::Text *usedText, paf::ui::Text *totalText)
{
wstring wtext;
- wchar_t wbuf[16];
- Rgba green(0.0f, 1.0f, 0.0f, 1.0f);
+ wchar_t wbuf[32];
+ math::v4 green(0.0f, 1.0f, 0.0f, 1.0f);
- SceInt32 usedValue = ValueFromSize(used);
- SceInt32 totalValue = ValueFromSize(total);
+ int32_t usedValue = ValueFromSize(used);
+ int32_t totalValue = ValueFromSize(total);
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d %ls /", usedValue, UnitsFromSize(used));
+ sce_paf_swprintf(wbuf, 32, L" %d %ls /", usedValue, UnitsFromSize(used));
wtext = wbuf;
- usedText->SetLabel(&wtext);
+ usedText->SetString(wtext);
//usedText->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(usedValue), &ScaleColor(used, total - (total / 10), total + (total / 10)));
- sce_paf_swprintf(wbuf, sizeof(wbuf), L" %d %ls", totalValue, UnitsFromSize(total));
+ sce_paf_swprintf(wbuf, 32, L" %d %ls", totalValue, UnitsFromSize(total));
wtext = wbuf;
- totalText->SetLabel(&wtext);
+ totalText->SetString(wtext);
//totalText->SetColor(ui::Text::ColorType_Text, 1, LengthOfValue(totalValue), &green);
}
}
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/hud.h b/PSVshellPlus_Shell/hud.h
index c390ff9..9016ef1 100644
--- a/PSVshellPlus_Shell/hud.h
+++ b/PSVshellPlus_Shell/hud.h
@@ -15,6 +15,7 @@ namespace psvs
BaseType_None,
BaseType_Mini,
BaseType_Full,
+ BaseType_Dev,
};
enum Position
@@ -30,19 +31,21 @@ namespace psvs
psvs_page_hud = 0x6c5a295a,
psvs_template_hud_bg_mini = 0x6147e689,
psvs_template_hud_bg_full = 0x34b71af6,
+ psvs_template_hud_bg_dev = 0xddc6d9a0,
};
static Hud *GetCurrentHud();
- static SceVoid SetCasShift(SceInt32 shift);
+ static void SetCasShift(int32_t shift);
Hud(BaseType type);
virtual ~Hud();
- virtual SceVoid SetPosition(Position pos) = 0;
+ virtual void SetPosition(Position pos) = 0;
protected:
paf::ui::Widget *root;
+ paf::ui::Scene *coreRoot;
};
@@ -56,18 +59,18 @@ namespace psvs
psvs_text_fps_micro = 0x8d7c94a7,
};
- static SceVoid Update(ScePVoid arg);
+ static void Update(void *arg);
HudMicro();
virtual ~HudMicro();
- virtual SceVoid SetPosition(Position pos);
+ virtual void SetPosition(Position pos);
protected:
paf::ui::Text *fps;
- SceInt32 oldFps;
+ int32_t oldFps;
};
class HudMini : public Hud
@@ -85,12 +88,12 @@ namespace psvs
psvs_text_fps = 0x7a26c57e,
};
- static SceVoid Update(ScePVoid arg);
+ static void Update(void *arg);
HudMini(Hud::BaseType type = Hud::BaseType_Mini);
virtual ~HudMini();
- virtual SceVoid SetPosition(Position pos);
+ virtual void SetPosition(Position pos);
protected:
@@ -98,7 +101,7 @@ namespace psvs
paf::ui::Text *cpuPeak;
paf::ui::Text *fps;
- SceInt32 oldFps;
+ int32_t oldFps;
};
class HudFull : public HudMini
@@ -106,20 +109,9 @@ namespace psvs
public:
#define PSVS_FULL_UPDATE_WINDOW_USEC (100000)
- #define PSVS_VNZ_UPDATE_WINDOW_USEC (1000)
enum Hash
{
- psvs_template_hud_vnz = 0x77a08140,
- psvs_text_vnz_0 = 0x7524c263,
- psvs_text_vnz_1 = 0x56c14879,
- psvs_text_vnz_2 = 0x03cd5e60,
- psvs_text_vnz_3 = 0x8c6b209e,
- psvs_text_vnz_4 = 0x98e73415,
- psvs_text_vnz_5 = 0xd8c59975,
- psvs_text_vnz_6 = 0x7cb8ea8d,
- psvs_text_vnz_7 = 0xf646c3a1,
- psvs_text_vnz_peak = 0xebc15716,
psvs_template_hud_full = 0x367de75c,
psvs_text_ram_used = 0xe161c101,
psvs_text_ram_total = 0x588ba69b,
@@ -132,19 +124,67 @@ namespace psvs
psvs_text_app = 0xee6b6287,
};
- static SceVoid Update(ScePVoid arg);
+ static void Update(void *arg);
HudFull();
virtual ~HudFull();
- virtual SceVoid SetPosition(Position pos);
+ virtual void SetPosition(Position pos);
+
+ static void SetMemLabel(uint32_t used, uint32_t total, paf::ui::Text *usedText, paf::ui::Text *totalText);
+
+ protected:
+
+ paf::ui::Text *ramUsed;
+ paf::ui::Text *cdramUsed;
+ paf::ui::Text *phyUsed;
+ paf::ui::Text *cdlgUsed;
+ paf::ui::Text *ramTotal;
+ paf::ui::Text *cdramTotal;
+ paf::ui::Text *phyTotal;
+ paf::ui::Text *cdlgTotal;
+ paf::ui::Text *app;
+
+ uint32_t memTick;
+ PSVSMem oldMem;
+ };
+
+ class HudDev : public HudMini
+ {
+ public:
+
+ #define PSVS_VNZ_UPDATE_WINDOW_USEC (1000)
+ #define PSVS_BAT_UPDATE_WINDOW_USEC (500000)
+
+ enum Hash
+ {
+ psvs_template_hud_dev = 0xf6e17467,
+ psvs_text_vnz_0 = 0x7524c263,
+ psvs_text_vnz_1 = 0x56c14879,
+ psvs_text_vnz_2 = 0x03cd5e60,
+ psvs_text_vnz_3 = 0x8c6b209e,
+ psvs_text_vnz_4 = 0x98e73415,
+ psvs_text_vnz_5 = 0xd8c59975,
+ psvs_text_vnz_6 = 0x7cb8ea8d,
+ psvs_text_vnz_7 = 0xf646c3a1,
+ psvs_text_vnz_peak = 0xebc15716,
+ psvs_text_bat_cur = 0x18869f58,
+ };
+
+ static void Update(void *arg);
+
+ HudDev();
+
+ virtual ~HudDev();
+ virtual void SetPosition(Position pos);
- static SceVoid SetMemLabel(SceUInt32 used, SceUInt32 total, paf::ui::Text *usedText, paf::ui::Text *totalText);
+ static void SetMemLabel(uint32_t used, uint32_t total, paf::ui::Text *usedText, paf::ui::Text *totalText);
protected:
paf::ui::Text *vnz[8];
paf::ui::Text *vnzPeak;
+ paf::ui::Text *batCur;
paf::ui::Text *ramUsed;
paf::ui::Text *cdramUsed;
paf::ui::Text *phyUsed;
@@ -155,9 +195,13 @@ namespace psvs
paf::ui::Text *cdlgTotal;
paf::ui::Text *app;
- SceUInt32 memTick;
+ uint32_t memTickCommon;
+ uint32_t memTickVnzUpd;
+ uint32_t memTickBat;
+ bool vnzNeedUpdate;
PSVSMem oldMem;
PSVSVenezia oldVnz;
+ PSVSBattery oldBat;
};
}
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/impose.cpp b/PSVshellPlus_Shell/impose.cpp
index ab5606e..550e2ca 100644
--- a/PSVshellPlus_Shell/impose.cpp
+++ b/PSVshellPlus_Shell/impose.cpp
@@ -14,56 +14,57 @@ using namespace paf;
namespace psvs
{
- static SceInt32 s_hudMode = Impose::HudMode_Off;
- static SceInt32 s_hudPos = Hud::Position_UpLeft;
- static SceInt32 s_cas = -0x1000;
+ static int32_t s_hudMode = Impose::HudMode_Off;
+ static int32_t s_hudPos = Hud::Position_UpLeft;
+ static int32_t s_cas = -0x1000;
- const SceInt32 k_cpuClock[] = { 41, 83, 111, 166, 222, 333, 444, 500 };
- const SceInt32 k_gpuClock[] = { 41, 55, 83, 111, 166, 222 };
- const SceInt32 k_busClock[] = { 55, 83, 111, 166, 222 };
- const SceInt32 k_xbarClock[] = { 83, 111, 166 };
+ const int32_t k_cpuClock[] = { 41, 83, 111, 166, 222, 333, 444, 500 };
+ const int32_t k_gpuClock[] = { 41, 55, 83, 111, 166, 222 };
+ const int32_t k_busClock[] = { 55, 83, 111, 166, 222 };
+ const int32_t k_xbarClock[] = { 83, 111, 166 };
- SceVoid Impose::ControlButtonCB::ControlButtonCBFun(SceInt32 eventId, ui::Widget *self, SceInt32 a3, ScePVoid pUserData)
+ void Impose::ControlButtonCBFun(int32_t type, ui::Handler *self, ui::Event *e, void *userdata)
{
wstring wstr;
wchar_t casVal[2];
- SceInt32 arraySize = 0;
- const SceInt32 *arrayPtr = SCE_NULL;
- SceInt32 direction = 0;
- SceInt32 currentClock = 0;
- Impose *obj = (Impose *)pUserData;
- Hud *currHud = SCE_NULL;
- SceInt32(*clockSet)(int clock) = SCE_NULL;
+ int32_t arraySize = 0;
+ const int32_t *arrayPtr = NULL;
+ int32_t direction = 0;
+ int32_t currentClock = 0;
+ Impose *obj = (Impose *)userdata;
+ ui::Widget *wdg = (ui::Widget *)self;
+ Hud *currHud = NULL;
+ int32_t(*clockSet)(int clock) = NULL;
PSVSClockFrequency clock;
psvsGetClockFrequency(&clock);
- switch (self->elem.hash) {
+ switch (wdg->GetName().GetIDHash()) {
case psvs_button_impose_cpu_down:
currentClock = clock.cpu;
clockSet = psvsSetArmClockFrequency;
direction = -1;
- arraySize = sizeof(k_cpuClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_cpuClock) / sizeof(int32_t);
arrayPtr = k_cpuClock;
break;
case psvs_button_impose_cpu_up:
currentClock = clock.cpu;
clockSet = psvsSetArmClockFrequency;
direction = 1;
- arraySize = sizeof(k_cpuClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_cpuClock) / sizeof(int32_t);
arrayPtr = k_cpuClock;
break;
case psvs_button_impose_gpu_down:
currentClock = clock.gpu;
clockSet = psvsSetGpuClockFrequency;
direction = -1;
- arraySize = sizeof(k_gpuClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_gpuClock) / sizeof(int32_t);
arrayPtr = k_gpuClock;
break;
case psvs_button_impose_gpu_up:
currentClock = clock.gpu;
clockSet = psvsSetGpuClockFrequency;
direction = 1;
- arraySize = sizeof(k_gpuClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_gpuClock) / sizeof(int32_t);
arrayPtr = k_gpuClock;
break;
/*
@@ -71,14 +72,14 @@ namespace psvs
currentClock = clock.bus;
clockSet = psvsSetBusClockFrequency;
direction = -1;
- arraySize = sizeof(k_busClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_busClock) / sizeof(int32_t);
arrayPtr = k_busClock;
break;
case psvs_button_impose_bus_up:
currentClock = clock.bus;
clockSet = psvsSetBusClockFrequency;
direction = 1;
- arraySize = sizeof(k_busClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_busClock) / sizeof(int32_t);
arrayPtr = k_busClock;
break;
*/
@@ -86,14 +87,14 @@ namespace psvs
currentClock = clock.xbar;
clockSet = psvsSetGpuXbarClockFrequency;
direction = -1;
- arraySize = sizeof(k_xbarClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_xbarClock) / sizeof(int32_t);
arrayPtr = k_xbarClock;
break;
case psvs_button_impose_xbar_up:
currentClock = clock.xbar;
clockSet = psvsSetGpuXbarClockFrequency;
direction = 1;
- arraySize = sizeof(k_xbarClock) / sizeof(SceInt32);
+ arraySize = sizeof(k_xbarClock) / sizeof(int32_t);
arrayPtr = k_xbarClock;
break;
case psvs_button_impose_hud_down:
@@ -103,68 +104,78 @@ namespace psvs
else {
break;
}
- thread::s_mainThreadMutex.Lock();
+ thread::RMutex::main_thread_mutex.Lock();
currHud = Hud::GetCurrentHud();
- if (currHud != SCE_NULL) {
+ if (currHud != NULL) {
delete currHud;
}
switch (s_hudMode) {
case HudMode_Off:
- wstr = GetString("psvs_msg_hud_off");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_off");
break;
case HudMode_Micro:
- wstr = GetString("psvs_msg_hud_micro");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_micro");
currHud = new HudMicro();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
case HudMode_Mini:
- wstr = GetString("psvs_msg_hud_mini");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_mini");
currHud = new HudMini();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
case HudMode_Full:
- wstr = GetString("psvs_msg_hud_full");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_full");
currHud = new HudFull();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
+ case HudMode_Dev:
+ wstr = g_corePlugin->GetString("psvs_msg_hud_dev");
+ currHud = new HudDev();
+ currHud->SetPosition((Hud::Position)s_hudPos);
+ break;
}
- obj->hud->SetLabel(&wstr);
- thread::s_mainThreadMutex.Unlock();
+ obj->hud->SetString(wstr);
+ thread::RMutex::main_thread_mutex.Unlock();
break;
case psvs_button_impose_hud_up:
- if (s_hudMode != HudMode_Full) {
+ if (s_hudMode != HudMode_Dev) {
s_hudMode++;
}
else {
break;
}
- thread::s_mainThreadMutex.Lock();
+ thread::RMutex::main_thread_mutex.Lock();
currHud = Hud::GetCurrentHud();
- if (currHud != SCE_NULL) {
+ if (currHud != NULL) {
delete currHud;
}
switch (s_hudMode) {
case HudMode_Off:
- wstr = GetString("psvs_msg_hud_off");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_off");
break;
case HudMode_Micro:
- wstr = GetString("psvs_msg_hud_micro");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_micro");
currHud = new HudMicro();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
case HudMode_Mini:
- wstr = GetString("psvs_msg_hud_mini");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_mini");
currHud = new HudMini();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
case HudMode_Full:
- wstr = GetString("psvs_msg_hud_full");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_full");
currHud = new HudFull();
currHud->SetPosition((Hud::Position)s_hudPos);
break;
+ case HudMode_Dev:
+ wstr = g_corePlugin->GetString("psvs_msg_hud_dev");
+ currHud = new HudDev();
+ currHud->SetPosition((Hud::Position)s_hudPos);
+ break;
}
- obj->hud->SetLabel(&wstr);
- thread::s_mainThreadMutex.Unlock();
+ obj->hud->SetString(wstr);
+ thread::RMutex::main_thread_mutex.Unlock();
break;
case psvs_button_impose_hud_pos_down:
currHud = Hud::GetCurrentHud();
@@ -174,25 +185,25 @@ namespace psvs
else {
break;
}
- thread::s_mainThreadMutex.Lock();
+ thread::RMutex::main_thread_mutex.Lock();
switch (s_hudPos) {
case Hud::Position_UpLeft:
- wstr = GetString("psvs_msg_hud_pos_ul");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ul");
break;
case Hud::Position_UpRight:
- wstr = GetString("psvs_msg_hud_pos_ur");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ur");
break;
case Hud::Position_DownLeft:
- wstr = GetString("psvs_msg_hud_pos_dl");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dl");
break;
case Hud::Position_DownRight:
- wstr = GetString("psvs_msg_hud_pos_dr");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dr");
break;
}
- obj->hudpos->SetLabel(&wstr);
- if (currHud != SCE_NULL)
+ obj->hudpos->SetString(wstr);
+ if (currHud != NULL)
currHud->SetPosition((Hud::Position)s_hudPos);
- thread::s_mainThreadMutex.Unlock();
+ thread::RMutex::main_thread_mutex.Unlock();
break;
case psvs_button_impose_hud_pos_up:
currHud = Hud::GetCurrentHud();
@@ -202,25 +213,25 @@ namespace psvs
else {
break;
}
- thread::s_mainThreadMutex.Lock();
+ thread::RMutex::main_thread_mutex.Lock();
switch (s_hudPos) {
case Hud::Position_UpLeft:
- wstr = GetString("psvs_msg_hud_pos_ul");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ul");
break;
case Hud::Position_UpRight:
- wstr = GetString("psvs_msg_hud_pos_ur");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ur");
break;
case Hud::Position_DownLeft:
- wstr = GetString("psvs_msg_hud_pos_dl");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dl");
break;
case Hud::Position_DownRight:
- wstr = GetString("psvs_msg_hud_pos_dr");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dr");
break;
}
- obj->hudpos->SetLabel(&wstr);
- if (currHud != SCE_NULL)
+ obj->hudpos->SetString(wstr);
+ if (currHud != NULL)
currHud->SetPosition((Hud::Position)s_hudPos);
- thread::s_mainThreadMutex.Unlock();
+ thread::RMutex::main_thread_mutex.Unlock();
break;
case psvs_button_impose_cas_down:
if (s_cas >= 0) {
@@ -229,17 +240,17 @@ namespace psvs
else {
break;
}
- thread::s_mainThreadMutex.Lock();
+ thread::RMutex::main_thread_mutex.Lock();
if (s_cas < 0) {
- wstr = GetString("psvs_msg_auto");
+ wstr = g_corePlugin->GetString("psvs_msg_auto");
}
else {
- sce_paf_swprintf(casVal, sizeof(casVal), L"%d", s_cas / 0x1000);
+ sce_paf_swprintf(casVal, 2, L"%d", s_cas / 0x1000);
wstr = casVal;
}
- obj->cas->SetLabel(&wstr);
+ obj->cas->SetString(wstr);
Hud::SetCasShift(s_cas);
- thread::s_mainThreadMutex.Unlock();
+ thread::RMutex::main_thread_mutex.Unlock();
break;
case psvs_button_impose_cas_up:
if (s_cas != 0x7000) {
@@ -248,12 +259,12 @@ namespace psvs
else {
break;
}
- thread::s_mainThreadMutex.Lock();
- sce_paf_swprintf(casVal, sizeof(casVal) / sizeof(wchar_t), L"%d", s_cas / 0x1000);
+ thread::RMutex::main_thread_mutex.Lock();
+ sce_paf_swprintf(casVal, 2, L"%d", s_cas / 0x1000);
wstr = casVal;
- obj->cas->SetLabel(&wstr);
+ obj->cas->SetString(wstr);
Hud::SetCasShift(s_cas);
- thread::s_mainThreadMutex.Unlock();
+ thread::RMutex::main_thread_mutex.Unlock();
break;
}
@@ -275,32 +286,33 @@ namespace psvs
}
}
- SceVoid Impose::ProfileButtonCB::ProfileButtonCBFun(SceInt32 eventId, ui::Widget *self, SceInt32 a3, ScePVoid pUserData)
+ void Impose::ProfileButtonCBFun(int32_t type, ui::Handler *self, ui::Event *e, void *userdata)
{
- ui::Widget *bt = (ui::Widget *)pUserData;
+ ui::Button *wdg = (ui::Button *)self;
+ uint32_t hash = wdg->GetName().GetIDHash();
- if (self->elem.hash == psvs_button_impose_save) {
+ if (hash == psvs_button_impose_save) {
psvs::Profile *profile = new psvs::Profile();
profile->Save();
delete profile;
tracker::ReloadCurrentProfile();
- bt->Enable(true);
+ wdg->Enable(true);
}
- else if (self->elem.hash == psvs_button_impose_delete) {
+ else if (hash == psvs_button_impose_delete) {
psvs::Profile::Delete();
tracker::ReloadCurrentProfile();
- bt->Disable(true);
+ wdg->Disable(true);
}
}
- SceVoid Impose::LockCB::LockCBFun(SceInt32 eventId, ui::Widget *self, SceInt32 a3, ScePVoid pUserData)
+ void Impose::LockCBFun(int32_t type, ui::Handler *self, ui::Event *e, void *userdata)
{
- ui::CheckBox *obj = (ui::CheckBox *)self;
+ ui::CheckBox *wdg = (ui::CheckBox *)self;
ScePID pid = psvs::tracker::GetCurrentPID();
PsvsLockDevice target = PSVS_LOCK_DEVICE_NONE;
- switch (self->elem.hash) {
+ switch (wdg->GetName().GetIDHash()) {
case psvs_check_box_impose_cpu_lock:
target = PSVS_LOCK_DEVICE_CPU;
break;
@@ -315,24 +327,22 @@ namespace psvs
break;
}
- if (obj->state == 1)
+ if (wdg->IsChecked())
psvsClockFrequencyLockProc(pid, target);
else
psvsClockFrequencyUnlockProc(pid, target);
}
- SceVoid Impose::Update(ScePVoid arg)
+ void Impose::Update(void *arg)
{
- rco::Element element;
PSVSClockFrequency clock;
wstring wtext;
wchar_t wbuf[16];
- SceUInt32 tickNow = sceKernelGetProcessTimeLow();
+ uint32_t tickNow = sceKernelGetProcessTimeLow();
Impose *obj = (Impose *)arg;
if (tickNow - obj->oldTick > PSVS_IMPOSE_UPDATE_WINDOW_USEC) {
- element.hash = 0x0EE0C8AF;
- if (!g_imposeRoot->GetChild(&element, 0)) {
+ if (!g_imposeRoot->FindChild(0x0EE0C8AF)) {
delete obj;
return;
}
@@ -341,29 +351,29 @@ namespace psvs
psvsGetClockFrequency(&clock);
if (obj->oldClock.cpu != clock.cpu) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L"%d MHz", clock.cpu);
+ sce_paf_swprintf(wbuf, 16, L"%d MHz", clock.cpu);
wtext = wbuf;
- obj->cpu->SetLabel(&wtext);
+ obj->cpu->SetString(wtext);
}
if (obj->oldClock.gpu != clock.gpu) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L"%d MHz", clock.gpu);
+ sce_paf_swprintf(wbuf, 16, L"%d MHz", clock.gpu);
wtext = wbuf;
- obj->gpu->SetLabel(&wtext);
+ obj->gpu->SetString(wtext);
}
/*
if (obj->oldClock.bus != clock.bus) {
sce_paf_swprintf(wbuf, sizeof(wbuf), L"%d MHz", clock.bus);
wtext = wbuf;
- obj->bus->SetLabel(&wtext);
+ obj->bus->SetString(wtext);
}
*/
if (obj->oldClock.xbar != clock.xbar) {
- sce_paf_swprintf(wbuf, sizeof(wbuf), L"%d MHz", clock.xbar);
+ sce_paf_swprintf(wbuf, 16, L"%d MHz", clock.xbar);
wtext = wbuf;
- obj->xbar->SetLabel(&wtext);
+ obj->xbar->SetString(wtext);
}
obj->oldTick = tickNow;
@@ -376,23 +386,21 @@ namespace psvs
return (Hud::Position)s_hudPos;
}
- SceVoid Impose::SetHudPosition(Hud::Position pos)
+ void Impose::SetHudPosition(Hud::Position pos)
{
s_hudPos = pos;
Hud *currHud = Hud::GetCurrentHud();
- if (currHud != SCE_NULL) {
+ if (currHud != NULL) {
currHud->SetPosition(pos);
}
}
Impose::Impose(Plugin *plugin, ui::Box *root)
{
- rco::Element welement;
- rco::Element selement;
wstring wstr;
wchar_t casVal[2];
- Vector4 sz;
- Plugin::TemplateInitParam tmpParam;
+ math::v4 sz;
+ Plugin::TemplateOpenParam tmpParam;
ScePID pid = psvs::tracker::GetCurrentPID();
this->oldTick = 0;
@@ -401,198 +409,149 @@ namespace psvs
this->imposePlugin = Plugin::Find("impose_plugin");
sce_paf_memset(&this->oldClock, 0, sizeof(PSVSClockFrequency));
- welement.hash = 0x7ac075f7;
- selement.hash = 0x26c7781e;
- ui::Widget *sep0 = this->imposePlugin->CreateWidgetWithStyle(this->root, "plane", &welement, &selement);
- sz.x = 835.0f;
- sz.y = 20.0f;
- sep0->SetSize(&sz);
+ ui::Widget *sep0 = this->imposePlugin->CreateWidget(this->root, "plane", 0x7ac075f7, 0x26c7781e);
+ sz.set_x(835.0f);
+ sz.set_y(20.0f);
+ sep0->SetSize(sz);
- welement.hash = psvs_template_impose;
- this->plugin->TemplateOpen(this->root, &welement, &tmpParam);
+ this->plugin->TemplateOpen(this->root, psvs_template_impose, tmpParam);
- welement.hash = 0x7ac075f7;
- ui::Widget *sep1 = this->imposePlugin->CreateWidgetWithStyle(this->root, "plane", &welement, &selement);
- sz.x = 835.0f;
- sz.y = 20.0f;
- sep1->SetSize(&sz);
-
- welement.hash = psvs_template_impose_2;
- this->plugin->TemplateOpen(this->root, &welement, &tmpParam);
-
- welement.hash = psvs_text_impose_cpu_value;
- this->cpu = (ui::Text *)this->root->GetChild(&welement, 0);
-
- welement.hash = psvs_text_impose_gpu_value;
- this->gpu = (ui::Text *)this->root->GetChild(&welement, 0);
+ ui::Widget *sep1 = this->imposePlugin->CreateWidget(this->root, "plane", 0x7ac075f7, 0x26c7781e);
+ sz.set_x(835.0f);
+ sz.set_y(20.0f);
+ sep1->SetSize(sz);
+ this->plugin->TemplateOpen(this->root, psvs_template_impose_2, tmpParam);
+ this->cpu = (ui::Text *)this->root->FindChild(psvs_text_impose_cpu_value);
+ this->gpu = (ui::Text *)this->root->FindChild(psvs_text_impose_gpu_value);
/*
- welement.hash = psvs_text_impose_bus_value;
- this->bus = (ui::Text *)this->root->GetChild(&welement, 0);
+ this->bus = (ui::Text *)this->root->FindChild(psvs_text_impose_bus_value);
*/
+ this->xbar = (ui::Text *)this->root->FindChild(psvs_text_impose_xbar_value);
+ this->hud = (ui::Text *)this->root->FindChild(psvs_text_impose_hud_value);
- welement.hash = psvs_text_impose_xbar_value;
- this->xbar = (ui::Text *)this->root->GetChild(&welement, 0);
-
- welement.hash = psvs_text_impose_hud_value;
- this->hud = (ui::Text *)this->root->GetChild(&welement, 0);
switch (s_hudMode) {
case HudMode_Off:
- wstr = GetString("psvs_msg_hud_off");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_off");
break;
case HudMode_Micro:
- wstr = GetString("psvs_msg_hud_micro");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_micro");
break;
case HudMode_Mini:
- wstr = GetString("psvs_msg_hud_mini");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_mini");
break;
case HudMode_Full:
- wstr = GetString("psvs_msg_hud_full");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_full");
+ break;
+ case HudMode_Dev:
+ wstr = g_corePlugin->GetString("psvs_msg_hud_dev");
break;
}
- this->hud->SetLabel(&wstr);
+ this->hud->SetString(wstr);
+
+ this->hudpos = (ui::Text *)this->root->FindChild(psvs_text_impose_hud_pos_value);
- welement.hash = psvs_text_impose_hud_pos_value;
- this->hudpos = (ui::Text *)this->root->GetChild(&welement, 0);
switch (s_hudPos) {
case Hud::Position_UpLeft:
- wstr = GetString("psvs_msg_hud_pos_ul");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ul");
break;
case Hud::Position_UpRight:
- wstr = GetString("psvs_msg_hud_pos_ur");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_ur");
break;
case Hud::Position_DownLeft:
- wstr = GetString("psvs_msg_hud_pos_dl");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dl");
break;
case Hud::Position_DownRight:
- wstr = GetString("psvs_msg_hud_pos_dr");
+ wstr = g_corePlugin->GetString("psvs_msg_hud_pos_dr");
break;
}
- this->hudpos->SetLabel(&wstr);
+ this->hudpos->SetString(wstr);
+
+ this->cas = (ui::Text *)this->root->FindChild(psvs_text_impose_cas_value);
- welement.hash = psvs_text_impose_cas_value;
- this->cas = (ui::Text *)this->root->GetChild(&welement, 0);
if (s_cas < 0) {
- wstr = GetString("psvs_msg_auto");
+ wstr = g_corePlugin->GetString("psvs_msg_auto");
}
else {
- sce_paf_swprintf(casVal, sizeof(casVal) / sizeof(wchar_t), L"%d", s_cas / 0x1000);
+ sce_paf_swprintf(casVal, 2, L"%d", s_cas / 0x1000);
wstr = casVal;
}
- this->cas->SetLabel(&wstr);
-
- ui::Widget *widget = SCE_NULL;
- ui::CheckBox *box = SCE_NULL;
-
- welement.hash = psvs_button_impose_cpu_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_cpu_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_gpu_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_gpu_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
+ this->cas->SetString(wstr);
+
+ ui::Widget *widget = NULL;
+ ui::Button *bt = NULL;
+ ui::CheckBox *box = NULL;
+
+ widget = this->root->FindChild(psvs_button_impose_cpu_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_cpu_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_gpu_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_gpu_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
/*
- welement.hash = psvs_button_impose_bus_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_bus_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
+ widget = this->root->FindChild(psvs_button_impose_bus_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_bus_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
*/
-
- welement.hash = psvs_button_impose_xbar_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_xbar_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_hud_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_hud_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_hud_pos_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_hud_pos_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_cas_up;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_cas_down;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ControlButtonCB(this), 0);
-
- welement.hash = psvs_button_impose_delete;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new ProfileButtonCB(widget), 0);
+ widget = this->root->FindChild(psvs_button_impose_xbar_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_xbar_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_hud_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_hud_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_hud_pos_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_hud_pos_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_cas_up);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_cas_down);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ControlButtonCBFun, this);
+ widget = this->root->FindChild(psvs_button_impose_delete);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ProfileButtonCBFun, this);
if (psvs::tracker::GetCurrentProfile()) {
- widget->Enable(true);
+ bt = (ui::Button *)widget;
+ bt->Enable(true);
}
-
- ProfileButtonCB *cb = new ProfileButtonCB(widget);
- welement.hash = psvs_button_impose_save;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, cb, 0);
-
- welement.hash = psvs_check_box_impose_cpu_lock;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new LockCB(), 0);
+ widget = this->root->FindChild(psvs_button_impose_save);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, ProfileButtonCBFun, this);
+ widget = this->root->FindChild(psvs_check_box_impose_cpu_lock);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, LockCBFun, this);
if (psvsClockFrequencyIsLockedProc(pid, PSVS_LOCK_DEVICE_CPU)) {
box = (ui::CheckBox *)widget;
- box->SetChecked(0.0f, true, 0);
+ box->SetCheck(true);
}
-
- welement.hash = psvs_check_box_impose_gpu_lock;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new LockCB(), 0);
+ widget = this->root->FindChild(psvs_check_box_impose_gpu_lock);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, LockCBFun, this);
if (psvsClockFrequencyIsLockedProc(pid, PSVS_LOCK_DEVICE_GPU_ES4)) {
box = (ui::CheckBox *)widget;
- box->SetChecked(0.0f, true, 0);
+ box->SetCheck(true);
}
-
/*
- welement.hash = psvs_check_box_impose_bus_lock;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new LockCB(), 0);
+ widget = this->root->FindChild(psvs_check_box_impose_bus_lock);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, LockCBFun, this);
if (psvsClockFrequencyIsLockedProc(pid, PSVS_LOCK_DEVICE_BUS)) {
box = (ui::CheckBox *)widget;
- box->SetChecked(0.0f, true, 0);
+ box->SetCheck(true);
}
*/
-
- welement.hash = psvs_check_box_impose_xbar_lock;
- widget = this->root->GetChild(&welement, 0);
- widget->RegisterEventCallback(ui::EventMain_Decide, new LockCB(), 0);
+ widget = this->root->FindChild(psvs_check_box_impose_xbar_lock);
+ widget->AddEventCallback(ui::Button::CB_BTN_DECIDE, LockCBFun, this);
if (psvsClockFrequencyIsLockedProc(pid, PSVS_LOCK_DEVICE_GPU_XBAR)) {
box = (ui::CheckBox *)widget;
- box->SetChecked(0.0f, true, 0);
+ box->SetCheck(true);
}
- task::Register(Update, this);
+ common::MainThreadCallList::Register(Update, this);
}
Impose::~Impose()
{
- task::Unregister(Update, this);
+ common::MainThreadCallList::Unregister(Update, this);
}
}
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/impose.h b/PSVshellPlus_Shell/impose.h
index 4b04b86..44c6727 100644
--- a/PSVshellPlus_Shell/impose.h
+++ b/PSVshellPlus_Shell/impose.h
@@ -19,7 +19,8 @@ namespace psvs
HudMode_Off,
HudMode_Micro,
HudMode_Mini,
- HudMode_Full
+ HudMode_Full,
+ HudMode_Dev
};
enum Hash
@@ -55,65 +56,13 @@ namespace psvs
psvs_text_impose_cas_value = 0xd0bd439b
};
- class ControlButtonCB : public paf::ui::EventCallback
- {
- public:
-
- ControlButtonCB(Impose *obj)
- {
- eventHandler = ControlButtonCBFun;
- pUserData = obj;
- };
-
- virtual ~ControlButtonCB()
- {
-
- };
-
- static SceVoid ControlButtonCBFun(SceInt32 eventId, paf::ui::Widget *self, SceInt32 a3, ScePVoid pUserData);
-
- };
-
- class ProfileButtonCB : public paf::ui::EventCallback
- {
- public:
-
- ProfileButtonCB(paf::ui::Widget *widget)
- {
- eventHandler = ProfileButtonCBFun;
- pUserData = widget;
- };
-
- virtual ~ProfileButtonCB()
- {
-
- };
-
- static SceVoid ProfileButtonCBFun(SceInt32 eventId, paf::ui::Widget *self, SceInt32 a3, ScePVoid pUserData);
-
- };
-
- class LockCB : public paf::ui::EventCallback
- {
- public:
-
- LockCB()
- {
- eventHandler = LockCBFun;
- };
-
- virtual ~LockCB()
- {
-
- };
-
- static SceVoid LockCBFun(SceInt32 eventId, paf::ui::Widget *self, SceInt32 a3, ScePVoid pUserData);
-
- };
+ static void ControlButtonCBFun(int32_t type, paf::ui::Handler *self, paf::ui::Event *e, void *userdata);
+ static void ProfileButtonCBFun(int32_t type, paf::ui::Handler *self, paf::ui::Event *e, void *userdata);
+ static void LockCBFun(int32_t type, paf::ui::Handler *self, paf::ui::Event *e, void *userdata);
- static SceVoid Update(ScePVoid arg);
+ static void Update(void *arg);
static Hud::Position GetHudPosition();
- static SceVoid SetHudPosition(Hud::Position pos);
+ static void SetHudPosition(Hud::Position pos);
Impose(paf::Plugin *plugin, paf::ui::Box *root);
@@ -134,6 +83,6 @@ namespace psvs
paf::ui::Text *cas;
PSVSClockFrequency oldClock;
- SceUInt32 oldTick;
+ uint32_t oldTick;
};
}
\ No newline at end of file
diff --git a/PSVshellPlus_Shell/main.cpp b/PSVshellPlus_Shell/main.cpp
index 9cf721f..cef96ae 100644
--- a/PSVshellPlus_Shell/main.cpp
+++ b/PSVshellPlus_Shell/main.cpp
@@ -12,18 +12,17 @@
using namespace paf;
-Plugin *g_corePlugin = SCE_NULL;
-ui::ScrollView *g_imposeRoot = SCE_NULL;
-ui::Scene *g_coreRoot = SCE_NULL;
+Plugin *g_corePlugin = NULL;
+ui::ScrollView *g_imposeRoot = NULL;
-static SceBool s_imposeOpened = SCE_FALSE;
+static bool s_imposeOpened = false;
extern "C"
{
SceUID _vshKernelSearchModuleByName(const char *, int *);
}
-SceVoid corePluginStartCb(Plugin *plugin)
+void corePluginStartCb(Plugin *plugin)
{
if (!plugin) {
SCE_DBG_LOG_ERROR("g_corePlugin is NULL\n");
@@ -32,30 +31,28 @@ SceVoid corePluginStartCb(Plugin *plugin)
g_corePlugin = plugin;
}
-SceVoid coreSetImposeTask(ScePVoid arg)
+void coreSetImposeTask(void *arg)
{
- rco::Element element;
- element.hash = 0x0EE0C8AF;
- ui::Box *box = (ui::Box *)g_imposeRoot->GetChild(&element, 0);
+ ui::Box *box = (ui::Box *)g_imposeRoot->FindChild(0x0EE0C8AF, 0);
if (!box)
return;
new psvs::Impose(g_corePlugin, box);
- s_imposeOpened = SCE_FALSE;
+ s_imposeOpened = false;
- task::Unregister(coreSetImposeTask, SCE_NULL);
+ common::MainThreadCallList::Unregister(coreSetImposeTask, NULL);
}
-SceVoid coreSetImpose(SceBool enable)
+void coreSetImpose(bool enable)
{
if (enable && !s_imposeOpened) {
- task::Register(coreSetImposeTask, SCE_NULL);
- s_imposeOpened = SCE_TRUE;
+ common::MainThreadCallList::Register(coreSetImposeTask, NULL);
+ s_imposeOpened = true;
}
}
-SceVoid coreInitImpose()
+void coreInitImpose()
{
SCE_DBG_LOG_INFO("coreInitImpose\n");
@@ -65,7 +62,7 @@ SceVoid coreInitImpose()
return;
//Power manage plugin -> power manage interface
- ScePVoid powerIf = powerManagePlugin->GetInterface(1);
+ void *powerIf = powerManagePlugin->GetInterface(1);
if (!powerIf)
return;
@@ -83,30 +80,24 @@ SceVoid coreInitImpose()
SCE_DBG_LOG_INFO("coreInitImpose OK\n");
}
-SceVoid coreInitPlugin()
+void coreInitPlugin()
{
SCE_DBG_LOG_INFO("coreInitPlugin\n");
- rco::Element element;
- Plugin::PageInitParam pgiParam;
Plugin::InitParam pluginParam;
- pluginParam.pluginName = "psvshell_plugin";
- pluginParam.resourcePath = "ur0:data/PSVshell/psvshell_plugin.rco";
- pluginParam.scopeName = "__main__";
- pluginParam.pluginStartCB = corePluginStartCb;
+ pluginParam.name = "psvshell_plugin";
+ pluginParam.resource_file = "ur0:data/PSVshell/psvshell_plugin.rco";
+ pluginParam.caller_name = "__main__";
+ pluginParam.start_func = corePluginStartCb;
- s_frameworkInstance->LoadPlugin(&pluginParam, SCE_NULL, SCE_NULL);
+ Plugin::LoadSync(pluginParam);
psvs::Profile::Init();
- //task::Register(leakTestTask, SCE_NULL);
+ //task::Register(leakTestTask, NULL);
psvs::tracker::Init();
- pgiParam.priority = 6;
- element.hash = psvs::GetHash("psvs_page_hud");
- g_coreRoot = g_corePlugin->PageOpen(&element, &pgiParam);
-
SCE_DBG_LOG_INFO("coreInitPlugin OK\n");
}
@@ -117,7 +108,7 @@ extern "C" {
bool paf_system_SupportsWiredEthernet_patched()
{
- coreSetImpose(SCE_TRUE);
+ coreSetImpose(true);
return TAI_NEXT(paf_system_SupportsWiredEthernet_patched, s_hookRef[1]);
}
diff --git a/PSVshellPlus_Shell/profile.cpp b/PSVshellPlus_Shell/profile.cpp
index 4e38348..7c159c3 100644
--- a/PSVshellPlus_Shell/profile.cpp
+++ b/PSVshellPlus_Shell/profile.cpp
@@ -10,7 +10,7 @@
using namespace paf;
-SceVoid psvs::Profile::Init()
+void psvs::Profile::Init()
{
Dir::Create(PSVS_PROFILES_DIR);
}
@@ -60,9 +60,9 @@ psvs::Profile *psvs::Profile::Load()
{
string path = PSVS_PROFILES_DIR;
string path2;
- Profile *prof = SCE_NULL;
+ Profile *prof = NULL;
- ccc::UTF16toUTF8(psvs::tracker::GetCurrentAppName(), &path2);
+ common::Utf16ToUtf8(*psvs::tracker::GetCurrentAppName(), &path2);
path += path2;
@@ -75,29 +75,29 @@ psvs::Profile *psvs::Profile::Load()
if (prof)
delete prof;
- return SCE_NULL;
+ return NULL;
}
-SceVoid psvs::Profile::Delete()
+void psvs::Profile::Delete()
{
string path = PSVS_PROFILES_DIR;
string path2;
- ccc::UTF16toUTF8(psvs::tracker::GetCurrentAppName(), &path2);
+ common::Utf16ToUtf8(*psvs::tracker::GetCurrentAppName(), &path2);
path += path2;
LocalFile::RemoveFile(path.c_str());
}
-SceVoid psvs::Profile::Save()
+void psvs::Profile::Save()
{
LocalFile file;
LocalFile::OpenArg oarg;
string path = PSVS_PROFILES_DIR;
string path2;
- ccc::UTF16toUTF8(psvs::tracker::GetCurrentAppName(), &path2);
+ common::Utf16ToUtf8(*psvs::tracker::GetCurrentAppName(), &path2);
path += path2;
diff --git a/PSVshellPlus_Shell/profile.h b/PSVshellPlus_Shell/profile.h
index 0613975..79cbb91 100644
--- a/PSVshellPlus_Shell/profile.h
+++ b/PSVshellPlus_Shell/profile.h
@@ -14,11 +14,11 @@ namespace psvs
{
public:
- static SceVoid Init();
+ static void Init();
static Profile *Load();
- static SceVoid Delete();
+ static void Delete();
Profile();
@@ -26,11 +26,11 @@ namespace psvs
~Profile();
- SceVoid Save();
+ void Save();
char ver[8];
- SceUInt32 lock;
- SceInt32 clock[PSVS_OC_DEVICE_MAX];
+ uint32_t lock;
+ int32_t clock[PSVS_OC_DEVICE_MAX];
private:
};
diff --git a/PSVshellPlus_Shell/psvs.h b/PSVshellPlus_Shell/psvs.h
index 782c417..172f4a7 100644
--- a/PSVshellPlus_Shell/psvs.h
+++ b/PSVshellPlus_Shell/psvs.h
@@ -68,6 +68,10 @@ typedef struct PSVSVenezia {
SceInt32 peak;
} PSVSVenezia;
+typedef struct PSVSBattery {
+ SceInt32 current;
+} PSVSBattery;
+
typedef struct PSVSCpu {
SceInt32 avg[SCE_KERNEL_MAX_CPU];
SceInt32 peak;
@@ -87,6 +91,7 @@ SceBool psvsClockFrequencyIsLockedProc(ScePID pid, PsvsLockDevice type);
SceInt32 psvsSetRecommendedCasShift(char *name, SceInt32 namelen);
SceVoid psvsSetClockingPid(SceUID pid);
SceInt32 psvsGetVeneziaInfo(PSVSVenezia *data);
+SceInt32 psvsGetBatteryInfo(PSVSBattery *data);
SceVoid psvsCalcCpu();
SceInt32 psvsGetCpu(PSVSCpu *cpu);
diff --git a/PSVshellPlus_Shell/psvshell_plugin.rco b/PSVshellPlus_Shell/psvshell_plugin.rco
index 86aaf7a..c37eb6c 100644
Binary files a/PSVshellPlus_Shell/psvshell_plugin.rco and b/PSVshellPlus_Shell/psvshell_plugin.rco differ
diff --git a/PSVshellPlus_Shell/tracker.cpp b/PSVshellPlus_Shell/tracker.cpp
index fca4748..38b5a6d 100644
--- a/PSVshellPlus_Shell/tracker.cpp
+++ b/PSVshellPlus_Shell/tracker.cpp
@@ -18,19 +18,19 @@ namespace psvs
{
namespace tracker
{
- static SceInt32 s_currAppId = -1;
+ static int32_t s_currAppId = -1;
static ScePID s_currPid = -1;
- static wstring *s_currAppName = SCE_NULL;
- static SceUInt32 s_tickOld = 0;
- static SceInt32 s_fpsTarget = PSVS_FPS_COUNTER_TARGET_SHFB;
- static psvs::Profile *s_currProfile = SCE_NULL;
+ static wstring *s_currAppName = NULL;
+ static uint32_t s_tickOld = 0;
+ static int32_t s_fpsTarget = PSVS_FPS_COUNTER_TARGET_SHFB;
+ static psvs::Profile *s_currProfile = NULL;
- SceVoid Update(ScePVoid arg)
+ void Update(void *arg)
{
char name[32];
- SceInt32 appId = -1;
- SceUInt32 tickNow = sceKernelGetProcessTimeLow();
- SceBool appChanged = SCE_FALSE;
+ int32_t appId = -1;
+ uint32_t tickNow = sceKernelGetProcessTimeLow();
+ bool appChanged = false;
if (tickNow - s_tickOld > PSVS_APP_UPDATE_WINDOW_USEC) {
appId = sceAppMgrGetAppIdByAppId(SCE_APPMGR_APP_ID_ACTIVE);
@@ -38,7 +38,7 @@ namespace tracker
if (s_currAppId != appId) {
s_currPid = sceAppMgrGetProcessIdByAppIdForShell(appId);
sceAppMgrGetNameById(sceAppMgrGetProcessIdByAppIdForShell(appId), name);
- ccc::UTF8toUTF16(name, s_currAppName);
+ common::Utf8ToUtf16(name, s_currAppName);
if (sceAppMgrGetAppIdByAppId(SCE_APPMGR_APP_ID_GAME) != appId) {
s_fpsTarget = PSVS_FPS_COUNTER_TARGET_SHFB;
psvsSetRecommendedCasShift(name, sce_paf_strlen(name) + 1);
@@ -48,7 +48,7 @@ namespace tracker
psvsSetRecommendedCasShift("game", sizeof("game"));
}
s_currAppId = appId;
- appChanged = SCE_TRUE;
+ appChanged = true;
}
}
else {
@@ -58,7 +58,7 @@ namespace tracker
psvsSetRecommendedCasShift("main", sizeof("main"));
s_fpsTarget = PSVS_FPS_COUNTER_TARGET_SHFB;
s_currAppId = -1;
- appChanged = SCE_TRUE;
+ appChanged = true;
}
}
@@ -93,7 +93,7 @@ namespace tracker
return s_currPid;
}
- SceVoid ReloadCurrentProfile()
+ void ReloadCurrentProfile()
{
s_currProfile = psvs::Profile::Load();
}
@@ -103,7 +103,7 @@ namespace tracker
return s_currProfile;
}
- SceInt32 GetFpsCounterTarget()
+ int32_t GetFpsCounterTarget()
{
return s_fpsTarget;
}
@@ -128,7 +128,7 @@ namespace tracker
return SCE_OK;
}
- SceVoid Init()
+ void Init()
{
s_currPid = sceKernelGetProcessId();
s_currAppName = new wstring(L"main");
@@ -148,12 +148,12 @@ namespace tracker
SceUID cbid = sceKernelCreateCallback("PSVshellPlus_PCB", 0, PowerCallback, NULL);
scePowerRegisterCallback(cbid);
- task::Register(Update, SCE_NULL);
+ common::MainThreadCallList::Register(Update, NULL);
}
- SceVoid Term()
+ void Term()
{
- task::Unregister(Update, SCE_NULL);
+ common::MainThreadCallList::Unregister(Update, NULL);
delete s_currAppName;
}
}
diff --git a/PSVshellPlus_Shell/tracker.h b/PSVshellPlus_Shell/tracker.h
index b2f2b1c..a03a91f 100644
--- a/PSVshellPlus_Shell/tracker.h
+++ b/PSVshellPlus_Shell/tracker.h
@@ -11,14 +11,14 @@ namespace psvs
{
#define PSVS_APP_UPDATE_WINDOW_USEC (100000)
- SceVoid Init();
- SceVoid Term();
- SceVoid Update(ScePVoid arg);
+ void Init();
+ void Term();
+ void Update(void *arg);
paf::wstring *GetCurrentAppName();
ScePID GetCurrentPID();
- SceVoid ReloadCurrentProfile();
+ void ReloadCurrentProfile();
psvs::Profile *GetCurrentProfile();
- SceInt32 GetFpsCounterTarget();
+ int32_t GetFpsCounterTarget();
SceInt32 PowerCallback(SceUID notifyId, SceInt32 notifyCount, SceInt32 notifyArg, void *pCommon);
}
}
diff --git a/PSVshellPlus_Shell/utils.cpp b/PSVshellPlus_Shell/utils.cpp
index aa22a1c..6a10166 100644
--- a/PSVshellPlus_Shell/utils.cpp
+++ b/PSVshellPlus_Shell/utils.cpp
@@ -2,48 +2,28 @@
#include
#include "global.h"
+#include "utils.h"
using namespace paf;
namespace psvs
{
- SceUInt32 GetHash(const char *name)
- {
- string searchRequest;
- rco::Element searchResult;
-
- searchRequest = name;
- searchResult.hash = searchResult.GetHash(&searchRequest);
-
- return searchResult.hash;
- }
-
- wchar_t *GetString(const char *name)
- {
- rco::Element searchRequest;
-
- searchRequest.hash = GetHash(name);
- wchar_t *res = (wchar_t *)g_corePlugin->GetWString(&searchRequest);
-
- return res;
- }
-
- Rgba ScaleColor(SceInt32 value, SceInt32 min, SceInt32 max)
+ math::v4 ScaleColor(int32_t value, int32_t min, int32_t max)
{
if (value < min)
value = min;
if (value > max)
value = max;
- SceInt32 v = ((SceFloat32)(value - min) / (max - min)) * 255; // 0-255
+ int32_t v = ((float)(value - min) / (max - min)) * 255; // 0-255
- SceInt32 r = (v <= 127) ? v * 2 : 255;
- SceInt32 g = (v > 127) ? 255 - ((v - 128) * 2) : 255;
+ int32_t r = (v <= 127) ? v * 2 : 255;
+ int32_t g = (v > 127) ? 255 - ((v - 128) * 2) : 255;
- return Rgba((SceFloat32)r / 255.0f, (SceFloat32)g / 255.0f, 0.0f, 1.0f);
+ return math::v4((float)r / 255.0f, (float)g / 255.0f, 0.0f, 1.0f);
}
- const wchar_t *UnitsFromSize(SceInt32 bytes)
+ const wchar_t *UnitsFromSize(int32_t bytes)
{
if (bytes >= 1024 * 1024)
return L"MB";
@@ -53,7 +33,7 @@ namespace psvs
return L" B";
}
- SceInt32 ValueFromSize(SceInt32 bytes)
+ int32_t ValueFromSize(int32_t bytes)
{
if (bytes >= 1024 * 1024)
return bytes / 1024 / 1024;
@@ -63,9 +43,9 @@ namespace psvs
return bytes;
}
- SceInt32 LengthOfValue(SceInt32 num)
+ int32_t LengthOfValue(int32_t num)
{
- SceInt32 len = 3;
+ int32_t len = 3;
if (num < 10)
len = 1;
diff --git a/PSVshellPlus_Shell/utils.h b/PSVshellPlus_Shell/utils.h
index 841291e..fde9ca6 100644
--- a/PSVshellPlus_Shell/utils.h
+++ b/PSVshellPlus_Shell/utils.h
@@ -5,10 +5,8 @@
namespace psvs
{
- SceUInt32 GetHash(const char *name);
- wchar_t *GetString(const char *name);
- paf::Rgba ScaleColor(SceInt32 value, SceInt32 min, SceInt32 max);
- const wchar_t *UnitsFromSize(SceInt32 bytes);
- SceInt32 ValueFromSize(SceInt32 bytes);
- SceInt32 LengthOfValue(SceInt32 num);
+ paf::math::v4 ScaleColor(int32_t value, int32_t min, int32_t max);
+ const wchar_t *UnitsFromSize(int32_t bytes);
+ int32_t ValueFromSize(int32_t bytes);
+ int32_t LengthOfValue(int32_t num);
}
\ No newline at end of file