mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-26 12:48:39 +08:00
864cbb0fa0
* [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
92 lines
3.0 KiB
C#
92 lines
3.0 KiB
C#
// Copyright (C) 2026 SharpEmu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
using SharpEmu.Core.Memory;
|
|
|
|
namespace SharpEmu.Core.Loader;
|
|
|
|
public sealed class SelfImage
|
|
{
|
|
private readonly ulong _imageBase;
|
|
|
|
public SelfImage(
|
|
bool isSelf,
|
|
ElfHeader elfHeader,
|
|
IReadOnlyList<ProgramHeader> programHeaders,
|
|
IReadOnlyList<VirtualMemoryRegion> mappedRegions,
|
|
IReadOnlyDictionary<ulong, string>? importStubs = null,
|
|
IReadOnlyDictionary<string, ulong>? runtimeSymbols = null,
|
|
IReadOnlyList<ImportedSymbolRelocation>? importedRelocations = null,
|
|
IReadOnlyList<ulong>? preInitializerFunctions = null,
|
|
IReadOnlyList<ulong>? initializerFunctions = null,
|
|
ulong initFunctionEntryPoint = 0,
|
|
ulong imageBase = 0,
|
|
ulong procParamAddress = 0,
|
|
string? title = null,
|
|
string? titleId = null,
|
|
string? version = null,
|
|
uint tlsModuleId = 0,
|
|
ulong tlsMemorySize = 0,
|
|
ulong tlsStaticOffset = 0)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(programHeaders);
|
|
ArgumentNullException.ThrowIfNull(mappedRegions);
|
|
|
|
IsSelf = isSelf;
|
|
ElfHeader = elfHeader;
|
|
ProgramHeaders = programHeaders;
|
|
MappedRegions = mappedRegions;
|
|
ImportStubs = importStubs ?? new Dictionary<ulong, string>();
|
|
RuntimeSymbols = runtimeSymbols ?? new Dictionary<string, ulong>(StringComparer.Ordinal);
|
|
ImportedRelocations = importedRelocations ?? Array.Empty<ImportedSymbolRelocation>();
|
|
PreInitializerFunctions = preInitializerFunctions ?? Array.Empty<ulong>();
|
|
InitializerFunctions = initializerFunctions ?? Array.Empty<ulong>();
|
|
InitFunctionEntryPoint = initFunctionEntryPoint;
|
|
_imageBase = imageBase;
|
|
ProcParamAddress = procParamAddress;
|
|
Title = title;
|
|
TitleId = titleId;
|
|
Version = version;
|
|
TlsModuleId = tlsModuleId;
|
|
TlsMemorySize = tlsMemorySize;
|
|
TlsStaticOffset = tlsStaticOffset;
|
|
}
|
|
|
|
public bool IsSelf { get; }
|
|
|
|
public ElfHeader ElfHeader { get; }
|
|
|
|
public IReadOnlyList<ProgramHeader> ProgramHeaders { get; }
|
|
|
|
public IReadOnlyList<VirtualMemoryRegion> MappedRegions { get; }
|
|
|
|
public IReadOnlyDictionary<ulong, string> ImportStubs { get; }
|
|
|
|
public IReadOnlyDictionary<string, ulong> RuntimeSymbols { get; }
|
|
|
|
public IReadOnlyList<ImportedSymbolRelocation> ImportedRelocations { get; }
|
|
|
|
public IReadOnlyList<ulong> PreInitializerFunctions { get; }
|
|
|
|
public IReadOnlyList<ulong> InitializerFunctions { get; }
|
|
|
|
public ulong InitFunctionEntryPoint { get; }
|
|
|
|
public ulong EntryPoint => ElfHeader.EntryPoint + _imageBase;
|
|
|
|
public ulong ProcParamAddress { get; }
|
|
|
|
public string? Title { get; }
|
|
|
|
public string? TitleId { get; }
|
|
|
|
public string? Version { get; }
|
|
|
|
public uint TlsModuleId { get; }
|
|
|
|
public ulong TlsMemorySize { get; }
|
|
|
|
/// <summary>Variant II distance from the thread pointer to this module's static TLS base.</summary>
|
|
public ulong TlsStaticOffset { get; }
|
|
}
|