mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
sys_process_get_sdk_version rough implementation
This commit is contained in:
parent
18e1799980
commit
b09412a79a
4 changed files with 52 additions and 4 deletions
|
@ -10,10 +10,16 @@ SysCallBase sc_p("Process");
|
||||||
|
|
||||||
sysProcessObjects_t procObjects;
|
sysProcessObjects_t procObjects;
|
||||||
|
|
||||||
|
s32 process_getpid()
|
||||||
|
{
|
||||||
|
// TODO: get current process id
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
s32 sys_process_getpid()
|
s32 sys_process_getpid()
|
||||||
{
|
{
|
||||||
sc_p.Log("sys_process_getpid() -> 1");
|
sc_p.Log("sys_process_getpid() -> 1");
|
||||||
return 1;
|
return process_getpid();
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 sys_process_getppid()
|
s32 sys_process_getppid()
|
||||||
|
@ -228,12 +234,29 @@ s32 sys_process_get_paramsfo(mem8_ptr_t buffer)
|
||||||
return CELL_OK;*/
|
return CELL_OK;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s32 process_get_sdk_version(u32 pid, s32& ver)
|
||||||
|
{
|
||||||
|
// TODO: get correct SDK version for selected pid
|
||||||
|
ver = Emu.m_sdk_version;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
s32 sys_process_get_sdk_version(u32 pid, mem32_t version)
|
s32 sys_process_get_sdk_version(u32 pid, mem32_t version)
|
||||||
{
|
{
|
||||||
sc_p.Warning("sys_process_get_sdk_version(pid=%d, version_addr=0x%x)", pid, version.GetAddr());
|
sc_p.Warning("sys_process_get_sdk_version(pid=%d, version_addr=0x%x)", pid, version.GetAddr());
|
||||||
|
|
||||||
version = 0x360001; // TODO
|
s32 sdk_ver;
|
||||||
return CELL_OK;
|
s32 ret = process_get_sdk_version(pid, sdk_ver);
|
||||||
|
if (ret != CELL_OK)
|
||||||
|
{
|
||||||
|
return ret; // error code
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
version = sdk_ver;
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 sys_process_kill(u32 pid)
|
s32 sys_process_kill(u32 pid)
|
||||||
|
|
|
@ -51,6 +51,10 @@ struct sysProcessObjects_t
|
||||||
// Extern
|
// Extern
|
||||||
extern sysProcessObjects_t procObjects;
|
extern sysProcessObjects_t procObjects;
|
||||||
|
|
||||||
|
// Auxiliary functions
|
||||||
|
s32 process_getpid();
|
||||||
|
s32 process_get_sdk_version(u32 pid, s32& ver);
|
||||||
|
|
||||||
// SysCalls
|
// SysCalls
|
||||||
s32 sys_process_getpid();
|
s32 sys_process_getpid();
|
||||||
s32 sys_process_getppid();
|
s32 sys_process_getppid();
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include "Emu/CPU/CPUThreadManager.h" //gui dependency
|
#include "Emu/CPU/CPUThreadManager.h" //gui dependency
|
||||||
|
|
||||||
#include "../Loader/PSF.h"
|
#include "Loader/PSF.h"
|
||||||
|
|
||||||
#include "../Crypto/unself.h"
|
#include "../Crypto/unself.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
@ -270,6 +270,26 @@ void Emulator::Load()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setting default values
|
||||||
|
Emu.m_sdk_version = -1; // possibly "unknown" value
|
||||||
|
|
||||||
|
// trying to load some info from PARAM.SFO
|
||||||
|
vfsFile f2("/app_home/PARAM.SFO");
|
||||||
|
if (f2.IsOpened())
|
||||||
|
{
|
||||||
|
PSFLoader psf(f2);
|
||||||
|
if (psf.Load(false))
|
||||||
|
{
|
||||||
|
std::string version = psf.GetString("PS3_SYSTEM_VER");
|
||||||
|
|
||||||
|
const size_t dot = version.find('.');
|
||||||
|
if (dot != std::string::npos)
|
||||||
|
{
|
||||||
|
Emu.m_sdk_version = (std::stoi(version, nullptr, 16) << 20) | ((std::stoi(version.substr(dot + 1), nullptr, 16) & 0xffff) << 4) | 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LoadPoints(BreakPointsDBName);
|
LoadPoints(BreakPointsDBName);
|
||||||
|
|
||||||
CPUThread& thread = GetCPU().AddThread(thread_type);
|
CPUThread& thread = GetCPU().AddThread(thread_type);
|
||||||
|
|
|
@ -106,6 +106,7 @@ public:
|
||||||
std::string m_path;
|
std::string m_path;
|
||||||
std::string m_elf_path;
|
std::string m_elf_path;
|
||||||
std::string m_title_id;
|
std::string m_title_id;
|
||||||
|
s32 m_sdk_version;
|
||||||
|
|
||||||
Emulator();
|
Emulator();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue