Add more perf stats to API and restructure packets.
This commit is contained in:
@@ -254,7 +254,6 @@ int Proc::ProcessSPRX(caddr_t data)
|
||||
|
||||
auto Input = (KDriver_ProcSPRX*)data;
|
||||
|
||||
klog("DoSwitch");
|
||||
switch (Input->CallType)
|
||||
{
|
||||
case 0:
|
||||
|
||||
@@ -67,7 +67,6 @@ int main()
|
||||
}
|
||||
|
||||
klog("[Orbis Suite] Launching Toolbox!!\n");
|
||||
// Init Orbis Toolbox
|
||||
Handle = OrbisDriver::LoadSPRX("SceShellUI", "/data/Orbis Toolbox/OrbisToolbox-2.0.sprx");
|
||||
if (Handle > 0)
|
||||
klog("Orbis Toolbox loaded! %d\n", Handle);
|
||||
@@ -82,9 +81,8 @@ int main()
|
||||
switch (MsgDialog::DialogResult.buttonId)
|
||||
{
|
||||
case ORBIS_MSG_DIALOG_BUTTON_ID_BUTTON1:
|
||||
OrbisDriver::UnLoadSPRX("SceShellUI", "OrbisToolbox-2.0.sprx");
|
||||
|
||||
sceKernelSleep(3.0);
|
||||
if (OrbisDriver::UnLoadSPRX("SceShellUI", "Orbis Toolbox-2.0.sprx") >= 0)
|
||||
sceKernelSleep(2.0);
|
||||
|
||||
if (!UnloadKernel())
|
||||
{
|
||||
@@ -93,8 +91,9 @@ int main()
|
||||
break;
|
||||
|
||||
case ORBIS_MSG_DIALOG_BUTTON_ID_BUTTON2:
|
||||
OrbisDriver::UnLoadSPRX("SceShellUI", "Orbis Toolbox-2.0.sprx");
|
||||
sceKernelSleep(1.5);
|
||||
if (OrbisDriver::UnLoadSPRX("SceShellUI", "Orbis Toolbox-2.0.sprx") >= 0)
|
||||
sceKernelSleep(1.5);
|
||||
|
||||
OrbisDriver::LoadSPRX("SceShellUI", "/data/Orbis Toolbox/OrbisToolbox-2.0.sprx");
|
||||
break;
|
||||
|
||||
|
||||
@@ -8,31 +8,22 @@ enum APICommands
|
||||
|
||||
/* ####### Proc functions ####### */
|
||||
PROC_START,
|
||||
API_PROC_GET_LIST,
|
||||
API_PROC_ATTACH,
|
||||
API_PROC_DETACH,
|
||||
API_PROC_GET_CURRENT,
|
||||
API_PROC_READ,
|
||||
API_PROC_WRITE,
|
||||
API_PROC_KILL,
|
||||
API_PROC_LOAD_ELF,
|
||||
API_PROC_CALL,
|
||||
|
||||
/* Remote Library functions */
|
||||
API_PROC_LOAD_SPRX,
|
||||
API_PROC_UNLOAD_SPRX,
|
||||
API_PROC_UNLOAD_SPRX_NAME,
|
||||
API_PROC_RELOAD_SPRX_NAME,
|
||||
API_PROC_RELOAD_SPRX_HANDLE,
|
||||
API_PROC_DUMP_MODULE,
|
||||
API_PROC_MODULE_LIST,
|
||||
API_PROC_GET_LIST,
|
||||
API_PROC_LOAD_ELF,
|
||||
API_PROC_CALL, /* RPC Call. */
|
||||
|
||||
PROC_END,
|
||||
/* ############################## */
|
||||
|
||||
/* ##### Debugger functions ##### */
|
||||
DBG_START,
|
||||
API_DBG_START, /* Debugger attach to target */
|
||||
API_DBG_STOP, /* Debugger detach from target */
|
||||
API_DBG_ATTACH, /* Debugger attach to target */
|
||||
API_DBG_DETACH, /* Debugger detach from target */
|
||||
API_DBG_GET_CURRENT,
|
||||
API_DBG_READ,
|
||||
API_DBG_WRITE,
|
||||
API_DBG_KILL,
|
||||
API_DBG_BREAK,
|
||||
API_DBG_RESUME,
|
||||
API_DBG_SIGNAL,
|
||||
@@ -47,6 +38,12 @@ enum APICommands
|
||||
API_DBG_GET_DBGREG,
|
||||
API_DBG_SET_DBGREG,
|
||||
|
||||
/* Remote Library functions */
|
||||
API_DBG_LOAD_SPRX,
|
||||
API_DBG_UNLOAD_SPRX,
|
||||
API_DBG_RELOAD_SPRX,
|
||||
API_DBG_MODULE_LIST,
|
||||
|
||||
/* Thread Management */
|
||||
API_DBG_THREAD_LIST,
|
||||
API_DBG_THREAD_STOP,
|
||||
@@ -190,6 +187,14 @@ enum ConsoleTypes
|
||||
KRATOS, //0xA0 IMPOSSIBLE??
|
||||
};
|
||||
|
||||
struct MemoryInfo
|
||||
{
|
||||
int Used;
|
||||
int Free;
|
||||
int Total;
|
||||
float Percentage;
|
||||
};
|
||||
|
||||
struct TargetInfoPacket
|
||||
{
|
||||
int SDKVersion;
|
||||
@@ -217,7 +222,9 @@ struct TargetInfoPacket
|
||||
int SOCTemp;
|
||||
int ThreadCount;
|
||||
float AverageCPUUsage;
|
||||
|
||||
int BusyCore;
|
||||
MemoryInfo Ram;
|
||||
MemoryInfo VRam;
|
||||
};
|
||||
|
||||
struct TargetNotifyPacket
|
||||
|
||||
@@ -3,7 +3,13 @@
|
||||
|
||||
void Debug::HandleAPI(OrbisNetId Sock, APIPacket* Packet)
|
||||
{
|
||||
switch (Packet->Command)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Debug::Debug()
|
||||
|
||||
@@ -83,7 +83,50 @@ int LncUtil::KillApp(int appId, int userId)
|
||||
}
|
||||
|
||||
//static int ForceKillApp(int appId, int userId = -1);
|
||||
//static int KillLocalProcess(int appId, int appLocalPid);
|
||||
|
||||
int LncUtil::GetLocalProcessStatusList(LocalProcessStatus List[], unsigned int numEntries, unsigned int* outEntries)
|
||||
{
|
||||
MonoClass* LncUtil_Class = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil");
|
||||
MonoClass* LocalProcessStatusClass = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil/LocalProcessStatus");
|
||||
|
||||
auto Array = Mono::New_Array(LocalProcessStatusClass, numEntries);
|
||||
auto result = Mono::Invoke<int>(Mono::platform_dll, LncUtil_Class, nullptr, "GetLocalProcessStatusList", Array, numEntries, outEntries);
|
||||
|
||||
for (int i = 0; i < *outEntries; i++)
|
||||
{
|
||||
List[i] = mono_array_get(Array, LocalProcessStatus, i);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int LncUtil::GetAppStatusListForShellUIReboot(AppStatusForShellUIReboot outStatusList[], unsigned int numEntries, unsigned int* outEntries)
|
||||
{
|
||||
MonoClass* LncUtil_Class = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil");
|
||||
MonoClass* AppStatusForShellUIRebootClass = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil/AppStatusForShellUIReboot");
|
||||
|
||||
auto Array = Mono::New_Array(AppStatusForShellUIRebootClass, numEntries);
|
||||
auto result = Mono::Invoke<int>(Mono::platform_dll, LncUtil_Class, nullptr, "GetAppStatusListForShellUIReboot", Array, numEntries, outEntries);
|
||||
|
||||
for (int i = 0; i < *outEntries; i++)
|
||||
{
|
||||
outStatusList[i] = mono_array_get(Array, AppStatusForShellUIReboot, i);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int LncUtil::KillLocalProcess(int appId, int appLocalPid)
|
||||
{
|
||||
MonoClass* LncUtil_Class = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil");
|
||||
return Mono::Invoke<int>(Mono::platform_dll, LncUtil_Class, nullptr, "KillLocalProcess", appId, appLocalPid);
|
||||
}
|
||||
|
||||
int LncUtil::ForceKillLocalProcess(int appId, int appLocalPid)
|
||||
{
|
||||
MonoClass* LncUtil_Class = Mono::Get_Class(Mono::platform_dll, "Sce.Vsh.ShellUI.Lnc", "LncUtil");
|
||||
return Mono::Invoke<int>(Mono::platform_dll, LncUtil_Class, nullptr, "ForceKillLocalProcess", appId, appLocalPid);
|
||||
}
|
||||
|
||||
void LncUtil::SystemShutdown(Boot flag)
|
||||
{
|
||||
|
||||
@@ -49,6 +49,28 @@ public:
|
||||
char appType;
|
||||
};
|
||||
|
||||
struct LocalProcessStatus
|
||||
{
|
||||
int appLocalPid;
|
||||
char reserved[32];
|
||||
};
|
||||
|
||||
struct AppStatusForShellUIReboot
|
||||
{
|
||||
int appId;
|
||||
int appType;
|
||||
int appAttr;
|
||||
int launchRequestAppId;
|
||||
int userId;
|
||||
int isActiveCdlg;
|
||||
char path[1024];
|
||||
int isCoredumped;
|
||||
int isPrxModuleLoadFailed;
|
||||
int appLocalPid;
|
||||
int crashReportMode;
|
||||
char category[4];
|
||||
};
|
||||
|
||||
static int GetAppStatus(AppStatus* Status);
|
||||
static int SuspendApp(int appId, Flag flag = Flag_None);
|
||||
static int ResumeApp(int appId, Flag flag = Flag_None);
|
||||
@@ -62,6 +84,9 @@ public:
|
||||
static int KillApp(int appId, int userId = -1);
|
||||
static int ForceKillApp(int appId, int userId = -1);
|
||||
static int KillLocalProcess(int appId, int appLocalPid);
|
||||
static int ForceKillLocalProcess(int appId, int appLocalPid);
|
||||
static int GetLocalProcessStatusList(LocalProcessStatus List[], unsigned int numEntries, unsigned int* outEntries);
|
||||
static int GetAppStatusListForShellUIReboot(AppStatusForShellUIReboot outStatusList[], unsigned int numEntries, unsigned int* outEntries);
|
||||
|
||||
static void SystemShutdown(Boot flag);
|
||||
static void SystemReboot();
|
||||
|
||||
@@ -13,8 +13,11 @@
|
||||
|
||||
#include "NetWrapper.h"
|
||||
|
||||
#include <orbis/SystemService.h>
|
||||
|
||||
std::map<char*, MenuOption*>* Menu::Options;
|
||||
bool Menu::Auto_Load_Settings;
|
||||
int procId = 0;
|
||||
|
||||
void Menu::Init()
|
||||
{
|
||||
@@ -214,6 +217,52 @@ void Menu::Init()
|
||||
NetWrapper::GetMacAddressInfo(SCE_NET_IF_NAME_PHYSICAL),
|
||||
NetWrapper::GetMacAddressInfo(SCE_NET_IF_NAME_WLAN0));
|
||||
});
|
||||
Add_Option("id_orbis_load", []() -> void
|
||||
{
|
||||
int appId = LncUtil::GetAppId("NPXS20000");
|
||||
|
||||
const char* args[] = {
|
||||
"--CUSTOM_ARGS",
|
||||
NULL,
|
||||
};
|
||||
|
||||
procId = sceSystemServiceAddLocalProcess(appId, "/data/Orbis Toolbox/TestLocalProcess.elf", 0, (const char**)&args);
|
||||
|
||||
Notify("Local Process Test: Loaded!\nProcessId: %llX", procId);
|
||||
});
|
||||
Add_Option("id_orbis_unload", []() -> void
|
||||
{
|
||||
int appId = LncUtil::GetAppId("NPXS20000");
|
||||
|
||||
auto result = LncUtil::ForceKillLocalProcess(appId, procId);
|
||||
|
||||
Notify("Local Process Test: Un-Loaded!\nResult: %llx", result);
|
||||
});
|
||||
Add_Option("id_orbis_listproc", []() -> void
|
||||
{
|
||||
ProcInfo Infos[200];
|
||||
auto count = KDriver::GetProcessList(200, (ProcInfo*)&Infos);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
klog("%i %s %s\n", Infos[i].PID, Infos[i].ProcName, Infos[i].TitleID);
|
||||
}
|
||||
});
|
||||
Add_Option("id_orbis_listlocalproc", []() -> void
|
||||
{
|
||||
LocalProcessStatus List[16];
|
||||
unsigned int actualCount = 0;
|
||||
auto result = sceSystemServiceGetLocalProcessStatusList(List, 16, &actualCount);
|
||||
|
||||
klog("result: %llx\nactualCount: %i\n", result, actualCount);
|
||||
|
||||
for (int i = 0; i < actualCount; i++)
|
||||
{
|
||||
klog("appLocalPid: %llX\nTitleId: %s", List[i].appLocalPid, LncUtil::GetAppTitleId(List[i].appLocalPid));
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
void Menu::Term()
|
||||
|
||||
@@ -18,30 +18,6 @@ void Proc::HandleAPI(OrbisNetId Sock, APIPacket* Packet)
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_ATTACH:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_DETACH:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_GET_CURRENT:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_READ:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_WRITE:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_KILL:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_LOAD_ELF:
|
||||
|
||||
break;
|
||||
@@ -49,34 +25,6 @@ void Proc::HandleAPI(OrbisNetId Sock, APIPacket* Packet)
|
||||
case API_PROC_CALL:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_LOAD_SPRX:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_UNLOAD_SPRX:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_UNLOAD_SPRX_NAME:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_RELOAD_SPRX_NAME:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_RELOAD_SPRX_HANDLE:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_DUMP_MODULE:
|
||||
|
||||
break;
|
||||
|
||||
case API_PROC_MODULE_LIST:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Game_Overlay.h"
|
||||
|
||||
int System_Monitor::Thread_Count = 0;
|
||||
int System_Monitor::Busy_Core = 0;
|
||||
float System_Monitor::Usage[8] = { 0 };
|
||||
float System_Monitor::Average_Usage;
|
||||
int System_Monitor::CPU_Temp;
|
||||
@@ -19,6 +20,8 @@ void System_Monitor::calc_usage(unsigned int idle_tid[8], thread_usages* cur, th
|
||||
if (cur->Thread_Count <= 0 || prev->Thread_Count <= 0) //Make sure our banks have threads
|
||||
return;
|
||||
|
||||
float CurrentMax = 0.0f;
|
||||
|
||||
//Calculate the Current time difference from the last bank to the current bank.
|
||||
float Current_Time_Total = ((prev->current_time.tv_sec + (prev->current_time.tv_nsec / 1000000000.0f)) - (cur->current_time.tv_sec + (cur->current_time.tv_nsec / 1000000000.0f)));
|
||||
|
||||
@@ -67,6 +70,12 @@ void System_Monitor::calc_usage(unsigned int idle_tid[8], thread_usages* cur, th
|
||||
|
||||
//Get inverse of idle percentage and express in percent.
|
||||
usage_out[i] = (1.0f - Idle_Usage) * 100.0f;
|
||||
|
||||
if (usage_out[i] > CurrentMax)
|
||||
{
|
||||
CurrentMax = usage_out[i];
|
||||
Busy_Core = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ public:
|
||||
};
|
||||
|
||||
static int Thread_Count;
|
||||
static int Busy_Core;
|
||||
static float Usage[8];
|
||||
static float Average_Usage;
|
||||
static int CPU_Temp;
|
||||
|
||||
@@ -131,7 +131,9 @@ void Target::SendTargetInfo(OrbisNetId Sock)
|
||||
Packet->SOCTemp = System_Monitor::SOC_Temp;
|
||||
Packet->ThreadCount = System_Monitor::Thread_Count;
|
||||
Packet->AverageCPUUsage = System_Monitor::Average_Usage;
|
||||
|
||||
Packet->BusyCore = System_Monitor::Busy_Core;
|
||||
memcpy(&Packet->Ram, &System_Monitor::RAM, sizeof(MemoryInfo));
|
||||
memcpy(&Packet->VRam, &System_Monitor::VRAM, sizeof(MemoryInfo));
|
||||
|
||||
sceNetSend(Sock, Packet, sizeof(TargetInfoPacket), 0);
|
||||
|
||||
@@ -166,4 +168,6 @@ void Target::SetSettings(OrbisNetId Sock)
|
||||
SendStatus(Sock, APIResults::API_OK);
|
||||
|
||||
Config::SetSettingsNow = true;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Get Target Settings.
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
#define ORBIS_TOOLBOX_MAJOR 2
|
||||
#define ORBIS_TOOLBOX_MINOR 0
|
||||
#define ORBIS_TOOLBOX_BUILDVERSION 146
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
#if defined(ORBIS_TOOLBOX_DEBUG)
|
||||
#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Dev Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__)
|
||||
#else
|
||||
#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__)
|
||||
#endif
|
||||
#pragma once
|
||||
#define ORBIS_TOOLBOX_MAJOR 2
|
||||
#define ORBIS_TOOLBOX_MINOR 0
|
||||
#define ORBIS_TOOLBOX_BUILDVERSION 196
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
#if defined(ORBIS_TOOLBOX_DEBUG)
|
||||
#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Dev Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__)
|
||||
#else
|
||||
#define ORBIS_TOOLBOX_BUILDSTRING ("[Orbis Toolbox " stringify(ORBIS_TOOLBOX_MAJOR) "." stringify(ORBIS_TOOLBOX_MINOR) "] Build " stringify(ORBIS_TOOLBOX_BUILDVERSION) " " __DATE__ " " __TIME__)
|
||||
#endif
|
||||
|
||||
@@ -194,6 +194,11 @@
|
||||
<setting_list id="orbis_debug" title="Orbis Suite Debug">
|
||||
|
||||
<button id="id_orbis_test" title="Test" second_title="Runs the current test." />
|
||||
<button id="id_orbis_load" title="Load Local Process" second_title="Loads the local process test elf." />
|
||||
<button id="id_orbis_unload" title="Unload Local Process" second_title="Un-Loads the local process test elf." />
|
||||
<button id="id_orbis_listproc" title="List Processes" second_title="Lists all running processes to the console window." />
|
||||
<button id="id_orbis_listlocalproc" title="List Local Processes" second_title="Lists all running local processes to the console window." />
|
||||
|
||||
<button id="id_orbis_api" title="Restart API" second_title="Restarts the Orbis Suite API." />
|
||||
<toggle_switch id="id_orbis_api_toggle" title="Toggle API" second_title="Toggle the API state." />
|
||||
|
||||
|
||||
@@ -8,31 +8,22 @@ namespace OrbisSuite.Common
|
||||
|
||||
/* ####### Proc functions ####### */
|
||||
PROC_START,
|
||||
API_PROC_GET_LIST,
|
||||
API_PROC_ATTACH,
|
||||
API_PROC_DETACH,
|
||||
API_PROC_GET_CURRENT,
|
||||
API_PROC_READ,
|
||||
API_PROC_WRITE,
|
||||
API_PROC_KILL,
|
||||
API_PROC_LOAD_ELF,
|
||||
API_PROC_CALL,
|
||||
|
||||
/* Remote Library functions */
|
||||
API_PROC_LOAD_SPRX,
|
||||
API_PROC_UNLOAD_SPRX,
|
||||
API_PROC_UNLOAD_SPRX_NAME,
|
||||
API_PROC_RELOAD_SPRX_NAME,
|
||||
API_PROC_RELOAD_SPRX_HANDLE,
|
||||
API_PROC_DUMP_MODULE,
|
||||
API_PROC_MODULE_LIST,
|
||||
API_PROC_GET_LIST,
|
||||
API_PROC_LOAD_ELF,
|
||||
API_PROC_CALL, /* RPC Call. */
|
||||
|
||||
PROC_END,
|
||||
/* ############################## */
|
||||
|
||||
/* ##### Debugger functions ##### */
|
||||
DBG_START,
|
||||
API_DBG_START, /* Debugger attach to target */
|
||||
API_DBG_STOP, /* Debugger detach from target */
|
||||
API_DBG_ATTACH, /* Debugger attach to target */
|
||||
API_DBG_DETACH, /* Debugger detach from target */
|
||||
API_DBG_GET_CURRENT,
|
||||
API_DBG_READ,
|
||||
API_DBG_WRITE,
|
||||
API_DBG_KILL,
|
||||
API_DBG_BREAK,
|
||||
API_DBG_RESUME,
|
||||
API_DBG_SIGNAL,
|
||||
@@ -47,6 +38,12 @@ namespace OrbisSuite.Common
|
||||
API_DBG_GET_DBGREG,
|
||||
API_DBG_SET_DBGREG,
|
||||
|
||||
/* Remote Library functions */
|
||||
API_DBG_LOAD_SPRX,
|
||||
API_DBG_UNLOAD_SPRX,
|
||||
API_DBG_RELOAD_SPRX,
|
||||
API_DBG_MODULE_LIST,
|
||||
|
||||
/* Thread Management */
|
||||
API_DBG_THREAD_LIST,
|
||||
API_DBG_THREAD_STOP,
|
||||
@@ -164,6 +161,15 @@ namespace OrbisSuite.Common
|
||||
Blue_Blinking,
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi), Serializable]
|
||||
public struct MemoryInfo
|
||||
{
|
||||
public int Used;
|
||||
public int Free;
|
||||
public int Total;
|
||||
public float Percentage;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi, Size = 260), Serializable]
|
||||
public struct TargetInfoPacket
|
||||
{
|
||||
@@ -201,6 +207,9 @@ namespace OrbisSuite.Common
|
||||
public int SOCTemp;
|
||||
public int ThreadCount;
|
||||
public float AverageCPUUsage;
|
||||
public int BusyCore;
|
||||
public MemoryInfo Ram;
|
||||
public MemoryInfo VRam;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Ansi)]
|
||||
|
||||
@@ -109,10 +109,14 @@ namespace OrbisSuite.Common.Database
|
||||
Target.HDDFreeSpace = (long)Packet.FreeSpace;
|
||||
Target.HDDTotalSpace = (long)Packet.TotalSpace;
|
||||
|
||||
// Perf Stats.
|
||||
Target.CPUTemp = Packet.CPUTemp;
|
||||
Target.SOCTemp = Packet.SOCTemp;
|
||||
Target.ThreadCount = Packet.ThreadCount;
|
||||
Target.AverageCPUUsage = Packet.AverageCPUUsage;
|
||||
Target.BusyCore = Packet.BusyCore;
|
||||
Target.RamUsage = Packet.Ram.Used;
|
||||
Target.VRamUsage = Packet.VRam.Used;
|
||||
|
||||
return Target.Save();
|
||||
}
|
||||
|
||||
@@ -246,6 +246,21 @@ namespace OrbisSuite.Common.Database
|
||||
/// </summary>
|
||||
public float AverageCPUUsage { get; set; } = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The current core that is the most busy.
|
||||
/// </summary>
|
||||
public int BusyCore { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The current system ram usage.
|
||||
/// </summary>
|
||||
public int RamUsage { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The current video ram usage.
|
||||
/// </summary>
|
||||
public int VRamUsage { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Shows the Title number of the games on the home screen of this target.
|
||||
/// </summary>
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
Margin="0 0 10 0"/>
|
||||
|
||||
<simpleControls:SimpleTextField FieldName="Top Core"
|
||||
FieldText="-"
|
||||
FieldText="{Binding ElementName=DashboardElement, Path=TopCore}"
|
||||
Width="73.5"
|
||||
Height="35"/>
|
||||
</StackPanel>
|
||||
@@ -345,13 +345,13 @@
|
||||
<StackPanel Margin="0 5 0 0" Orientation="Horizontal">
|
||||
|
||||
<simpleControls:SimpleTextField FieldName="Ram Usage"
|
||||
FieldText="- MB"
|
||||
FieldText="{Binding ElementName=DashboardElement, Path=RamUsage}"
|
||||
Width="73.5"
|
||||
Height="35"
|
||||
Margin="0 0 10 0"/>
|
||||
|
||||
<simpleControls:SimpleTextField FieldName="V-Ram Usage"
|
||||
FieldText="- MB"
|
||||
FieldText="{Binding ElementName=DashboardElement, Path=VRamUsage}"
|
||||
Width="73.5"
|
||||
Height="35"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -220,6 +220,9 @@ namespace OrbisNeighborHood.MVVM.View
|
||||
SOCTemp = $"{CurrentTarget.SOCTemp} °C";
|
||||
ThreadCount = CurrentTarget.ThreadCount;
|
||||
AverageCPUUsage = CurrentTarget.AverageCPUUsage;
|
||||
TopCore = $"Core {CurrentTarget.BusyCore}";
|
||||
RamUsage = $"{CurrentTarget.RamUsage} MB";
|
||||
VRamUsage = $"{CurrentTarget.VRamUsage} MB";
|
||||
|
||||
if (CurrentTarget.CurrentTitleID == null || !Regex.IsMatch(CurrentTarget.CurrentTitleID, @"CUSA\d{5}"))
|
||||
{
|
||||
@@ -352,6 +355,33 @@ namespace OrbisNeighborHood.MVVM.View
|
||||
public static readonly DependencyProperty AverageCPUUsageProperty =
|
||||
DependencyProperty.Register("AverageCPUUsage", typeof(float), typeof(DashboardView), new PropertyMetadata(0.0f));
|
||||
|
||||
public string TopCore
|
||||
{
|
||||
get { return (string)GetValue(TopCoreProperty); }
|
||||
set { SetValue(TopCoreProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TopCoreProperty =
|
||||
DependencyProperty.Register("TopCore", typeof(string), typeof(DashboardView), new PropertyMetadata("-"));
|
||||
|
||||
public string RamUsage
|
||||
{
|
||||
get { return (string)GetValue(RamUsageProperty); }
|
||||
set { SetValue(RamUsageProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RamUsageProperty =
|
||||
DependencyProperty.Register("RamUsage", typeof(string), typeof(DashboardView), new PropertyMetadata("-"));
|
||||
|
||||
public string VRamUsage
|
||||
{
|
||||
get { return (string)GetValue(VRamUsageProperty); }
|
||||
set { SetValue(VRamUsageProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty VRamUsageProperty =
|
||||
DependencyProperty.Register("VRamUsage", typeof(string), typeof(DashboardView), new PropertyMetadata("-"));
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1 +1 @@
|
||||
1321
|
||||
1326
|
||||
|
||||
@@ -1 +1 @@
|
||||
Version 3.0.1321 Debug Build Thursday July 07 2022 8:18 PM
|
||||
Version 3.0.1326 Debug Build Friday July 08 2022 1:58 PM
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace OrbisSuiteService.Service
|
||||
Target.SOCTemp = 0;
|
||||
Target.ThreadCount = 0;
|
||||
Target.AverageCPUUsage = 0;
|
||||
Target.BusyCore = 0;
|
||||
Target.RamUsage = 0;
|
||||
Target.VRamUsage = 0;
|
||||
Target.CurrentTitleID = "-";
|
||||
Target.Save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user