rpcsx-os: fix sdk version fetching

This commit is contained in:
DH 2024-09-02 20:32:27 +03:00
parent b2e180e533
commit 84d2add72d
3 changed files with 9 additions and 4 deletions

View file

@ -69,7 +69,7 @@ struct Process final {
EventEmitter event;
std::optional<sint> exitStatus;
std::uint32_t sdkVersion = -1;
std::uint32_t sdkVersion = 0;
std::uint64_t nextTlsSlot = 1;
std::uint64_t lastTlsOffset = 0;

View file

@ -206,8 +206,13 @@ SysResult kern_sysctl(Thread *thread, ptr<sint> name, uint namelen,
return ErrorCode::INVAL;
}
ORBIS_RET_ON_ERROR(uwrite(ptr<uint32_t>(old), process->sdkVersion));
ORBIS_LOG_ERROR("get sdk version by pid", name[3], process->sdkVersion);
auto sdkVersion = process->sdkVersion;
if (sdkVersion == 0) {
sdkVersion = g_context.fwSdkVersion;
}
ORBIS_RET_ON_ERROR(uwrite(ptr<uint32_t>(old), sdkVersion));
ORBIS_LOG_ERROR("get sdk version by pid", name[3], sdkVersion);
return uwrite(oldlenp, sizeof(uint32_t));
}

View file

@ -564,7 +564,7 @@ ExecEnv ps4CreateExecEnv(orbis::Thread *mainThread,
std::uint64_t entryPoint = executableModule->entryPoint;
if (mainThread->tproc->processParam != nullptr &&
mainThread->tproc->processParamSize <= sizeof(Ps4ProcessParam)) {
mainThread->tproc->processParamSize >= sizeof(Ps4ProcessParam)) {
auto processParam =
reinterpret_cast<std::byte *>(mainThread->tproc->processParam);