[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
@@ -0,0 +1,106 @@
// Copyright (C) 2026 SharpEmu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
using SharpEmu.HLE;
using System.Threading;
namespace SharpEmu.Libs.CommonDialog;
/// <summary>
/// libSceErrorDialog. There is no host error dialog, so an opened dialog
/// immediately reports finished — this keeps guests that block on the dialog
/// status (a common fatal-error path) from spinning forever.
/// </summary>
public static class ErrorDialogExports
{
private const int AlreadyInitialized = unchecked((int)0x80ED0001);
private const int NotInitialized = unchecked((int)0x80ED0002);
private const int ArgNull = unchecked((int)0x80ED0005);
private const int StatusNone = 0;
private const int StatusInitialized = 1;
private const int StatusFinished = 3;
private static int _initialized;
private static int _status;
[SysAbiExport(
Nid = "I88KChlynSs",
ExportName = "sceErrorDialogInitialize",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogInitialize(CpuContext ctx)
{
var result = Interlocked.Exchange(ref _initialized, 1) == 0 ? 0 : AlreadyInitialized;
if (result == 0)
{
Volatile.Write(ref _status, StatusInitialized);
}
return SetReturn(ctx, result);
}
[SysAbiExport(
Nid = "M2ZF-ClLhgY",
ExportName = "sceErrorDialogOpen",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogOpen(CpuContext ctx)
{
if (ctx[CpuRegister.Rdi] == 0)
{
return SetReturn(ctx, ArgNull);
}
if (Volatile.Read(ref _initialized) == 0)
{
return SetReturn(ctx, NotInitialized);
}
Volatile.Write(ref _status, StatusFinished);
return SetReturn(ctx, 0);
}
[SysAbiExport(
Nid = "t2FvHRXzgqk",
ExportName = "sceErrorDialogGetStatus",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogGetStatus(CpuContext ctx) => SetReturn(ctx, Volatile.Read(ref _status));
[SysAbiExport(
Nid = "WWiGuh9XfgQ",
ExportName = "sceErrorDialogUpdateStatus",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogUpdateStatus(CpuContext ctx) => SetReturn(ctx, Volatile.Read(ref _status));
[SysAbiExport(
Nid = "ekXHb1kDBl0",
ExportName = "sceErrorDialogClose",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogClose(CpuContext ctx)
{
Volatile.Write(ref _status, StatusFinished);
return SetReturn(ctx, 0);
}
[SysAbiExport(
Nid = "9XAxK2PMwk8",
ExportName = "sceErrorDialogTerminate",
Target = Generation.Gen4 | Generation.Gen5,
LibraryName = "libSceErrorDialog")]
public static int ErrorDialogTerminate(CpuContext ctx)
{
Volatile.Write(ref _status, StatusNone);
Interlocked.Exchange(ref _initialized, 0);
return SetReturn(ctx, 0);
}
private static int SetReturn(CpuContext ctx, int result)
{
ctx[CpuRegister.Rax] = unchecked((ulong)result);
return result;
}
}