mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-03 23:30:02 +01:00
[orbis-kernel] store sdk version to the context
This commit is contained in:
parent
a847e739fc
commit
dc44b619b2
|
|
@ -159,6 +159,7 @@ public:
|
|||
Ref<RcBase> dmemDevice;
|
||||
Ref<RcBase> blockpoolDevice;
|
||||
AudioOut *audioOut = nullptr;
|
||||
uint sdkVersion{};
|
||||
|
||||
private:
|
||||
mutable pthread_mutex_t m_heap_mtx;
|
||||
|
|
|
|||
|
|
@ -372,17 +372,8 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
|
|||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
auto processParam =
|
||||
reinterpret_cast<std::byte *>(thread->tproc->processParam);
|
||||
|
||||
auto sdkVersion = processParam //
|
||||
+ sizeof(uint64_t) // size
|
||||
+ sizeof(uint32_t) // magic
|
||||
+ sizeof(uint32_t); // entryCount
|
||||
|
||||
std::printf("Reporting SDK version %x\n",
|
||||
*reinterpret_cast<uint32_t *>(sdkVersion));
|
||||
*(uint32_t *)old = *reinterpret_cast<uint32_t *>(sdkVersion);
|
||||
std::printf("Reporting SDK version %x\n", g_context.sdkVersion);
|
||||
*(uint32_t *)old = g_context.sdkVersion;
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -417,6 +417,18 @@ int ps4Exec(orbis::Thread *mainThread,
|
|||
std::uint64_t interpBase = 0;
|
||||
std::uint64_t entryPoint = executableModule->entryPoint;
|
||||
|
||||
if (orbis::g_context.sdkVersion == 0 && mainThread->tproc->processParam) {
|
||||
auto processParam =
|
||||
reinterpret_cast<std::byte *>(mainThread->tproc->processParam);
|
||||
|
||||
auto sdkVersion = processParam //
|
||||
+ sizeof(uint64_t) // size
|
||||
+ sizeof(uint32_t) // magic
|
||||
+ sizeof(uint32_t); // entryCount
|
||||
|
||||
orbis::g_context.sdkVersion = *(uint32_t *)sdkVersion;
|
||||
}
|
||||
|
||||
if (executableModule->type != rx::linker::kElfTypeExec) {
|
||||
auto libSceLibcInternal = rx::linker::loadModuleFile(
|
||||
"/system/common/lib/libSceLibcInternal.sprx", mainThread);
|
||||
|
|
|
|||
Loading…
Reference in a new issue