[rpcsx-os] add --system flag

This commit is contained in:
DH 2023-10-30 22:08:18 +03:00
parent 9865be85af
commit 563c5eaa2e
3 changed files with 10 additions and 1 deletions

View file

@ -56,6 +56,7 @@ struct Process final {
std::uint64_t nextTlsSlot = 1;
std::uint64_t lastTlsOffset = 0;
bool isSystem = false;
utils::RcIdMap<EventFlag, sint, 4097, 1> evfMap;
utils::RcIdMap<Semaphore, sint, 4097, 1> semMap;

View file

@ -139,7 +139,7 @@ orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
// std::printf(" kern.14.35.%u\n", name[3]);
app_info result{
.appType = 0,
// .unk5 = slong(0x80000000'00000000),
.unk5 = (thread->tproc->isSystem ? slong(0x80000000'00000000) : 0),
};
return uwrite((ptr<app_info>)old, result);

View file

@ -561,6 +561,7 @@ int main(int argc, const char *argv[]) {
bool enableAudio = false;
bool asRoot = false;
bool isSystem = false;
int argIndex = 1;
while (argIndex < argc) {
@ -596,6 +597,12 @@ int main(int argc, const char *argv[]) {
continue;
}
if (argv[argIndex] == std::string_view("--system")) {
argIndex++;
isSystem = true;
continue;
}
if (argv[argIndex] == std::string_view("--override") ||
argv[argIndex] == std::string_view("-o")) {
if (argc <= argIndex + 2) {
@ -704,6 +711,7 @@ int main(int argc, const char *argv[]) {
initProcess->onSysEnter = onSysEnter;
initProcess->onSysExit = onSysExit;
initProcess->ops = &rx::procOpsTable;
initProcess->isSystem = isSystem;
auto [baseId, mainThread] = initProcess->threadsMap.emplace();
mainThread->tproc = initProcess;