[AGC/Vulkan] Extend PS5 runtime and rendering compatibility (#216)

* [Core] Add POSIX native execution and PS5 SELF support

Extend the native backend, guest TLS, fixed-address memory, and loader paths needed by PS5 titles on Windows, Linux, and macOS. Keep workstation GC so high-core-count hosts do not reserve over fixed guest image bases.

* [HLE] Expand PS5 service and media compatibility

Add the kernel, threading, save-data, networking, audio, video-codec, font, dialog, and service exports required by newer PS5 software. Preserve every SysAbi NID currently registered by main while adding the compatibility surface used by ASTRO BOT.

* [AGC/Vulkan] Extend Gen5 shader and presentation support

Expand PM4 handling, Gen5 shader translation, MRT and packed export support, guest image tracking, depth initialization, texture aliasing, and Vulkan presentation. Add the performance overlay and address-filtered diagnostics used to validate ASTRO BOT with original shaders.

* [Core] Align static TLS reservation across hosts

* [Pad] Align primary user ID with UserService

* [Gpu] Preserve runtime scalar buffers across renderer seam

* [AGC] Restore omitted command helper exports

* [Vulkan] Reuse primary views for promoted MRT targets

* [Vulkan] Preserve scratch storage bindings in compute dispatches
This commit is contained in:
Miguel Cruz
2026-07-15 19:02:34 -04:00
committed by GitHub
parent ad5a7d3799
commit 864cbb0fa0
85 changed files with 36299 additions and 9176 deletions
@@ -13,6 +13,7 @@ public static class SystemServiceExports
private const int OrbisSystemServiceErrorParameter = unchecked((int)0x80A10003);
private const int SystemServiceStatusSize = 0x0C;
private const int DisplaySafeAreaInfoSize = sizeof(float) + 128;
private const int HdrToneMapLuminanceSize = sizeof(float) * 3;
[SysAbiExport(
Nid = "fZo48un7LK4",
@@ -42,6 +43,35 @@ public static class SystemServiceExports
: ctx.SetReturn((int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
}
[SysAbiExport(
Nid = "SsC-m-S9JTA",
ExportName = "sceSystemServiceParamGetString",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceSystemService")]
public static int SystemServiceParamGetString(CpuContext ctx)
{
_ = unchecked((int)ctx[CpuRegister.Rdi]); // parameter id (nickname, etc.)
var bufferAddress = ctx[CpuRegister.Rsi];
var bufferSize = unchecked((int)ctx[CpuRegister.Rdx]);
if (bufferAddress == 0 || bufferSize <= 0)
{
return ctx.SetReturn(OrbisSystemServiceErrorParameter);
}
// String params are typically the user nickname. Callers that gate UI
// or text setup on a successful read (and skip it on failure) stall on
// a black screen when this returns NOT_FOUND, so return a neutral
// non-empty default and success.
var value = System.Text.Encoding.UTF8.GetBytes("SharpEmu");
var writeLength = Math.Min(value.Length, bufferSize - 1);
Span<byte> output = stackalloc byte[writeLength + 1];
value.AsSpan(0, writeLength).CopyTo(output);
output[writeLength] = 0;
return ctx.Memory.TryWrite(bufferAddress, output)
? ctx.SetReturn(0)
: ctx.SetReturn((int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
}
[SysAbiExport(
Nid = "rPo6tV8D9bM",
ExportName = "sceSystemServiceGetStatus",
@@ -87,6 +117,28 @@ public static class SystemServiceExports
: ctx.SetReturn((int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
}
[SysAbiExport(
Nid = "mPpPxv5CZt4",
ExportName = "sceSystemServiceGetHdrToneMapLuminance",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceSystemService")]
public static int SystemServiceGetHdrToneMapLuminance(CpuContext ctx)
{
var luminanceAddress = ctx[CpuRegister.Rdi];
if (luminanceAddress == 0)
{
return ctx.SetReturn(OrbisSystemServiceErrorParameter);
}
Span<byte> luminance = stackalloc byte[HdrToneMapLuminanceSize];
BinaryPrimitives.WriteSingleLittleEndian(luminance, 1000.0f);
BinaryPrimitives.WriteSingleLittleEndian(luminance[sizeof(float)..], 1000.0f);
BinaryPrimitives.WriteSingleLittleEndian(luminance[(sizeof(float) * 2)..], 0.01f);
return ctx.Memory.TryWrite(luminanceAddress, luminance)
? ctx.SetReturn(0)
: ctx.SetReturn((int)OrbisGen2Result.ORBIS_GEN2_ERROR_MEMORY_FAULT);
}
[SysAbiExport(
Nid = "Vo5V8KAwCmk",
ExportName = "sceSystemServiceHideSplashScreen",