diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 68dc4a2777..66fe2fd94c 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1304,6 +1304,11 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load module->nm.nsegment = reader.GetNumSegments(); module->nm.attribute = modinfo->moduleAttrs; + if ((module->nm.attribute & PSP_MODULE_VSH_MODE) != 0) { + // Used by the PSP's Visual Shell (VSH/XMB) and modules it loads, such as vshmain.prx. + // We don't do anything special with this yet, just recognizing it for now. + INFO_LOG(Log::sceModule, "VSH mode module detected: %s", modinfo->name); + } module->nm.version[0] = modinfo->moduleVersion & 0xFF; module->nm.version[1] = modinfo->moduleVersion >> 8; module->nm.data_size = 0; diff --git a/Core/HLE/sceKernelModule.h b/Core/HLE/sceKernelModule.h index 39274e0a59..461c7d4c99 100644 --- a/Core/HLE/sceKernelModule.h +++ b/Core/HLE/sceKernelModule.h @@ -28,8 +28,15 @@ class PointerWrap; struct SceKernelSMOption; +// Known bits of PspModuleInfo::moduleAttrs. +enum { + PSP_MODULE_USER_MODE = 0x0000, + PSP_MODULE_VSH_MODE = 0x0800, + PSP_MODULE_KERNEL_MODE = 0x1000, +}; + struct PspModuleInfo { - u16_le moduleAttrs; //0x0000 User Mode, 0x1000 Kernel Mode + u16_le moduleAttrs; //0x0000 User Mode, 0x0800 VSH Mode, 0x1000 Kernel Mode u16_le moduleVersion; // 28 bytes of module name, packed with 0's. char name[28];