Browse Source
Added a small shim library to allow access to the PS4 kernel's dynamic library functions, which are used to dynamically linking and unlink against the native engine library. I'm not sure if there isn't an easier way to do this, but this works for now.
console
Added a small shim library to allow access to the PS4 kernel's dynamic library functions, which are used to dynamically linking and unlink against the native engine library. I'm not sure if there isn't an easier way to do this, but this works for now.
console
8 changed files with 275 additions and 10 deletions
-
2.gitignore
-
BINAssets/Plugins/orbis/SceKernelShim.prx
-
77Assets/Plugins/orbis/SceKernelShim.prx.meta
-
28Assets/Scripts/SystemLibrary.cs
-
31engine/SceKernelShim/SceKernelShim.sln
-
106engine/SceKernelShim/SceKernelShim.vcxproj
-
18engine/SceKernelShim/SceKernelShim.vcxproj.filters
-
23engine/SceKernelShim/prx.cpp
@ -0,0 +1,77 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 1979846846ce98c448853c7141a0171e |
|||
PluginImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
iconMap: {} |
|||
executionOrder: {} |
|||
defineConstraints: [] |
|||
isPreloaded: 0 |
|||
isOverridable: 0 |
|||
isExplicitlyReferenced: 0 |
|||
validateReferences: 1 |
|||
platformData: |
|||
- first: |
|||
: Any |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
Exclude Editor: 1 |
|||
Exclude GameCoreScarlett: 1 |
|||
Exclude GameCoreXboxOne: 1 |
|||
Exclude Linux64: 1 |
|||
Exclude OSXUniversal: 1 |
|||
Exclude PS4: 0 |
|||
Exclude PS5: 1 |
|||
Exclude Win: 1 |
|||
Exclude Win64: 1 |
|||
- first: |
|||
Any: |
|||
second: |
|||
enabled: 0 |
|||
settings: {} |
|||
- first: |
|||
Editor: Editor |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
CPU: AnyCPU |
|||
DefaultValueInitialized: true |
|||
OS: AnyOS |
|||
- first: |
|||
PS4: PS4 |
|||
second: |
|||
enabled: 1 |
|||
settings: {} |
|||
- first: |
|||
PS5: PS5 |
|||
second: |
|||
enabled: 0 |
|||
settings: {} |
|||
- first: |
|||
Standalone: Linux64 |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
CPU: None |
|||
- first: |
|||
Standalone: OSXUniversal |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
CPU: None |
|||
- first: |
|||
Standalone: Win |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
CPU: x86 |
|||
- first: |
|||
Standalone: Win64 |
|||
second: |
|||
enabled: 0 |
|||
settings: |
|||
CPU: x86_64 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,31 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio 15 |
|||
VisualStudioVersion = 15.0.28307.1433 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SceKernelShim", "SceKernelShim.vcxproj", "{4587A77D-1FD8-4A92-9D11-26545047C1D1}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|ORBIS = Debug|ORBIS |
|||
Debug|Prospero = Debug|Prospero |
|||
Release|ORBIS = Release|ORBIS |
|||
Release|Prospero = Release|Prospero |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Debug|ORBIS.ActiveCfg = Debug|ORBIS |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Debug|ORBIS.Build.0 = Debug|ORBIS |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Debug|Prospero.ActiveCfg = Debug|Prospero |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Debug|Prospero.Build.0 = Debug|Prospero |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Release|ORBIS.ActiveCfg = Release|ORBIS |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Release|ORBIS.Build.0 = Release|ORBIS |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Release|Prospero.ActiveCfg = Release|Prospero |
|||
{4587A77D-1FD8-4A92-9D11-26545047C1D1}.Release|Prospero.Build.0 = Release|Prospero |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {5883AE2B-631A-4510-AF53-C0EB35922AA2} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,106 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|ORBIS"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>ORBIS</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|Prospero"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Prospero</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|ORBIS"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>ORBIS</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Prospero"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Prospero</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>{4587A77D-1FD8-4A92-9D11-26545047C1D1}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Prospero'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Prospero'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<PlatformToolset>v141</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<PlatformToolset>v141</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<PropertyGroup Condition="'$(DebuggerFlavor)'=='ORBISDebugger'" Label="OverrideDebuggerDefaults"> |
|||
<!--LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand--> |
|||
<!--LocalDebuggerCommandArguments></LocalDebuggerCommandArguments--> |
|||
<!--LocalDebuggerTarget></LocalDebuggerTarget--> |
|||
<!--LocalDebuggerWorkingDirectory>$(ProjectDir)</LocalDebuggerWorkingDirectory--> |
|||
<!--LocalRunCommandLine></LocalRunCommandLine--> |
|||
</PropertyGroup> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
<Import Condition="Exists('$(VCTargetsPath)\BuildCustomizations\OrbisWavePsslc.props')" Project="$(VCTargetsPath)\BuildCustomizations\OrbisWavePsslc.props" /> |
|||
<Import Condition="Exists('$(VCTargetsPath)\BuildCustomizations\SCU.props')" Project="$(VCTargetsPath)\BuildCustomizations\SCU.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Prospero'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Prospero'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup /> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'"> |
|||
<ClCompile> |
|||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);</PreprocessorDefinitions> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Prospero'"> |
|||
<ClCompile> |
|||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);</PreprocessorDefinitions> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'"> |
|||
<ClCompile> |
|||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);</PreprocessorDefinitions> |
|||
<OptimizationLevel>Level2</OptimizationLevel> |
|||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Prospero'"> |
|||
<ClCompile> |
|||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);</PreprocessorDefinitions> |
|||
<OptimizationLevel>Level2</OptimizationLevel> |
|||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="prx.cpp" /> |
|||
</ItemGroup> |
|||
<Import Condition="'$(ConfigurationType)' == 'Makefile' and Exists('$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets')" Project="$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets" /> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
<Import Condition="Exists('$(VCTargetsPath)\BuildCustomizations\OrbisWavePsslc.targets')" Project="$(VCTargetsPath)\BuildCustomizations\OrbisWavePsslc.targets" /> |
|||
<Import Condition="Exists('$(VCTargetsPath)\BuildCustomizations\SCU.targets')" Project="$(VCTargetsPath)\BuildCustomizations\SCU.targets" /> |
|||
</ImportGroup> |
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="Source Files"> |
|||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cxx;cc;s;asm</Extensions> |
|||
</Filter> |
|||
<Filter Include="Header Files"> |
|||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
|||
<Extensions>h;hpp</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="prx.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,23 @@ |
|||
#include <kernel.h>
|
|||
|
|||
#define PRX_EXPORT extern "C" __declspec (dllexport)
|
|||
|
|||
PRX_EXPORT SceKernelModule LoadLibrary(const char *filename) |
|||
{ |
|||
return sceKernelLoadStartModule(filename, 0, nullptr, 0, nullptr, nullptr); |
|||
} |
|||
|
|||
PRX_EXPORT bool FreeLibrary(SceKernelModule moduleHandle) |
|||
{ |
|||
return sceKernelStopUnloadModule(moduleHandle, 0, nullptr, 0, nullptr, nullptr) == 0; |
|||
} |
|||
|
|||
PRX_EXPORT void *GetProcAddress(SceKernelModule moduleHandle, const char *procedureName) |
|||
{ |
|||
void *result; |
|||
if (sceKernelDlsym(moduleHandle, procedureName, &result) != 0) |
|||
{ |
|||
return nullptr; |
|||
} |
|||
return result; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue