Files
sharpemu/src/SharpEmu.Core/Loader/ProgramHeader.cs
T
Miguel Cruz 864cbb0fa0 [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
2026-07-16 02:02:34 +03:00

73 lines
1.4 KiB
C#

// Copyright (C) 2026 SharpEmu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
using System.Runtime.InteropServices;
namespace SharpEmu.Core.Loader;
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct ProgramHeader
{
private readonly uint _type;
private readonly uint _flags;
private readonly ulong _offset;
private readonly ulong _virtualAddress;
private readonly ulong _physicalAddress;
private readonly ulong _fileSize;
private readonly ulong _memorySize;
private readonly ulong _alignment;
public uint Type => _type;
public ProgramHeaderType HeaderType => (ProgramHeaderType)_type;
public uint RawFlags => _flags;
public ProgramHeaderFlags Flags => (ProgramHeaderFlags)_flags;
public ulong Offset => _offset;
public ulong VirtualAddress => _virtualAddress;
public ulong PhysicalAddress => _physicalAddress;
public ulong FileSize => _fileSize;
public ulong MemorySize => _memorySize;
public ulong Alignment => _alignment;
}
public enum ProgramHeaderType : uint
{
Null = 0,
Load = 1,
Dynamic = 2,
Tls = 7,
GnuEhFrame = 0x6474E550,
SceRela = 0x60000000,
SceProcParam = 0x61000001,
SceDynLibData = 0x61000000,
SceRelro = 0x61000010,
}
[Flags]
public enum ProgramHeaderFlags : uint
{
None = 0,
Execute = 0x1,
Write = 0x2,
Read = 0x4,
}